Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Created November 19, 2018 09:33
Show Gist options
  • Save RichardBronosky/48cf4ce961124042f849d4a15d8961e7 to your computer and use it in GitHub Desktop.
Save RichardBronosky/48cf4ce961124042f849d4a15d8961e7 to your computer and use it in GitHub Desktop.
#!/bin/bash -eu
sudo nmap -sP -n $(
ip address show $(ip route get 8.8.8.8 | \
awk '$1=="none"{$5=$6} /8.8.8.8/{print $5; exit}'
) | \
awk '$1=="inet"{print $2}') | \
awk '/report for/{ip=$5} /MAC Address/{if($3 ~ "B8:27:EB")print(ip, $3)}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment