NMAP

From Indie IT Wiki

Find DHCP Server

sudo nmap -sU -p67 --script broadcast-dhcp-discover

Update MAC Address Database

sudo -i
cd
mkdir misc
cd misc
apt-get install moreutils
wget https://raw.githubusercontent.com/dtonhofer/ieee_oui_downloader/master/update_nmap_mac_db.sh
chmod +x update_nmap_mac_db.sh
./update_nmap_mac_db.sh
mv /usr/share/nmap/nmap-mac-prefixes /root/misc/
mv /tmp/nmap_oui_processing.sZXEXK/nmap-mac-prefixes /usr/share/nmap/nmap-mac-prefixes
nmap -Pn -r -n 192.168.0.0/24

Thanks - https://github.com/dtonhofer/ieee_oui_downloader

Show Hosts With Specific Open Ports

nmap --open -p 22,80 192.168.0.1-254 -oG - | grep "/open" | awk '{ print $2 }'

IPv4

IPv6