nmap使用脚本
Nmap 使用脚本
Nmap 的 NSE(Nmap Scripting Engine)允许用户使用脚本进行更深入的扫描和测试。
nmap -sC ip地址
nmap --script http-vuln-cve2017-5638 -p 80 ip地址
nmap --script vuln ip地址
nmap --script ftp-brute ip地址
nmap --script http-open-proxy ip地址
nmap --script http-enum ip地址
nmap --script ssh-brute ip地址
nmap --script whois-domain ip地址
nmap --script dns-brute ip地址
nmap --script malware-detect ip地址
nmap --script smb-enum-shares ip地址
nmap --script http-sql-injection ip地址
nmap --script broadcast-ping ip地址
nmap --script upnp-info ip地址
nmap --script http-default-accounts ip地址
nmap --script http-enum ip地址
nmap --script nfs-showmount ip地址
-sC(Nmap Scripting Engine with default scripts):使用默认的Nmap脚本集进行扫描。
--script:指定要运行的NSE脚本。
--script http-vuln-cve2017-5638:检测特定的HTTP漏洞。
--script vuln:运行所有与漏洞检测相关的脚本。
--script ftp-brute:运行 FTP 弱密码暴力破解脚本。
--script http-open-proxy: 检测目标是否为开放HTTP代理服务器。
--script ssh-brute:运行 SSH 弱密码暴力破解脚本。
--script http-enum:枚举 HTTP 服务和资源,检测HTTP服务版本。
--script whois-domain:查询目标域名的 WHOIS 信息。
--script dns-brute:进行 DNS 子域名暴力破解。
--script malware-detect:检测已知的恶意软件,检测目标系统是否感染了已知的恶意软件。
--script smb-enum-shares:枚举 SMB 共享。
--script http-sql-injection:检测 HTTP SQL 注入漏洞。
--script broadcast-ping:通过广播 ping 扫描发现网络上的主机。
--script upnp-info:UPnP 设备发现,收集 UPnP 设备信息。
--script http-default-accounts:检测 HTTP 服务的默认帐户。
--script http-enum:枚举 HTTP 服务器上的目录和文件。
--script nfs-showmount:枚举 NFS 共享
以下是一些常用的 Nmap 脚本示例及其用途:
检测 SQL 注入漏洞
使用 sql注入脚本可以检测目标系统上是否存在 SQL 注入漏洞。
nmap --script=sql-injection <target>
扫描目标上的漏洞
使用 vuln 脚本可以扫描目标主机上已知的漏洞。
nmap --script=vuln <target>
枚举目标上的 SMB 服务
使用 smb-enum-shares 脚本可以枚举目标主机上的 SMB 共享。
nmap --script=smb-enum-shares <target>
检测目标的 SSH 服务是否允许密码认证
使用 ssh2-enum-algos 脚本可以检测 SSH 服务的密码认证算法。
nmap --script=ssh2-enum-algos <target>
脚本类别和目录
Nmap 脚本被组织成不同的类别,并存储在 /usr/share/nmap/scripts/ 目录下。可以使用以下命令查看所有可用的脚本及其类别:
nmap --script=list
脚本参数
许多 Nmap 脚本接受自定义参数来改变其行为。可以通过以下命令查看特定脚本的可用参数:
nmap --script=<script-name> --script-args=list <target>
在使用 Nmap 脚本时,请确保你理解脚本的功能和影响,避免对目标系统造成不必要的干扰或损害。同时,只有在获得授权的情况下,才能对目标系统执行脚本扫描。