Created
August 14, 2017 21:33
-
-
Save cryptolok/37c8a8e3fe0e1dcfa87cc384d91bd120 to your computer and use it in GitHub Desktop.
MAC address offline lookup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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