Страница 1 из 1
Как защитится от shell?
Добавлено: 2010-08-06 13:38:21
zed1
Всем привет.
Пользователь благодаря шеллу может лазить в других папках сервера, как это можно устранить?
Спасибо.
Re: Как защитится от shell?
Добавлено: 2010-08-06 15:06:18
Гость
zed1 писал(а):как это можно устранить?
запереть юзера внутри
chroot(2). Вот, например, как это делает
ftpd(8):
In the last case, ftpd takes special measures to restrict the client's
access privileges. The server performs a chroot(2) to the home directory
of the “ftp” user. As a special case if the “ftp” user's home directory
pathname contains the /./ separator, ftpd uses its left-hand side as the
name of the directory to do chroot(2) to, and its right-hand side to
change the current directory to afterwards.
Re: Как защитится от shell?
Добавлено: 2010-08-06 19:22:33
zed1
всё намного проще, надо отключить функции в php.ini:
dl, shell_exec, exec, system, passthru, proc_open, proc_nice, socket_create, socket_open, proc_get_status, proc_close, proc_terminate, posix_mkfifo,popen
делается так:
к
дописываем
Код: Выделить всё
disable_functions = dl, shell_exec, exec, system, passthru, proc_open, proc_nice, socket_create, socket_open, proc_get_status, proc_close, proc_terminate, posix_mkfifo,popen
и вуаля
шеллы не страшны

Re: Как защитится от shell?
Добавлено: 2010-08-23 19:48:14
Overseer
Код: Выделить всё
/dev/mirror/gm0s1g on /tmp (ufs, local, noexec, nosuid, soft-updates)
/dev/mirror/gm0s1e on /var (ufs, local, noexec, nosuid, soft-updates)
только при обновлении системы нужно перемаунтить.
даже если скрипткид зальет бота в /tmp, запустить все равно не сможет.