SQLmap-GUI

SQLmap GUI - Advanced SQL Injection Testing Interface

GitHub Pages Python PyQt6 SQLmap

A comprehensive graphical user interface for SQLmap - the automatic SQL injection and database takeover tool. This GUI provides an intuitive, user-friendly interface to harness the full power of SQLmap without command-line complexity.

πŸš€ Features

πŸ“‹ Table of Contents

🎯 Quick Start

Prerequisites

Installation

  1. Clone the repository:
    git clone https://github.com/nanragav/SQLmap-GUI.git
    cd SQLmap-GUI
    
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Install SQLmap:
    # Using apt (Ubuntu/Debian)
    sudo apt install sqlmap
    
    # Or download from https://sqlmap.org/
    
  4. Run the GUI:
    ./start_gui.sh
    # or
    python3 main.py
    

First Scan

  1. Target Tab: Enter your target URL (e.g., http://example.com/page.php?id=1)
  2. Detection Tab: Set Level to 3, Risk to 2 for thorough testing
  3. Techniques Tab: Select desired injection techniques
  4. Enumeration Tab: Choose what to enumerate (databases, tables, etc.)
  5. Click β€œStart Scan”

πŸ–₯️ GUI Overview

The SQLmap GUI is organized into 15 specialized tabs, each handling different aspects of SQL injection testing:

Main Interface Layout

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ File  Tools  Help  [New] [Open] [Save] [Start] [Stop] [Validate] β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Target β”‚ Request β”‚ Injection β”‚ Detection β”‚ Techniques β”‚ ... β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Target URL: http://example.com/page.php?id=1                β”‚
β”‚ Method: GET    Data:                    Cookie:             β”‚
β”‚ User-Agent: Mozilla/5.0...              Host: example.com   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ SQLmap Command:                                             β”‚
β”‚ sqlmap -u "http://example.com/page.php?id=1" --batch        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ [14:32:15] Starting SQL injection scan...                   β”‚
β”‚ [14:32:16] Testing for SQL injection...                     β”‚
β”‚ [14:32:17] SQL injection vulnerability found!               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Memory: 45.2 MB                    CPU: 12.3%               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Components

  1. Menu Bar: File operations, tools, and help
  2. Toolbar: Quick access to common actions
  3. Tab Bar: 15 specialized configuration tabs
  4. Command Preview: Real-time SQLmap command generation
  5. Log Window: Execution output and status messages
  6. Status Bar: Resource monitoring and progress

πŸ“‘ Tab Reference

1. Target Tab

Configure target specifications and connection details.

Key Options:

2. Request Tab

HTTP request customization and optimization.

Key Options:

3. Injection Tab

SQL injection payload configuration.

Key Options:

4. Detection Tab

SQL injection detection parameters.

Key Options:

5. Techniques Tab

Injection technique selection.

Key Options:

6. Enumeration Tab

Database structure and data extraction.

Key Options:

7. Fingerprint Tab

Database fingerprinting and identification.

8. Brute Force Tab

Dictionary-based attacks and common name enumeration.

9. UDF Tab

User-defined function injection.

10. File System Tab

File system access and manipulation.

11. OS Access Tab

Operating system command execution.

12. Windows Registry Tab

Windows registry access (Windows targets only).

13. General Tab

General SQLmap configuration and behavior.

14. Miscellaneous Tab

Additional advanced options.

15. Hidden Switches Tab

Experimental and advanced features.

πŸ“š Examples

Basic SQL Injection Scan

# Target: http://example.com/product.php?id=1
# GUI Configuration:
# - Target Tab: URL = http://example.com/product.php?id=1
# - Detection Tab: Level = 3, Risk = 2
# - Techniques Tab: Boolean-based, Error-based, UNION-based
# - Enumeration Tab: Databases, Tables, Columns

Generated Command:

sqlmap -u "http://example.com/product.php?id=1" --level=3 --risk=2 --technique=BEU --dbs --tables --columns --batch

Advanced Scan with Custom Options

# Target: Vulnerable login form
# GUI Configuration:
# - Target Tab: URL = http://example.com/login.php, Method = POST, Data = username=admin&password=test
# - Request Tab: User-Agent = Custom, Timeout = 10
# - Injection Tab: DBMS = MySQL, Tamper = space2comment
# - Enumeration Tab: Dump all data from users table

Generated Command:

sqlmap -u "http://example.com/login.php" --method=POST --data="username=admin&password=test" --dbms=mysql --tamper=space2comment --dump -T users --batch

Anonymous Scanning with Tor

# GUI Configuration:
# - Request Tab: Tor = Enabled, Tor Port = 9050
# - Target Tab: URL = http://example.com/vuln.php?id=1
# - General Tab: Batch = Enabled

Generated Command:

sqlmap -u "http://example.com/vuln.php?id=1" --tor --tor-port=9050 --batch

πŸ”§ API Documentation

Core Classes

SqlmapMainWindow

Main application window containing all GUI components.

Methods:

SqlmapWrapper

Handles SQLmap command generation and execution.

Methods:

MutualExclusionManager

Manages conflicting option combinations.

Methods:

Option Groups

Each tab contains multiple OptionGroup instances that handle:

πŸ› Troubleshooting

Common Issues

GUI Won’t Start

Error: ModuleNotFoundError: No module named 'PyQt6' Solution:

pip install PyQt6 PyQt6-Qt6

SQLmap Not Found

Error: sqlmap: command not found Solution:

# Install via package manager
sudo apt install sqlmap

# Or download from https://sqlmap.org/

Performance Issues

Symptoms: GUI is slow, unresponsive, or hanging Solutions:

  1. Use Help β†’ Performance β†’ High Performance Mode
  2. Close other resource-intensive applications
  3. Use Help β†’ Performance β†’ Optimize Performance
  4. Restart the GUI application

CPU/Memory Usage High

Solutions:

  1. Enable Help β†’ Performance β†’ Pause Resource Monitoring
  2. Use Help β†’ Performance β†’ High Performance Mode
  3. Close unnecessary tabs/windows
  4. Monitor with Help β†’ Debug CPU Monitoring

Debug Information

Access debug information via:

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Fork and clone:
    git clone https://github.com/nanragav/SQLmap-GUI.git
    cd SQLmap-GUI
    
  2. Create virtual environment:
    python3 -m venv venv
    source venv/bin/activate  # Linux/Mac
    # or
    venv\Scripts\activate     # Windows
    
  3. Install development dependencies:
    pip install -r requirements.txt
    pip install -r requirements-dev.txt
    
  4. Run tests:
    python -m pytest
    

Code Structure

src/
β”œβ”€β”€ gui/
β”‚   β”œβ”€β”€ main_window.py      # Main application window
β”‚   β”œβ”€β”€ main.py            # Application entry point
β”‚   β”œβ”€β”€ widgets/           # Custom GUI components
β”‚   β”‚   β”œβ”€β”€ custom_widgets.py
β”‚   β”‚   └── __init__.py
β”‚   └── tabs/              # Configuration tabs
β”‚       β”œβ”€β”€ base_tab.py
β”‚       β”œβ”€β”€ target_tab.py
β”‚       β”œβ”€β”€ request_tab.py
β”‚       └── ...
β”œβ”€β”€ core/                  # Core functionality
β”‚   β”œβ”€β”€ config_manager.py
β”‚   β”œβ”€β”€ sqlmap_wrapper.py
β”‚   └── mutual_exclusion_manager.py
└── utils/
    └── config.py

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

⚠️ Disclaimer

This tool is for educational and authorized security testing purposes only. Users are responsible for complying with applicable laws and regulations. Unauthorized use of this tool may violate laws in your jurisdiction.

πŸ™ Acknowledgments


Happy SQL Injection Testing! πŸ”’πŸ›‘οΈ

For questions, issues, or contributions, please visit our GitHub repository.