Eli Fulkerson .com HomeProjectsMacdb



"macdb" is a command line utility that annotates stdin with information about MAC addresses. This is intended to complement output of things like "arp -a" or Cisco's "show arp" or "show fdb" etc.

That is... you provide your own "oui.txt" and "known.txt" file. The "oui.txt" file could be for instance http://standards-oui.ieee.org/oui.txt or the Wireshark manufacturer database. The "known.txt" file is provided by you and includes any additional information you want to have show in the output. (The format for that file is lines of "mac address" and "whatever text you want" separated by whitespace.) When you pipe your input into macdb, it pops out with the additional annotations on the right hand side.

The text files can either live in the same directory as the script itself or can be in the current directory. Or you can specify then every time with the options like a savage.

For instance, you drop the output of your arp command into arp.txt, then fire off a "cat arp.txt | macdb"

Its written in python, so you need to have python on your system and may have to adjust the shebang.


  $macdb -h
  macdb [options]

  --help, -h              Show this help message and exit.
  --ouifile=OUIFILE, -o OUIFILE
  Use specified oui textfile (default oui.txt)
  --knownfile=KNOWNFILE, -k KNOWNFILE
  Use specified list of known macs (default known.txt)
  --noouifile, -x         Don't lookup anything in the oui textfile
  --noknownfile, -n       Don't lookup anything in the known textfile

Example Output:

  $arp -a | macdb
  Interface: --- 0xa
  Internet Address      Physical Address      Type           14-91-82-b9-84-99     dynamic OUI: BelkinIn # Belkin International Inc.           b8-27-eb-b4-e9-b5     dynamic OUI: Raspberr # Raspberry Pi Foundation          00-1b-a9-75-3d-86     dynamic OUI: BrotherI # Brother industries, LTD.         08-05-81-eb-e5-dc     dynamic OUI: Roku # Roku, Inc.         b8-3e-59-2c-55-41     dynamic OUI: Roku # Roku, Inc.         ff-ff-ff-ff-ff-ff     static OUI: Broadcast            01-00-5e-00-00-16     static OUI: IPv4mcast           01-00-5e-00-00-fb     static OUI: IPv4mcast           01-00-5e-00-00-fc     static OUI: IPv4mcast           01-00-5e-42-1e-01     static OUI: IPv4mcast           01-00-5e-00-00-fa     static OUI: IPv4mcast       01-00-5e-40-98-8f     static OUI: IPv4mcast       01-00-5e-7f-ff-fa     static OUI: IPv4mcast       ff-ff-ff-ff-ff-ff     static OUI: Broadcast