Course contentsShow
← Security
Lesson 587 of 3,05213. Web Security - Injection AttacksFree lesson

SQLMap Detection and Fingerprinting Techniques

Master SQLMap's detection levels, risk settings, DBMS fingerprinting, and techniques for identifying injection points.

SQLMap Detection and Fingerprinting Techniques

What you'll learn: How SQLMap intelligently detects injection points and identifies database systems to optimize exploitation.

Understanding Detection Levels and Risk Settings

SQLMap doesn't just blindly throw payloads at a target—it uses sophisticated detection strategies. Think of it like a locksmith who first examines a lock before selecting the right tool.

Detection levels (1-5) control thoroughness:

  • Level 1: Tests only common injection points (GET/POST parameters)
  • Level 2+: Tests HTTP headers, cookies, and additional vectors
  • Level 5: Tests all possible vectors exhaustively

Risk levels (1-3) control payload aggressiveness:

  • Risk 1: Safe payloads (OR-based queries)
  • Risk 2: Includes time-based blind tests (may cause delays)
  • Risk 3: Aggressive tests including UPDATE/DELETE queries (dangerous!)

Use --level=2 --risk=1 for balanced testing, or increase cautiously when initial attempts fail.

DBMS Fingerprinting

Before extracting data, SQLMap identifies the underlying database management system (MySQL, PostgreSQL, MSSQL, Oracle, etc.). This process is called fingerprinting.

SQLMap fingerprints by:

  • Analyzing error messages for database-specific syntax
  • Testing version-specific functions (@@version, version())
  • Observing response timing patterns
  • Comparing behavior to known DBMS characteristics

You can guide SQLMap with --dbms=mysql to skip fingerprinting, or let it auto-detect for comprehensive testing.

Injection Point Identification

SQLMap systematically tests parameters, looking for injection vulnerabilities:

  • URL parameters: ?id=1
  • POST data fields
  • HTTP headers (Cookie, User-Agent, Referer)
  • Custom injection markers using *

Example: sqlmap -u "http://target.com/page?id=1*" --batch

The tool varies payloads, monitors responses, and confirms exploitable injection points before proceeding to data extraction.

Key Takeaway: SQLMap's detection levels, risk settings, and DBMS fingerprinting capabilities allow precise, controlled testing—balancing thoroughness with safety while identifying the most efficient exploitation path for each unique target.