|
| 1 | +import sys |
| 2 | +try: |
| 3 | + from _winreg import * |
| 4 | +except: |
| 5 | + from winreg import * |
| 6 | +try: |
| 7 | + from common_methods import * |
| 8 | +except ImportError: |
| 9 | + sys.exit("Could not find common_methods.py... download the full toolkit from https://github.com/MonroCoury/Forensic_Tools") |
| 10 | + |
| 11 | + |
| 12 | +def val2addr(val): |
| 13 | + if val: |
| 14 | + addr = "" |
| 15 | + for char in val: |
| 16 | + try: |
| 17 | + addr += ("%02x " % ord(char)) |
| 18 | + except: |
| 19 | + addr += ("%02x " % ord(chr(char))) |
| 20 | + addr = addr.strip(" ").replace(" ", ":")[:17] |
| 21 | + return True, addr |
| 22 | + else: |
| 23 | + addr = "No data found for this network" |
| 24 | + return False, addr |
| 25 | + |
| 26 | +def get_WIFIs(): |
| 27 | + wlans = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList' \ |
| 28 | + + r'\Signatures\Unmanaged' |
| 29 | + key = OpenKey(HKEY_LOCAL_MACHINE, wlans) |
| 30 | + data = "" |
| 31 | + num = 0 |
| 32 | + for i in range(1000000): |
| 33 | + try: |
| 34 | + attempt = EnumKey(key, i) |
| 35 | + wlan_key = OpenKey(key, str(attempt)) |
| 36 | + (n, addr, t) = EnumValue(wlan_key, 5) |
| 37 | + (n, name, t) = EnumValue(wlan_key, 4) |
| 38 | + res, mac_address = val2addr(addr) |
| 39 | + wlan_name = str(name) |
| 40 | + data += "<tr><td>%s</td><td>%s</td></tr>" % (wlan_name, mac_address) |
| 41 | + CloseKey(wlan_key) |
| 42 | + num += 1 |
| 43 | + except Exception as e: |
| 44 | + break |
| 45 | + complete_html = init_data("wlan_reader Wifi Networks", num) + init_table_header("./templates/init_wlan_html.html") \ |
| 46 | + + data + close_table_html() |
| 47 | + saveResult("Wifi_History.html", complete_html) |
| 48 | + |
| 49 | +if __name__ == "__main__": |
| 50 | + print('\n\n ##############A Python script to read WIFI activity #####################') |
| 51 | + print(' # Mac Address can be used to determin the location #') |
| 52 | + print(' # of the wireless network with the help of online #') |
| 53 | + print(' # databases like wigle or skyhook, a feature I\'m #') |
| 54 | + print(' # planning on adding to this script to save you the effort #') |
| 55 | + print(' # Coded by monrocoury #') |
| 56 | + print(' #########################################################################\n\n') |
| 57 | + print("Working...\n") |
| 58 | + get_WIFIs() |
0 commit comments