macos Nmap 不检索 MAC 地址和供应商

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10633753/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 09:10:45  来源:igfitidea点击:

Nmap not retrieving MAC address and Vendor

macosnetworkingnmapauditing

提问by raz3r

I've found a strange behaviour in Nmap (I am using version 5.51 if that matters but I have the same issue with version 5.00), on some networks this plugin does not retrieve MAC address and, consequently, Vendor. The strange thing is that it retrieves almost everything like operating system and so on but it does not print the MAC address. How is that possible? This is the command I use usually:

我在 Nmap 中发现了一个奇怪的行为(如果这很重要,我使用的是 5.51 版,但我在 5.00 版中也有同样的问题),在某些网络上,此插件无法检索 MAC 地址,因此无法检索供应商。奇怪的是,它检索了几乎所有内容,如操作系统等,但不打印 MAC 地址。这怎么可能?这是我通常使用的命令:

nmap -A -O 192.168.1.0/24 -oX mynetwork.xml

回答by bonsaiviking

The MAC address is only displayed when the scan is run with root privilege, so be sure to use sudo. As a diagnostic step, try doing a simple ping sweep (sudo nmap -sn 192.168.1.0/24), then immediately check your ARP cache (arp -an). If you don't see a lot of <incomplete>s, then Nmap isn't scanning your subnet properly. If you see 256 <incomplete>, and no MAC addresses, then something is wrong with your network setup, since you aren't seeing ARP responses to the requests Nmap is generating.

MAC 地址仅在以 root 权限运行扫描时显示,因此请务必使用sudo. 作为诊断步骤,请尝试执行简单的 ping 扫描 ( sudo nmap -sn 192.168.1.0/24),然后立即检查您的 ARP 缓存 ( arp -an)。如果您没有看到很多<incomplete>s,则 Nmap 没有正确扫描您的子网。如果您看到 256 <incomplete>,并且没有 MAC 地址,那么您的网络设置有问题,因为您没有看到对 Nmap 生成的请求的 ARP 响应。

回答by Daniel Roethlisberger

Nmap can only retrieve the MAC address if you are scanning hosts on the local subnet, directly reachable via layer 2 (ethernet or wifi). When you scan hosts across a router (default gateway), your scanning host will talk to the router on layer 2 when sending/receiving layer 3 packets, and thus, Nmap would only be able to see the router's MAC address, but not the destination host MAC address.

如果您正在扫描本地子网上的主机,Nmap 只能检索 MAC 地址,可通过第 2 层(以太网或 wifi)直接访问。当您通过路由器(默认网关)扫描主机时,您的扫描主机在发送/接收第 3 层数据包时将与第 2 层的路由器通信,因此,Nmap 只能看到路由器的 MAC 地址,而不能看到目的地主机 MAC 地址。

(While it is technically possible under some circumstances to determine the MAC address of a non-local host through protocols such NetBIOS, SNMP etc., and there are NSE scripts for that purpose, Nmap does not generally do that.)

(虽然在某些情况下技术上可以通过NetBIOS、SNMP 等协议确定非本地主机的 MAC 地址,并且有用于此目的的 NSE 脚本,但 Nmap 通常不会这样做。)

回答by Kirk Ireson

I was also having a lack of MAC address and vendor reporting with version 5.61TEST5, but I just installed version 6.00 and all seems to be working again, so you may want to try that now.

我在 5.61TEST5 版中也缺少 MAC 地址和供应商报告,但我刚刚安装了 6.00 版并且一切似乎都可以再次运行,因此您现在可能想尝试一下。