LINUX.ORG.RU

в чём уязвимость chroot для пользователей FTP?


0

0

Читаю man vsftpd.conf:

> chroot_local_user

> If set to YES, local users will be (by default) placed in a chroot() jail in their home directory after login. Warning: This option has security implications, especially if the users have upload permission, or shell access. Only enable if you know what you are doing. Note that these security implications are not vsftpd specific. They apply to all FTP daemons which offer to put local in chroot() jails.

Хочу понять, в чём тут потенциальная уязвимость (security implication). Погуглил на тему "ftp chroot security implication", нашёл вот что:

> Q) Help! What are the security implications referred to in the "chroot_local_user" option?

> A) Firstly note that other ftp daemons have the same implications. It is a generic problem.

> The problem isn't too severe, but it is this: Some people have FTP user accounts which are not trusted to have full shell access. If these accounts can also upload files, there is a small risk. A bad user now has control of the filesystem root, which is their home directory. The ftp daemon might cause some config file to be read - e.g. /etc/some_file. With chroot(), this file is now under the control of the user. vsftpd is careful in this area. But, the system's libc might want to open locale config files or other settings...

Вопрос: известны ли какие-нибудь реальные примеры, когда chroot в FTP для локальных пользователей является уязвимостью?

★★

Ответ на: комментарий от birdie

>У vsftpd вообще до сих пор нет ни одной уязвимости.

Однако его настройка по умолчанию, явно не соответствует его названию, chroot выключен, root'a вроде тоже пускает.

bugzilla
()

>Вопрос: известны ли какие-нибудь реальные примеры, когда chroot в FTP для локальных пользователей является уязвимостью?

реальные - не знаю, вымышленые - пожалуйста. предположим, у тебя есть вебсервер, а в нём каталог, например, /home/www/forum/upload, с правами 777. тогда туда можна закачать файл типа aaa.php, сожержищий, к примеру, <? system($_REQUEST["cmd"]) ?> и выполнить его через вебинтерфейс, например http://host/forum/upload/aaa.php?cmd=ls%20-la ну и т.п. правда, если юзер имеет полноценный шелл, то он это и так может сделать. а если только фтп, то по-идее не должен. ещё можна /etc/passwd прочитать и продать все логины спамерам :) , только если их там много

Firestorm
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.