靶机描述
Machine Name: Tre
Author: SunCSR Team
Difficulty: Intermediate
Tested: VMware Workstation 15.x Pro (This works better with VMware rather than VirtualBox)
DHCP: Enabled
Goal: Get the root shell i.e.(root@localhost:~#) and then obtain flag under /root).
Information: Your feedback is appreciated - Email: suncsr.challenges@gmail.com
下载 https://www.vulnhub.com/entry/tre-1,483/
清单
- 信息搜集
- netdiscover
- namp
- dirb
- dirsearch
- 利用
- 数据库密码泄露
- 提权
- suid
- 写入 /etc/passwd
信息搜集
主机发现
端口扫描
nmap -A -p1-65535 192.168.217.159
开放 22 80 8082
目录扫描
8082 端口
80 端口
nikto
得到 system 目录的密码
内容为
目录扫描
得到了 adminer.php 内容为
除此之外没有可利用信息
更换dirb扫描目录的字典
在config里找到了
这个密码可以在
adminer.php登陆
数据库中找到了
利用
得到低权限用户
ssh登陆
ssh tre@192.168.217.159
find / -perm -u=s -type f 2>/dev/null
看到了 /usr/bin/vim.tiny 将会用这个来提权
编辑 /etc/passwd
在最后一行写入,:wq! 来保存
得到root
现在切换用户密码为Password@973
得到了 root