3.3.3.1 脚本介绍
Nmap 的脚本默认存在/xx/nmap/scripts 文件夹下,如图3-61所示。
·Nmap▶ |
scripts |
|
|
搜票scnipts |
|||
助(H) |
|||||||
刻录 新建文件夹 |
|||||||
名称 acarsd-info.nse address-info.nse afp-brute.nse afp-ls.nse afp-path-vuln.nse afp-serverinfo.nse afp-showmount.nse ajp-auth.nse ajp-brute.nse ajp-headers,nse ajp-methods.nse ajp-request.nse allseeingeye-info.nse amqp-info,nse asn-query.nse auth-owners.nse auth-spoof,ns backorifice-brute.nse backorfice-info.nse bacnet-info.nse |
修改日期 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 2016/12/1923:02 |
类型 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 NSE文件 |
大小 4 KB 9 KB 4 KB 7KB 7 KB 6 KB 3 KB 3 KB 3 KB 2 KB 3 KB 3 KB 7 KB 2 KB 15 KB 3 KB 1KB 10 KB 10 KB 41 KB |
图3-61 Nmap 的脚本
Nmap 的脚本主要分为以 下几类。
●Auth: 负责处理鉴权证书(绕过鉴权)的脚本。
●Broadcast: 在局域网内探查更多服务的开启情况,如DHCP/DNS/ SQLServer等。
● Brute: 针对常见的应用提供暴力破解方式,如HTTP/SMTP等。
● Default: 使用-sC或-A选项扫描时默认的脚本,提供基本的脚本扫描能
力。
● Discovery: 对网络进行更多信息的搜集,如SMB枚举、SNMP查询等。
●Dos: 用于进行拒绝服务攻击。
● Exploit: 利用已知的漏洞入侵系统。
●External: 利用第三方的数据库或资源。例如,进行Whois解析。
●Fuzzer: 模糊测试脚本,发送异常的包到目标机,探测出潜在漏洞。
●Intrusive: 入侵性的脚本,此类脚本可能引发对方的IDS/IPS的记录或屏
蔽。
●Malware: 探测目标机是否感染了病毒、开启后门等信息。
●Safe: 此类与Intrusive相反,属于安全性脚本。
●Version: 负责增强服务与版本扫描功能的脚本。
●Vuln: 负责检查目标机是否有常见漏洞,如MS08-067。
3.3.3.2常用脚本
用户还可根据需要设置——script= 类别进行扫描,常用参数如下所示。 ●-sC/——script=default: 使用默认的脚本进行扫描。
●——script=<Lua scripts>: 使用某个脚本进行扫描。
●——script-args=key1=value1,key2=value2……: 该参数用于传递脚本
里的参数,key1是参数名,该参数对应value1这个值。如有更多的参数,使用逗号连
接。
●-script-args-file=filename: 使用文件为脚本提供参数。
●——script-trace: 如果设置该参数,则显示脚本执行过程中发送与接收的 数据。
●——script-updatedb: 在Nmap的scripts目录里有一个script.db 文件,该
文件保存了当前Nmap 可用的脚本,类似于一个小型数据库,如果我们开启Nmap 并调 用了此参数,则Nmap会自行扫描scripts目录中的扩展脚本,进行数据库更新。
●——script-help: 调用该参数后,Nmap会输出该脚本对应的脚本使用参 数,以及详细的介绍信息。
3.3.3.3实例
1.鉴权扫描
使用——script=auth可以对目标主机或目标主机所在的网段进行应用弱口令 检测,如图3-62所示。
nmap——script=auth 192.168.0.105
图3-62鉴权扫描
2.暴力破解攻击
Nmap 具有暴力破解的功能,可对数据库、SMB、SNMP 等进行简单密码的
暴力猜解,如图3-63所示。
nmap——script=brute 192.168.0.105
P:Wnap>nnap -script-hrute 192.168.0.185
starting Nhap 7.48(httpet//amap.ary >at 2817-86-1122:817D1ú±a×7e± Nnap scan report for 192.168.6.185
Host is up<8.8835s latency>.
Not shovm:997 closed ports
22/tcp open
ssh
443/tcp open httpe
tcitrix-brute-xn1:PAILED:No donain specified <use ntdonain argunent) t http-hrute:
H_Path"/"does not require authentication
982/tep open iss-realsecure
wnauthd-brute:
.Sta
i
i
n:
:r
or
id2a
ungt
ef
suensd in 682 seconds,average tpa:3.7 NAC Address:8C:A9:82:57:21:6A<Intel Corporate)
Nnap done:1 IP address(1 host up)scanned in 689.45 seconds
图3-63暴力破解攻击
3.扫描常见的漏洞
Nmap 具备漏洞扫描的功能,可以检查目标主机或网段是否存在常见的漏洞, 如图3-64所示。
nmap——script=vuln 192.168.0.105
图3-65应用服务扫描
5.探测局域网内更多服务开启的情况
输入以下命令即可探测局域网内更多服务开启的情况,如图3-66和图3-67所
示。
nmap -n -p445 — —script=broadcast 192.168.0.105
b 安 全 攻 防 : 渗 透 测 试 实 战 指 南
ff82::1:ff57:216a
ff82::fb
ff82::1:ff5?:216a ff82::fb
targets-ipv6-nulticast-echo:
<NDP Solicited-node)
<nDNSv⁶>
<NDP Solicited-node>
(nDNSv6)
IP:fe80::?6ac:5fff:fedf:ced5 MAC:74:ac:5f:df:ce:d5
IP:fe8d::8ea9:82ff:fe5?:216a MAC:8c:a9:82:57:21:6a
Wse --script-args-newtaryets to add the resulte as
IP:fe⁸θ::&ea9:82ff:fe5?:216a MAC:8c:a9:82:5?:21:6a
Use --script-args-newtargets to add the resulte as
IP:fe8d::76ac:5fff:fedf:ced5
IP:fe&O::&ea9:&2ff:fe5?:216a
IP:fe8d::b42e:22ae:2a10:bd2c
MaC:74:ac:5f:df:ce:d5
MAC:8c:a9:82:57:21:6a
MAC:cc:af:?8:92:ba:cb
Use --acript-args-nevtaryete to add the resulta as targete
targets-ipw6-nulticast-slaac:
IUPse(:fe)8
s(7)6carci:p(5)
args(:fedf:)
nev(ed5)taryete toMa(n)
d:74t:
ce:5fresu(:df:ce)l:
e(5) as targete(I)FACE:eth8
Failed to resolve"-n".
Pailed to resolve "-p".
Nnap scan report for 192.168.0.185
Host is up<6.826s latency).
Not shown:997 closed ports
PORT STATE SERUICE
22/tcp open ssh
443/tcp open https
382/tcp open iss-realsecure
NAC Address:8C:A9:82:57:21:6A<Intel Corporate>
Nnap done:1 IP address(1 host up)scanned in 57.97 seconds
图3-67探测局域网内更多服务开启的情况(2)
6.Whois解析
利 用 第 三 方 的 数 据 库 或 资 源 查 询 目 标 地 址 的 信 息 , 例 如 进 行Whois 解 析 , 如 图
3-68所示。
nmap-script external baidu.com