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.iniApache 和 cli 使用不同。