USB Device History Viewer – Ethical Hacking Python GUI | FuzzuTech
Demo :
Click Video πππ
Description :
Discover how to reveal all USB devices ever connected to your Windows PC with a Python GUI app. FuzzuTech’s ethical hacking tool uses registry scanning to show USB history in a hacker-style interface.
Features:
-
Displays all previously connected USB devices
-
Uses Python with
winregfor registry access -
GUI styled in dark mode using
customtkinter -
Easy for students, ethical hackers, and forensic investigators
Code :
import customtkinter as ctk
import winreg
def get_usb_history():
devices = []
path = r"SYSTEM\\CurrentControlSet\\Enum\\USBSTOR"
try:
reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
key = winreg.OpenKey(reg, path)
for i in range(winreg.QueryInfoKey(key)[0]):
subkey_name = winreg.EnumKey(key, i)
subkey = winreg.OpenKey(key, subkey_name)
for j in range(winreg.QueryInfoKey(subkey)[0]):
instance = winreg.EnumKey(subkey, j)
inst_key = winreg.OpenKey(subkey, instance)
try:
friendly = winreg.QueryValueEx(inst_key, "FriendlyName")[0]
devices.append(f"{friendly} | ID: {instance}")
except:
pass
return devices
except Exception as e:
return [f"Error: {str(e)}"]
def refresh_list():
usb_textbox.delete("1.0", "end") # Corrected to use string indexes
devices = get_usb_history()
if not devices:
usb_textbox.insert("1.0", "No USB history found.")
else:
for dev in devices:
usb_textbox.insert("end", dev + "\n")
# === GUI Setup ===
ctk.set_appearance_mode("dark") # 'light' or 'dark'
ctk.set_default_color_theme("blue")
app = ctk.CTk()
app.geometry("650x500")
app.title("USB Device History Viewer - FuzzuTech")
title_label = ctk.CTkLabel(app, text="USB Device History Viewer", font=("Segoe UI", 24, "bold"))
title_label.pack(pady=20)
refresh_button = ctk.CTkButton(app, text="Scan USB History", command=refresh_list, fg_color="#00ffaa", text_color="#000000")
refresh_button.pack(pady=10)
usb_textbox = ctk.CTkTextbox(app, width=700, height=300, font=("Consolas", 14))
usb_textbox.pack(pady=20)
app.mainloop()
Comments
Post a Comment