Error after starting command > nmap
dnet: Failed to open device eth0 after installing NMAP.
QUITTING!
Error after starting command > nmap
dnet: Failed to open device eth0 after installing NMAP.
QUITTING!
In my case, the error was caused by nmap
being installed through Snap.
In order to get nmap to work, I had to tell snap to connect it to the network-control:
sudo snap connect nmap:network-control
After that everything worked fine.
TLDR: Use the --unprivileged
nmap option.
I just suffered the same problem when tried to scan/test hosts thru a Wireguard 0.3.14 tunnel in Windows 8.1 and Windows 7 using the last available versions, nmap 7.91, npcap 1.31. Tried several solutions/combinations, running as admin, reinstalling, etc., except downgrading to Winpcap 4.1.3 (the last available) with the same result:
C:\Windows\system32>nmap -n -P0 -p 22 192.168.20.1
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower.
Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-08 13:28 Hora de verano central (México)
dnet: Failed to open device eth0
QUITTING!
It's strange that the interface listing of nmap --iflist
does not show a device name associated with eth0
(also doesn't show a MAC address, maybe it's Wireguard interface driver install/hooks at fault here). Relevant lines:
C:\Windows\system32>nmap --iflist
Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-08 13:32 Hora de verano central (México)
************************INTERFACES************************
DEV (SHORT) IP/MASK TYPE UP MTU MAC
eth0 (eth0) 10.10.252.92/32 ethernet up 65535 00:00:00:00:00:00
:
DEV WINDEVICE
eth0 <none>
Relevant route print
:
C:\Windows\system32>route print
===========================================================================
Interface list
8...........................Wintun Userspace Tunnel #77
:
IPv4 Route table
===========================================================================
Active routes:
Network Destination Net mask Gateway Interface Metric
192.168.20.0 255.255.255.0 On-link 10.10.252.92 5
192.168.20.255 255.255.255.255 On-link 10.10.252.92 261
Solved it using the --unprivileged
option:
C:\Windows\system32>nmap --unprivileged -n -P0 -p 22 192.168.20.1
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower.
Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-08 13:22 Hora de verano central (MÚxico)
Nmap scan report for 192.168.20.1
Host is up (0.20s latency).
PORT STATE SERVICE
22/tcp open ssh
Nmap done: 1 IP address (1 host up) scanned in 0.29 seconds
After installing nmap-7.80-setup.exe, install please install npcap-0.9986.exe which is fully compatible with latest Windows 10 releases.
You can try this: nmap (IP) -P (puerto) --interface (ethX) or install npcap from oficially page https://nmap.org/npcap/#download
Not always too late.. I've seen this "reinstall or install npcapxversion all around the web but my solution was simple and logic based. Just enable NPCAP protocols ONLY in the network adapter you want to use, disable on the others.
The logic on reinstalling may be the order in wich npcap disable and reenable network interfaces giving top priority (disabling and re-enabling at last) to the actual one you are using. But if you don't wanna mess with interface priorities.. do as I said and just enable NpCap only in the adapter you need nmap to.
If you are using Nessus also in the same machine, you are not able to use nmap. NPCAP will be used by Nessus and same is required for NMAP as well.
© 2022 - 2024 — McMap. All rights reserved.
Ubuntu 22.04 LTS
. – Murphey