-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoui.cmd
74 lines (74 loc) · 3.34 KB
/
oui.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@echo off
:START
REM ===========================
REM before you start, make sure that the offline oui.txt data file is available.
if EXIST c:\utils\oui.txt goto SYNTAX
echo ****** Warning ******
echo c:\utils\oui.txt does not exist, downloading source data
echo *********************
goto UPDATE
REM ===========================
REM Check Syntax
REM ===========================
:SYNTAX
if /i _%1 == _ goto HELP
if /i _%1 == _help goto HELP
if /i _%1 == _-help goto HELP
if /i _%1 == _--help goto HELP
if /i _%1 == _/help goto HELP
if /i _%1 == _? goto HELP
if /i _%1 == _-? goto HELP
if /i _%1 == _/? goto HELP
if /i _%1 == _--? goto HELP
if /i _%1 == _UPDATE goto UPDATE
:OKOK
REM =============================
REM OK TO PROCEED
REM =============================
REM =============================
REM remove all delimeters
REM =============================
echo %1 | tr -d ":\-.\r\n\ " | tr '[:lower:]' '[:upper:]' > %temp%\ouioui.tmp
REM =============================
REM check for both OUI or Vendor matches
REM =============================
type c:\utils\oui.txt | grep -i -f %temp%\ouioui.tmp
goto ENDEND
:HELP
echo OUI Utility
echo Syntax:
echo OUI NN:NN:NN Request information on a specific OUI
echo Input is NOT case sensitive
echo Acceptable delimiters include ":", "." or "-"
echo Address delimeters can be in any position (at the 2 or 4 byte boundaries for instance)
echo Address delimeters are optional, and can be partially specified
echo So any of 005000, 00:50:00, 0050.00, 00-50-00 and just 50 are acceptable inputs
echo OUI Manufacturer List all OUI's associated with a manufacturer
echo Partial company names are acceptable
echo Input is NOT case sensitive
echo OUI update Update the OUI listing
echo If there is no oui.txt, the update happens and any lookup is ignored
echo This update comes from Wireshark's consolidated vendor list
echo This list is compiled from a number of sources, and is considered a superset of the IEEE list
echo This is downloaded from:
echo https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob_plain;f=manuf;hb=HEAD
echo The IEEE listing can be obtained from:
echo http://standards-oui.ieee.org/oui/oui.csv
echo http://standards-oui.ieee.org/cid/cid.csv
echo http://standards-oui.ieee.org/iab/iab.csv
echo http://standards-oui.ieee.org/oui28/mam.csv
echo http://standards-oui.ieee.org/oui36/oui36.csv
goto ENDEND
:UPDATE
REM =============================
REM collect the updated file, then remove the colon delimeters
REM =============================
md c:\utils
echo OUI:Vendor:VendorString| tr : \t > c:\utils\oui.txt
curl --insecure https://www.wireshark.org/download/automated/data/manuf | tr -d : | grep -v "^#" | grep -v "^$" >> c:\utils\oui.txt
goto ENDEND
:ENDEND
REM ==============================
REM Cleanup temp variable files
REM ==============================
del /q %temp%\ouioui.tmp 2>nul: