1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MAC Address Vendor

Discussion in 'T&T - Scripting' started by Joe Caverly, Feb 8, 2015.

  1. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    661
    Likes Received:
    8
    Code:
    ::----------------------------------------
    :: MACVENDOR.BTM
    :: Determine the vendor of a MAC Address
    ::
    :: Requires the file macadr.txt
    ::  which is downloaded if not found
    ::
    :: 2015-February-08
    :: Joe Caverly
    ::
    :: NOTES: Error checking could be enhanced
    ::----------------------------------------
    @setlocal
    @echo off
    iff %# lt 1 then
      echo Usage: %_BATCHNAME 192.168.0.100
      quit
    endiff
    iff not exist macadr.txt then
      copy https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob_plain;f=manuf macadr.txt
      iff exist macadr.txt then
      :: File was copied
      else
      echo File macadr.txt does not exist
       quit
      endiff
    endiff
    set macadr=%@macaddress[%1]
    iff %@len[%macadr] eq 17 then
      echo MAC Address: %macadr
      set macadr=%@replace[-,:,%macadr]
      set macadr=%@left[8,%macadr]
      echo Octets: %@word[0,%@execstr[0,ffind /k/m/t"%macadr" macadr.txt]]
      echo Vendor: %@word[1,%@execstr[0,ffind /k/m/t"%macadr" macadr.txt]]
    else
      echo MAC Address %1 not found
      quit
    endiff
    endlocal
     
  2. Tula

    Joined:
    Dec 17, 2016
    Messages:
    1
    Likes Received:
    0
    Of course this is nice sharing.

    whatiso
     
    #2 Tula, Dec 17, 2016
    Last edited: Dec 21, 2016

Share This Page