我有兩個Web服務器,都在Lighttpd + php(通過fastCGI)。Httpd +/bin/false == system()?
[[email protected] ~]$ lighttpd -v
lighttpd/1.4.29 (ssl) - a light and fast webserver
Build-Date: Aug 7 2011 10:52:01
[[email protected] ~]$ php -v
PHP 5.3.8 with Suhosin-Patch (cli) (built: Sep 30 2011 05:34:36)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
[[email protected] ~]$ php-cgi -v
PHP 5.3.8 with Suhosin-Patch (cgi-fcgi) (built: Sep 30 2011 05:35:14)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
Lighttpd的和php-cgi同時根據用戶的 'http' 與/bin中運行/假(假的)外殼:通過PHP的系統
[[email protected] ~]$ cat /etc/passwd | grep http
http:x:33:33:http:/srv/http:/bin/false
[[email protected] ~]$ ps aux | grep "lighttpd\_php-cgi"
http 1291 0.0 1.1 5152 2816 tty1 S Oct06 0:00 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
http 1292 0.0 1.5 14476 3904 ? Ss Oct06 0:00 /usr/bin/php-cgi
但我仍然可以執行shell命令( )功能(例如)!
在我的php.ini中沒有disable_functions。 如果我執行系統( 「WHOAMI」)或系統( 「ID」)通過PHP,我得到如下:
http
uid=33(http) gid=33(http) groups=33(http)
(就像它必須是)。
我能以/bin/false作爲shell執行用戶命令的原因是什麼?
哦,不知道。謝謝,我會記得! – xaero