echo system("/usr/bin/whoami", $ret);
echo $ret;
PHP 4.3.9 on Apache 2.0.52, CentOS 4.5. Safe mode is off, I can run programs as the apache user account from the command line, but all programs run from PHP fail with exit code 127.
echo system("/usr/bin/whoami", $ret);
echo $ret;
PHP 4.3.9 on Apache 2.0.52, CentOS 4.5. Safe mode is off, I can run programs as the apache user account from the command line, but all programs run from PHP fail with exit code 127.
/usr/bin/whoami
存在,并且xx5
任何人都可以执行(并且可读, mode )。php.ini
和doc_root
,user_dir
如果设置了这些,它们可以限制您可以执行的操作。dmesg
或登录/var/log/
.&$ret
代替$ret
.exec()
和passthru()
,不同的函数可能适用于不同的情况。php.ini
Apache 和 cli 使用不同。