Added MAC OUI lookup
This commit is contained in:
parent
e6baf29c7c
commit
e7ba7ee2ef
19
plugins/mac.py
Normal file
19
plugins/mac.py
Normal file
@ -0,0 +1,19 @@
|
||||
from servicebase import ServiceBase
|
||||
import requests
|
||||
import json
|
||||
|
||||
class ServiceDelegate(ServiceBase) :
|
||||
|
||||
def get_arguments(cls) :
|
||||
"""Returns an array of information used to construct an argumentparser argument."""
|
||||
return [ '-m', '--mac', 'store_true', 'Return vendor OUI from a MAC address (mac)' ]
|
||||
|
||||
def lookup(self,subject) :
|
||||
response = requests.get('https://macvendors.co/api/' + subject + '/json',headers={'User-Agent' : "API Browser"})
|
||||
if response.status_code == 200 :
|
||||
result = json.loads(response.text)['result']
|
||||
if 'error' in result :
|
||||
self._error.append(result['error'])
|
||||
return None
|
||||
return result
|
||||
return None
|
Loading…
Reference in New Issue
Block a user