Detect SQL Injections Instantly with Python GUI – FuzzuTech
Demo :
Click Video πππ
π Features:
-
GUI App using Python & CustomTkinter
-
Detects SQL Injection using Regex
-
Instant detection for safe vs malicious queries
-
Offline, lightweight, and beginner-friendly
-
Great for coding learners, students, and security pros
Code :
import customtkinter as ctk
import re
import pyperclip
# --- Configure appearance ---
ctk.set_appearance_mode("dark")
ctk.set_default_color_theme("blue")
app = ctk.CTk()
app.geometry("550x500")
app.title("π Fuzzu SQL Injection Detector")
app.resizable(False, False)
# --- SQL Injection Patterns ---
suspicious_patterns = [
r"(--|\|\|)", # SQL comments
r"(' OR '1'='1|\" OR \"1\"=\"1)", # classic injection
r"(DROP|INSERT|DELETE|UPDATE)\s+\w+\s+.*--",
r"(UNION\s+SELECT)",
r"(' OR 1=1|\" OR 1=1)",
r"(OR\s+\d+=\d+)",
]
# --- Functions ---
def detect_sql_injection():
query = entry.get()
result = "✅ Safe SQL Query"
for pattern in suspicious_patterns:
if re.search(pattern, query, re.IGNORECASE):
result = "❌ Possible SQL Injection Detected!"
break
output_label.configure(text=result)
if "Safe" in result:
output_label.configure(text_color="green")
else:
output_label.configure(text_color="red")
def reset_input():
entry.delete(0, 'end')
output_label.configure(text="")
def copy_result():
pyperclip.copy(output_label.cget("text"))
# --- GUI Layout ---
title = ctk.CTkLabel(app, text="π‘️ SQL Injection Detector", font=("Arial Rounded MT Bold", 28))
title.pack(pady=20)
entry = ctk.CTkEntry(app, placeholder_text="Enter SQL Query here...", width=500, height=40, font=("Arial", 16))
entry.pack(pady=15)
btn_detect = ctk.CTkButton(app, text="π Detect", command=detect_sql_injection, width=150, height=40)
btn_detect.pack(pady=10)
output_label = ctk.CTkLabel(app, text="", font=("Arial", 20))
output_label.pack(pady=20)
btn_frame = ctk.CTkFrame(app, fg_color="transparent")
btn_frame.pack(pady=10)
reset_btn = ctk.CTkButton(btn_frame, text="π Reset", command=reset_input, width=120)
reset_btn.grid(row=0, column=0, padx=10)
copy_btn = ctk.CTkButton(btn_frame, text="π Copy Result", command=copy_result, width=150)
copy_btn.grid(row=0, column=1, padx=10)
footer = ctk.CTkLabel(app, text="Developed by FuzzuTech", font=("Arial", 12), text_color="gray")
footer.pack(side="bottom", pady=10)
app.mainloop()
Comments
Post a Comment