Host Discovery

Host Discovery #

At a Glance #

One of the first steps during the network enumeration is to reduce a set of IPs into a list of active or interesting hosts. Depending on if you are inside the network or scanning remotely, how much noise you can make, and your discovery requirements, different tools, and options are available.

Internal #

Passive #

Passive discovery relies on monitoring network layer traffic to detect network topology, services, and applications.

As no packets are injected into the network, there is no risk of unintentional service disruption. It is also suitable for finding intermittently offered or protected services often missed by active scanning. 1

netdiscover - ARP 2 #

sudo netdiscover -p
  • -p: passive mode. It does not send anything, but does only sniff.

p0f - Fingerprinting 3 #

sudo p0f -p
  • -p: promiscuous mode; by default, it listens only to packet addressed or routed through. On IP-enabled interfaces can be detected remotely.

bettercap 4 #

net.recon on
net.show.meta true
net.show

Active #

In contrast, active discovery does inject a variety of packets into the network.

It is well suited for open port discovery and fingerprinting. However, these techniques are not without drawbacks. Scans can be invasive, generate too much noise, and in some cases, cause service interruptions due to the type of packets sent.

netdiscover - ARP 2 #

sudo netdiscover -r 10.0.0.0/24
  • -r <range>: scan a given range instead of auto scan.

Nmap #

nmap -sn 10.0.0.0/24
  • -sn: No port scan AKA ping scan. 5 Consists of an ICMP echo request, TCP SYN to port 443, TCP ACK to port 80, and an ICMP timestamp request by default.

nbtscan - NetBIOS 6 #

sudo nbtscan 10.0.0.0/24

bettercap 7 #

net.probe on
net.show.meta true
net.show

ICMP #

Refer to External ICMP Scanning

External #

ICMP #

As defined in RFC 792, ICMP messages are typically used for diagnostic or control purposes or generated in response to errors in IP operations (as specified in RFC 1122).8 Although it is possible to use ICMP requests to discover if a host is up or not, it is common to find all these packets being filtered, making it an unreliable method.

ping #

ping -c 1 10.0.0.3
  • -c <count>: stops after count replies.

fping 9 #

fping -g 10.0.0.0/24
  • -g, --generate <target>: generates target list. target can be start and end IP or a CIDR address.

Nmap #

nmap -PEPM -sn -n 10.0.0.0/24
Parameters
  • -PE; -PP; -PM: ICMP echo, timestamp, and netmask request discovery probes.
  • -sn: No port scan.
  • -n: No DNS resolution.

Port Discovery #

Another commonly used technique is port scanning. It allows you to identify running services, consequently, interesting hosts. See Port Scanning.


  1. Whyte, David. Network Scanning Detection Strategies for Enterprise Networks. Sept. 2008, pp. 12-22 https://pdfs.semanticscholar.org/bb60/dc6cf24ea1f17126511e0998d3c55bdd50f9.pdf↩︎

  2. “GitHub - Netdiscover-Scanner/Netdiscover: Netdiscover, ARP Scanner (Official Repository).” GitHub, https://github.com/netdiscover-scanner/netdiscover↩︎

  3. Zalewski, Michal. “P0f V3.” [Lcamtuf.Coredump.Cx], https://lcamtuf.coredump.cx/p0f3/↩︎

  4. “Bettercap:: Net.Recon.” Bettercap, https://www.bettercap.org/modules/ethernet/net.recon/↩︎

  5. “Host Discovery | Nmap Network Scanning.” Nmap: The Network Mapper - Free Security Scanner, https://nmap.org/book/man-host-discovery.html↩︎

  6. “NETBIOS Nameserver Scanner.” Steve Friedl’s Home Page, http://www.unixwiz.net/tools/nbtscan.html↩︎

  7. “Bettercap:: Net.Probe.” Bettercap, https://www.bettercap.org/modules/ethernet/net.probe/↩︎

  8. Forouzan, Behrouz A. Data Communications and Networking. Huga Media, 2007, pp. 621–630. ↩︎

  9. Schweikert, David. “Fping.” Fping Homepage, https://fping.org/↩︎