通过 SMB 检查 CVE-2019-1040 漏洞。 该脚本将与目标主机建立连接,并发送无效的 NTLM 认证。如果该认证被接受,则说明目标存在 CVE-2019-1040 漏洞,你可以使用 ntlmrelayx 执行 MIC Remove 攻击。
请注意,此操作不会产生失败的登录尝试,因为登录信息本身是有效的,只是缺少 NTLM 消息完整性代码,因此认证被拒绝,且不会增加 badpwdcount 计数。
该脚本需要较新版本的 impacket。应同时支持 Python 2 和 Python 3(Python 3 需要使用来自 git 的 impacket 版本)。
[*] CVE-2019-1040 scanner by @_dirkjan / Fox-IT - Based on impacket by SecureAuth
usage: scan.py [-h] [-target-file file] [-port [destination port]]
[-hashes LMHASH:NTHASH]
target
CVE-2019-1040 scanner - Connects over SMB and attempts to authenticate with
invalid NTLM packets. If accepted, target is vulnerable to MIC remove attack
positional arguments:
target [[domain/]username[:password]@]<targetName or address>
optional arguments:
-h, --help show this help message and exit
connection:
-target-file file Use the targets in the specified file instead of the
one on the command line (you must still specify
something as target name)
-port [destination port]
Destination port to connect to SMB Server
authentication:
-hashes LMHASH:NTHASH
NTLM hashes, format is LMHASH:NTHASH