Installing and Using netdiscover
to Identify Network Devices
Having confirmed network connectivity, you will now learn how to discover devices on your local network using the netdiscover
tool. Since this tool may not be pre-installed in the Kali Linux container, you will first install it.
Start by updating the package list and installing netdiscover
. Type the following commands in the terminal, pressing Enter after each:
apt install -y netdiscover
These commands refresh the package list and install netdiscover
without prompting for confirmation. Wait for the installation to complete; it may take a few seconds.
Next, you need to identify the network interface to scan. You already used ip a
in Step 1, so look at your output or run it again to confirm your interface name (likely eth0
) and IP range (likely 172.17.0.0/16
for Docker environments).
Now, run the netdiscover
tool to scan the local network. Type the following command and press Enter:
netdiscover -i eth0 -r 172.17.0.0/16
The -i eth0
specifies the interface, and -r 172.17.0.0/16
defines the IP range to scan. If your interface name differs, replace eth0
accordingly.
Expected Output (example, actual output may vary):
Currently scanning: 172.17.0.0/16 | Screen View: Unique Hosts
2 Captured ARP Req/Rep packets, from 2 hosts. Total size: 120
_____________________________________________________________________________
IP At MAC Address Count Len MAC Vendor / Hostname
-----------------------------------------------------------------------------
172.17.0.1 02:42:ac:11:00:01 1 60 Unknown vendor
172.17.0.2 02:42:ac:11:00:02 1 60 Unknown vendor
This output lists IP addresses and MAC addresses of devices on the network. For instance, 172.17.0.2
might be your own system, and 172.17.0.1
could be the gateway. Let the scan run for a few seconds to detect devices, then stop it by pressing Ctrl+C
.
The netdiscover
tool uses ARP requests to detect active devices on the local network. This is useful for mapping out what devices are connected to the same network segment as your system, a common task in network diagnostics.