SQLMap Cheat Sheet & Guide
Basic Usage
sqlmap -u "[Link] --batch
Options:
--batch : Non-interactive mode.
--random-agent : Use a random user-agent header.
--threads=10 : Multi-threading (useful for large apps).
Target Authentication
--cookie="PHPSESSID=..." : Use session cookie.
--auth-type=basic --auth-cred=user:pass : HTTP Basic Auth.
--csrf-token=token_name : Handle anti-CSRF tokens.
Database Enumeration
--dbs : List available databases.
--current-db : Get current database.
--tables -D dbname : List tables of a DB.
--columns -D db -T table : List columns of a table.
--dump -D db -T table : Dump table contents.
Detection Techniques
--level=5 : Test more techniques.
--risk=3 : Risk level of payloads.
--technique=BEUSTQ : Use specific injection techniques (Blind, Error, Union, etc.).
SQLMap Cheat Sheet & Guide
Bypassing Protections
--tamper=space2comment : Use tamper scripts to bypass WAFs.
--delay=2 : Add delay between requests.
--time-sec=5 : Set time delay for time-based testing.
Advanced Features
--os-shell : Get OS shell.
--file-read=/etc/passwd : Read remote file.
--file-write, --file-dest : Upload a file to the server.
--identify-waf : Attempt WAF detection.
Tips
1. Always verify manually after automated testing.
2. Combine with Burp Suite for advanced testing.
3. Use with scope-aware recon for bug bounty.