Skip to content

Instantly share code, notes, and snippets.

@cryptolok
Created August 14, 2017 21:33
Show Gist options
  • Save cryptolok/37c8a8e3fe0e1dcfa87cc384d91bd120 to your computer and use it in GitHub Desktop.
Save cryptolok/37c8a8e3fe0e1dcfa87cc384d91bd120 to your computer and use it in GitHub Desktop.
MAC address offline lookup
#!/bin/bash
MAC=$1
MAC=$(echo $MAC | tr [:lower:] [:upper:])
MAC=$(echo $MAC | tr ':' '-')
if [[ ! "$MAC" ]]
then
echo 'Usage: maclookup $MACADDRESS'
exit 1
fi
FILE=/usr/share/ieee-data/oui.txt
# get from https://www.scribd.com/document/35251216/Mac-Adrress-Listing or just install AirCrack-NG
OUI=$(echo $MAC | cut -d '-' -f 1-3)
RES=$(grep "$OUI" $FILE)
RES=$(echo $RES | cut -d ' ' -f 3-)
if [[ "$RES" ]]
then
echo $RES
else
echo '*UNKNOWN*'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment