Python Webcam Access Logger | Hacker-Style Cyber Security GUI Project
Demo :
Click Video πππ
FEATURES :
-
Cyber crime problem explanation
-
Code explanation (step-by-step)
-
Full
main.py -
Folder structure
-
Embedded YouTube Shorts
-
CTA: Subscribe FuzzuTech
Code :
import customtkinter as ctk
from datetime import datetime
import os
ctk.set_appearance_mode("dark")
ctk.set_default_color_theme("green")
app = ctk.CTk()
app.title("Webcam Access Logger | FuzzuTech")
app.geometry("520x420")
# -------------------------------
# AUTO CREATE LOGS FOLDER & FILE
# -------------------------------
LOG_DIR = "logs"
LOG_FILE = os.path.join(LOG_DIR, "access_log.txt")
os.makedirs(LOG_DIR, exist_ok=True)
def log_webcam_access():
time_now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
log_text = f"[!] Webcam Access Detected at {time_now}\n"
with open(LOG_FILE, "a", encoding="utf-8") as f:
f.write(log_text)
textbox.insert("end", log_text)
textbox.see("end")
# -------------------------------
# UI
# -------------------------------
title = ctk.CTkLabel(
app,
text="LIVE WEBCAM ACCESS LOGGER",
font=("Orbitron", 20)
)
title.pack(pady=15)
textbox = ctk.CTkTextbox(app, width=460, height=250)
textbox.pack(pady=10)
btn = ctk.CTkButton(
app,
text="Simulate Webcam Access",
command=log_webcam_access
)
btn.pack(pady=10)
footer = ctk.CTkLabel(
app,
text="Cyber Security Awareness Tool | Simulation",
font=("Arial", 12)
)
footer.pack(pady=10)
app.mainloop()
Comments
Post a Comment