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

Popular posts from this blog

πŸš€ Simple Login & Registration System in Python Tkinter πŸ“±

πŸš€ Create a Python Screen Recorder with Audio (Complete Code)

Python IP Tracker App with GUI | Track IP Location Real-Time! (Working Project)