70 lines · 2.6 KB · Python
RawDownload
# ------------------------------------------------------------# name      Fuzzbunch# type      exploit# cve       —# year      unknown# os        Windows# authors   unknown# source    RamadhanAmizudin/malware# archived  RamadhanAmizudin, krisyotam (2026)# notes     —# ------------------------------------------------------------ import osimport opsimport refrom sqlite3 import connect def getoui(mac):    norm_mac = normalize(mac, sep=None, case='upper')    assert validate_ethii(norm_mac), 'MAC address must be valid'    if norm_mac.startswith('0050C2'):        oui = norm_mac[0:9]        conn = connect(os.path.join(ops.OPSDIR, 'Databases', 'macs.db'))        curs = conn.cursor()        curs.execute(("select description from iabinformation where oui like '%s%%'" % oui))        out = curs.fetchone()    else:        oui = norm_mac[0:6]        conn = connect(os.path.join(ops.OPSDIR, 'Databases', 'macs.db'))        curs = conn.cursor()        curs.execute(("select description from arpinformation where oui like '%s%%'" % oui))        out = curs.fetchone()    if (out is not None):        return out[0]    else:        return None def normalize(mac, sep=None, case='lower', partial=False):    assert ((type(mac) is str) or (type(mac) is unicode)), 'MAC must be a string representation.'    assert ((case.lower() == 'lower') or (case.lower() == 'upper') or (case.lower() == 'none')), "Case must be 'lower' or 'upper' or 'none'."    assert ((sep is None) or (len(sep) == 1)), 'Sep must be a single character or None.'    for char in ['.', ':', '-', ' ']:        mac = mac.replace(char, '')    if (not partial):        assert (len(mac) == 12), ("Stripped MAC ('%s') must be 12 characters in length." % mac)    if (sep is not None):        mac_pair = []        for i in range(0, len(mac), 2):            mac_pair.append(''.join([mac[i], mac[(i + 1)]]))        mac = sep.join(mac_pair)    if (case.lower() == 'lower'):        return mac.lower()    elif (case.lower() == 'upper'):        return mac.upper()    else:        return mac def validate_ethii(mac):    assert ((type(mac) is str) or (type(mac) is unicode)), 'MAC must be a string representation.'    assert (len(mac) == 12), 'Ethernet II MAC must be 12 characters in length'    mac_re = re.compile('([0123456789ABCDEF]{2}){6}', re.IGNORECASE)    if (not mac_re.match(mac)):        return False    else:        return True def validate(mac):    assert ((type(mac) is str) or (type(mac) is unicode)), 'MAC must be a string representation.'    norm_mac = normalize(mac)    return validate_ethii(norm_mac)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t