Web Security & Vulnerability Auditing

SQL Injection Vulnerability Detector

A dynamic web resource scanner designed to audit backend database query security using automated test payloads.

Python Web Requests SQLi Detection Input Validation

Project Overview

The SQL Injection Vulnerability Detector is an automated security testing tool developed in Python. The script simulates basic error-based SQL injection (SQLi) attacks by appending an escape string and logical operators to a target URL parameter, parsing the web server's response to check if input validation controls are absent on the backend.

By evaluating HTTP response bodies for specific database error strings, this script highlights vulnerable application entry points, assisting developers in identifying parameter tampering risks before malicious actors can exploit them to compromise database records.

Technical Architecture & Probing Logic

The script programmatically targets web inputs to check for unescaped query execution patterns using a standard pipeline:

Accept Target URL
Append Test Payload
HTTP GET Request
Parse HTML Body
Detect Syntax Flags

Key Engineering Principles

Key Python Implementation

Below is the core logic engine showing how the script structures the HTTP payload delivery and evaluates backend database stability:

# Appending payload, executing request, and inspecting body for SQL errors
fullurl = raw_input("Please insert the url of the target website: ")

# Construct payload-appended URL request
resp = urllib.request.urlopen(fullurl + "=1\' or \'1\' = \'1\'")
body = resp.read()
fullbody = body.decode('utf-8')

# Evaluate server response for dynamic database errors
if "You have an error in your SQL syntax" in fullbody:
    print ("The Website is SQL injection vulnerable")
else:
    print ("The Website is not SQL injection vulnerable")

Defensive Hardening & SQLi Remediation

SQL injection remains one of the most severe web-layer risks. To secure database backends against input tampering, developers should enforce these secure coding standards: