用于检测BlueKeep漏洞(CVE-2019-0708)的Python脚本,支持TLS/SSL
本脚本衍生自 @zerosum0x0 编写的Metasploit模块 https://github.com/zerosum0x0/CVE-2019-0708
RC4代码取自 https://github.com/DavidBuchanan314/rc4
detect_bluekeep.py 需要 pyasn1 和 cryptography 这两个 Python 模块。
可通过以下方式安装:
pip install -r requirements.txt
或
pip3 install pyasn1 pyasn1_modules cryptography
添加了对 x509 证书的处理。修复了 issue #3
请勿使用 0.9 和 0.10 版本, 这两个版本在针对 issue #3 进行实验时存在缺陷。
当服务器不支持 SSL/TLS 时,回退到标准 RDP 安全协议。
脚本现在__支持 SSL/TLS 安全协议__,默认启用。若希望使用标准 RDP 安全协议,请使用 --notls 命令行参数。
# ./detect_bluekeep.py
usage: detect_bluekeep.py [-h] [--version] [-d] [--notls] [-l [LOGFILE]] [-w WORKERS]
[host [host ...]]
positional arguments:
host 目标列表(IP地址或子网)
optional arguments:
-h, --help 显示此帮助信息并退出
--version 显示程序版本号并退出
-d, --debug 详细输出
--notls 禁用 TLS 安全
-l [LOGFILE], --logfile [LOGFILE]
输出日志到文件
-w WORKERS, --workers WORKERS
并行工作线程数
可使用 IPv4 地址列表运行:
# ./detect_bluekeep.py 192.168.158.241 192.168.158.242 192.168.158.247 192.168.162.73 192.168.162.70
2019-06-03 09:58:01,255 'Starting ./detect_bluekeep.py'
2019-06-03 09:58:01,255 './detect_bluekeep.py 192.168.158.241 192.168.158.242 192.168.158.247 192.168.162.73 192.168.162.70'
2019-06-03 09:58:01,256 'Going to scan 5 hosts, in 300 parallel tasks'
2019-06-03 09:58:01,366 '[-] [192.168.162.73] Status: Unknown'
2019-06-03 09:58:02,222 '[+] [192.168.158.241] Status: Vulnerable'
2019-06-03 09:58:02,887 '[+] [192.168.158.242] Status: Vulnerable'
2019-06-03 09:58:06,262 '[-] [192.168.162.70] Status: No RDP'
2019-06-03 09:58:06,262 '[-] [192.168.158.247] Status: No RDP'
或扫描整个子网:
# ./detect_bluekeep.py 192.168.158.241/24 192.168.162.70/28
Apache 2.0