linux:nmap
This is an old revision of the document!
Table of Contents
nmap
Local network scan
sudo nmap -n -sP 192.168.1.0/24
results in:
Nmap scan report for 192.168.1.1 Host is up (0.00032s latency). MAC Address: 00:1D:AA:B1:DB:18 (DrayTek)
Local scan with MAC addresses
sudo nmap -sP 172.31.201.0/24 | awk '/Nmap scan report for/{printf $5;}/MAC Address:/{print " => "$3;}' | sort -V
results in:
172.31.201.80 => 00:50:56:AF:56:FB 172.31.201.97 => 00:26:73:78:51:42 server1.company.internal.local => 3C:D9:2B:70:BC:99
Local scan with MAC and vendor
sudo nmap -n -sn 192.168.1.0/24 | awk '/Nmap scan report for/{printf $5;}/MAC Address:/{print " => "substr($0, index($0,$3)) }' | sort -V
results in:
10.10.10.24 => B0:5A:DA:EB:2A:C4 (Hewlett Packard)
linux/nmap.1619994295.txt.gz · Last modified: 2023/05/29 11:53 (external edit)