Web Application
SQLMap is an open-source penetration testing tool that automates SQL injection detection and exploitation. It supports five SQL injection types (boolean-based blind, time-based blind, error-based, UNION query-based, and stacked queries) and over 30 database backends including MySQL, Oracle, PostgreSQL, Microsoft SQL Server, and many more.
sudo apt install sqlmap
sqlmap -u "<URL>" [options]
SQLMap is a free, open-source penetration testing tool that automates the detection and exploitation of SQL injection vulnerabilities in web applications. It supports five distinct SQL injection types: boolean-based blind, time-based blind, error-based, UNION query-based, and stacked queries.
Created by Bernardo Damele Assuncao and Miroslav Stampar in 2006, SQLMap has become the industry-standard tool for SQL injection testing. It supports all major database backends including MySQL, Oracle, PostgreSQL, Microsoft SQL Server, SQLite, IBM DB2, Firebird, Sybase, SAP MaxDB, and Informix.
SQLMap goes beyond simple injection detection. It can enumerate databases, extract tables and columns, dump entire databases, escalate privileges to DBA, access the underlying operating system through database-specific features, and even upload files to the target server. Its intelligent detection engine automatically identifies injection points and selects the optimal exploitation technique.
sqlmap -u "http://example.com/?id=1"Basic SQL injection test on a single URL parametersqlmap -u "http://example.com/?id=1" --dbsEnumerate available databases after detectionsqlmap -u "http://example.com/?id=1" -D mydb --tablesList tables in a specific databasesqlmap -u "http://example.com/?id=1" -D mydb -T users --dumpDump all rows from a specific tablesqlmap -u "http://example.com/?id=1" --batchRun in non-interactive mode with default answerssqlmap -u "http://example.com/?id=1" --level=5 --risk=3Maximum level and risk for thorough testingsqlmap -u "http://example.com/?id=1" --technique=BEUUse only Boolean, Error, and UNION injection techniquessqlmap -u "http://example.com/?id=1" --os-shellAttempt to get an operating system shellsqlmap -u "http://example.com/?id=1" --file-read="/etc/passwd"Read a file from the database server filesystemsqlmap -u "http://example.com/?id=1" --passwordsEnumerate database user password hashessqlmap -u "http://example.com/?id=1" --dump-allDump all accessible databases and tablessqlmap -u "http://example.com/?id=1" --random-agentUse a random HTTP User-Agent header to avoid detectionsqlmap -r request.txtTest an HTTP request loaded from a saved filesqlmap -u "http://example.com/?id=1" --proxy="http://127.0.0.1:8080"Route traffic through a proxy for monitoringsqlmap -u "http://example.com/?id=1" --formsAuto-detect and test forms on a target pageAutomatically detect all five SQL injection types across GET, POST, and header parameters.
Extract database names, table names, column names, and full data contents from vulnerable applications.
Identify database user privileges and attempt escalation to DBA for full server control.
Leverage database-specific features to execute operating system commands on the target server.
Use tamper scripts to bypass Web Application Firewalls and security filters.
Crawl websites, detect forms, and test all parameters for injection vulnerabilities.
Enumerate and extract database user password hashes for offline cracking with John the Ripper or Hashcat.
Read and write files on the database server through INTO OUTFILE and UTL_FILE for data exfiltration or webshell upload.
Execute database stored procedures for advanced exploitation including linked server traversal and XPCmdShell execution.
Automate boolean-based and time-based blind SQL injection to extract data when no error messages are visible.
| Feature | SQLMap | Manual Injection | Burp Scanner |
|---|---|---|---|
| Speed | Fast (automated) | Slow (hand-crafted) | Fast (automated) |
| Learning Value | Medium (understand output) | Very high (core skill) | Low (black box) |
| WAF Evasion | 30+ tamper scripts | Full control | Limited |
| Data Extraction | Automated dump | Manual, tedious | Detection only |
| Best For | Confirmed exploitation at scale | Learning + edge cases | Broad app coverage |
| Feature | Setting | Requests | When to Use |
|---|---|---|---|
| --level=1 --risk=1 (default) | GET/POST values only | Fewest | First pass, quiet recon |
| --level=3 | Adds Cookie & User-Agent | Moderate | Params hidden in headers |
| --level=5 | All headers & entry points | Most | Thorough authorized audit |
| --risk=2 | Adds heavy time-based | More | Boolean blind fails |
| --risk=3 | Adds OR-based payloads | Highest (can modify data) | Lab / explicit sign-off only |
| Feature | Technique | Flag | Notes |
|---|---|---|---|
| Boolean-based blind | True/false page diff | B | Reliable, moderate speed |
| Error-based | DB error in response | E | Fast when errors surface |
| UNION query | Appended UNION SELECT | U | Fastest bulk extraction |
| Stacked queries | Multiple statements | S | Enables OS/file actions where supported |
| Time-based blind | Response delay | T | Works when no output — slowest |
Use -r request.txt to pass a saved Burp Suite request, or --data='user=admin&pass=*' to test POST parameters. The * marks the injection point. Add --level=5 --risk=3 for maximum injection testing depth. Always test on authorized targets only.
Simple GET parameter tests complete in seconds. Full database dumps can take hours depending on database size and injection complexity. Use --threads for parallel requests, --batch for non-interactive mode, and --smart to reduce unnecessary requests on large targets.
SQLMap has built-in WAF bypass techniques including --tamper scripts (space2comment, between, randomcase), --random-agent, and --delay for rate limiting. Use --level=5 --risk=3 with tamper scripts for best WAF bypass results.
SQLMap supports five injection types: boolean-based blind (--technique=B), time-based blind (--technique=T), error-based (--technique=E), UNION query-based (--technique=U), and stacked queries (--technique=S). It automatically detects and selects the best technique.
Save a vulnerable request from Burp Suite to a file (right-click > Save item), then run sqlmap -r request.txt. SQLMap automatically parses cookies, headers, and POST data from the Burp request. Add -p parameter_name to target a specific parameter.
Yes. Use --dump-all to extract all data from all databases, or --dump -D dbname -T tablename for specific tables. Add --threads=10 for faster extraction. Use --where to filter rows. Always ensure you have authorization for the scope of data you extract.
Web Application
Web server scanner that complements SQLMap by identifying misconfigurations and outdated software on the same targets.
Web Application
Directory and subdomain brute-forcer for discovering hidden endpoints that SQLMap can then test for injection.
Information Gathering
Network scanner that identifies web services and open ports for SQLMap to target with injection testing.
Password Attacks
Online password brute-forcer for services discovered alongside vulnerable web applications.
Exploitation
Exploitation framework for post-SQLMap exploitation using extracted credentials and OS shell access.
Web Application
Web security testing proxy for intercepting and modifying HTTP requests before feeding them to SQLMap.
Web Application
Advanced XSS detection and exploitation tool for testing cross-site scripting vulnerabilities alongside SQL injection.
Web Application
Fast web fuzzer for discovering hidden directories, parameters, and virtual hosts on target web applications.
SQLMap output shows: injection type (boolean/time/error/union), parameter position, database backend, and retrieved data. Vulnerable parameters are marked with 'injectable' status. Retrieved databases, tables, and columns are displayed in tabular format during enumeration.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.