Nmap 不执行作为参数提供的脚本

Nmap 不执行作为参数提供的脚本

我正在运行 Kali Linux,并尝试针对实验室中的主机运行 nmap 脚本。我输入的命令和输出是:

root@kali:/usr/share/nmap/scripts# nmap --script dns-fuzz --script-args timelimit=2h 192.168.34.52 -d

Starting Nmap 6.40 ( http://nmap.org ) at 2014-01-24 18:44 CET
PORTS: Using top 1000 ports found open (TCP:1000, UDP:0, SCTP:0)
--------------- Timing report ---------------
  hostgroups: min 1, max 100000
  rtt-timeouts: init 1000, min 100, max 10000
  max-scan-delay: TCP 1000, UDP 1000, SCTP 1000
  parallelism: min 0, max 0
  max-retries: 10, host-timeout: 0
  min-rate: 0, max-rate: 0
---------------------------------------------
NSE: Using Lua 5.2.
NSE: Script Arguments seen from CLI: timelimit=2h
NSE: Loaded 1 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 1) scan.
Initiating ARP Ping Scan at 18:44
Scanning 192.168.34.52 [1 port]
Packet capture filter (device eth0): arp and arp[18:4] = 0x000C2905 and arp[22:2] = 0x57E5
Completed ARP Ping Scan at 18:44, 0.01s elapsed (1 total hosts)
Overall sending rates: 114.85 packets / s, 4823.71 bytes / s.
mass_rdns: Using DNS server 8.8.8.8
mass_rdns: Using DNS server 8.8.4.4
Initiating Parallel DNS resolution of 1 host. at 18:44
mass_rdns: 0.02s 0/1 [#: 2, OK: 0, NX: 0, DR: 0, SF: 0, TR: 1]
Completed Parallel DNS resolution of 1 host. at 18:44, 0.02s elapsed
DNS resolution of 1 IPs took 0.02s. Mode: Async [#: 2, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating SYN Stealth Scan at 18:44
Scanning 192.168.34.52 [1000 ports]
Packet capture filter (device eth0): dst host 192.168.34.51 and (icmp or icmp6 or ((tcp or udp or sctp) and (src host 192.168.34.52)))
Discovered open port 22/tcp on 192.168.34.52
Discovered open port 53/tcp on 192.168.34.52
Completed SYN Stealth Scan at 18:44, 0.04s elapsed (1000 total ports)
Overall sending rates: 26565.36 packets / s, 1168876.02 bytes / s.
NSE: Script scanning 192.168.34.52.
NSE: Starting runlevel 1 (of 1) scan.
Nmap scan report for 192.168.34.52
Host is up, received arp-response (0.00030s latency).
Scanned at 2014-01-24 18:44:48 CET for 0s
Not shown: 998 closed ports
Reason: 998 resets
PORT   STATE SERVICE REASON
22/tcp open  ssh     syn-ack
53/tcp open  domain  syn-ack
MAC Address: 00:0C:29:7B:5E:8E (VMware)
Final times for host: srtt: 299 rttvar: 23  to: 100000

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 1) scan.
Read from /usr/bin/../share/nmap: nmap-mac-prefixes nmap-payloads nmap-services.
Nmap done: 1 IP address (1 host up) scanned in 0.15 seconds
           Raw packets sent: 1001 (44.028KB) | Rcvd: 1001 (40.036KB)

这个问题不仅仅发生在这个特定的脚本中,而是发生在所有的脚本中。

这里也提出了具有相同设置的相同问题:Nmap 不使用参数中提供的脚本

但由于“-d”输出的声誉太低,我无法发表评论,所以我决定提出一个新问题。我希望这样没问题。

答案1

Nmap 脚本引擎 (NSE) 脚本根据名为规则。 如果是dns-fuzz,规则是:

portrule = shortport.portnumber(53, "udp")

使用肖特波特图书馆,该脚本请求仅在打开 53 UDP 端口的主机上运行。

您的示例扫描是 TCP 扫描。由于没有扫描 UDP 端口,因此 dns-fuzz 脚本永远不会运行。DNS 可以使用 TCP 作为传输,因此将此脚本转换为适用于两者应该没有问题。在它工作之前必须进行一些转换(proto="udp"例如,删除显式),但这应该是一个简单的项目。

编辑:TCP 支持于 2014 年 1 月 31 日添加到此脚本,并可在 Nmap 6.45 及更高版本中使用。

相关内容