用于检测存在漏洞的 CVE-2020-0796 问题的 NSE 脚本,涉及 Microsoft SMBv3 压缩(又称 coronablue、SMBGhost)。
该脚本是 smb-protocols.nse 脚本的修改版本,修改了输出数据,用于检测 v3.11 并验证 CVE-2020-0796。
注意:此脚本仅对 SMBv3 上的 CVE-2020-0796 漏洞进行安全检测,不会尝试任何进一步的操作。
将 .nse 文件复制到 nmap/scripts/ 文件夹并运行更新
cp cve-2020-0796.nse /usr/share/nmap/scripts/
nmap --script-updatedb
运行:
nmap -p445 --script cve-2020-0796 <<target>>
-- @output
-- | smb-protocols:
-- | dialects:
-- | NT LM 0.12 (SMBv1) [dangerous, but default]
-- | 2.02
-- | 2.10
-- | 3.00
-- | 3.02
-- |_ 3.11 (SMBv3.11) LZNT1 compression algorithm - Vulnerable to CVE-2020-0796 SMBGhost
压缩检测基于 https://github.com/ollypwn/SMBGhost/ 实现。本可以利用 nselib 中的 smb.lua 来完成,但需要对函数进行大量修改,因此最终选择了使用套接字。
用于检测存在漏洞的 CVE-2020-1350 问题的 NSE 脚本,涉及 Microsoft DNS 服务器(又称 SIGRed)。
该脚本使用了 dns-nsid.nse 脚本的代码组件,并包含针对 CVE-2020-1350 的检测。
注意:此脚本仅对 Microsoft DNS 服务器上的 CVE-2020-1350 漏洞进行安全检测,仅供识别使用,不会尝试任何进一步的操作。该脚本并不完美,它依赖 dig CH TXT bind.version @target 的输出,当 DNS 版本号被隐藏时会失败。
将 .nse 文件复制到 nmap/scripts/ 文件夹并运行更新
cp cve-2020-1350.nse /usr/share/nmap/scripts/
nmap --script-updatedb
运行:
sudo nmap -sSU -p53 --script cve-2020-1350 <<target>>
sudo nmap -sSU -p53 --script cve-2020-1350 <<target>> --script-args output=<outputfile.txt>
用于搜索通过脚本参数提供的自定义 HTTP 标题的 NSE 脚本。此脚本有助于仅搜索并提供所需的 HTTP 标题结果。
将 .nse 文件复制到 nmap/scripts/ 文件夹并运行更新
cp http-custom-title.nse /usr/share/nmap/scripts/
nmap --script-updatedb
运行:
nmap --script ./http-custom-title.nse -p80 scanme.nmap.org --script-args customtitle='ScanMe'
nmap --script ./http-custom-title.nse <<target>> --script-args customtitle='Apache'
用于检查 vCenter 中的 CVE-2021-21972、CVE-2021-21973 漏洞。该脚本还会额外打印 vSphere 版本和构建号。
将 .nse 文件复制到 nmap/scripts/ 文件夹并运行更新
cp cve-2021-21972.nse /usr/share/nmap/scripts/
nmap --script-updatedb
运行:
nmap --script cve-2021-21972.nse -p443 <host> (optional: --script-args output=report.txt)