def getvendor(macaddress): try: #client = ApiClient('at_UfWgZ7z8ilVI5fZyXvp84PJzMW2Hj') client = ApiClient(apikey) logging.basicConfig(filename='myapp.log', level=logging.WARNING) print(client.get_vendor(macaddress)) except Exception as e: print("Not_found")
def scan(self, ip): ARP = scapy.ARP(pdst=ip) Ether = scapy.Ether(dst="ff:ff:ff:ff:ff:ff") packet = Ether / ARP ans = scapy.srp(packet, timeout=2, verbose=False)[0] client_list = [] for element in ans: MAC = element[1].hwsrc vendor = ApiClient("at_yS7J9zWswF0lxuKHa6b3352LuTOTs") client_dict = { "IP": element[1].psrc, "MAC": MAC, "Vendor": str(vendor.get_vendor(MAC).decode()) } client_list.append(client_dict) return client_list
from maclookup import ApiClient import logging import os api_key = os.environ['API_KEY'] log_file = os.environ['LOG_FILENAME'] client = ApiClient(api_key) logging.basicConfig(filename=log_file, level=logging.WARNING) print(client.get_raw_data('08EA4026E5DE', 'csv')) print(client.get_vendor('08EA4026E5DE')) response = client.get('08EA4026E5DE') print(response.vendor_details.is_private) print(response.block_details.block_size)
from maclookup import ApiClient import logging client = ApiClient('at_kmyQbPqQZGvWMGFf3fLYGqdQM11DQ') logging.basicConfig(filename='myapp.log', level=logging.WARNING) mac = str(input("Pleas enter the MAC address: ")) print(client.get_vendor(mac))
from maclookup import ApiClient import logging client = ApiClient('at_gVL2VUlnXzRjD9mkj70Avd6bqgdkm') logging.basicConfig(filename='myapp.log', level=logging.WARNING) print(client.get_raw_data('00A043AAAAAA', 'json')) print(client.get_vendor('BBA043AAAAAA')) print(client.get('BBA043AAAAAA')) response = client.get('00A043AAAAAA') print(response.vendor_details.is_private) print(response.block_details.date_created)
from maclookup import ApiClient import logging import sys mac_add = sys.argv[1] client = ApiClient('at_vUodAqdRDWPiGqHCiTu22Jlvc8Snq') logging.basicConfig(filename='myapp.log', level=logging.WARNING) company_name = client.get_vendor(mac_add) print "Company Name of MAC ID: ", mac_add, "is - ", company_name