SQLmap

sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester, and a broad range of switches including database fingerprinting, over data fetching from the database, accessing the underlying file system, and executing commands on the operating system via out-of-band connections.

        ___
       __H__
 ___ ___[,]_____ ___ ___  {1.9.4#stable}
|_ -| . [.]     | .'| . |
|___|_  [']_|_|_|__,|  _|
      |_|V...       |_|   https://sqlmap.org

Usage

Usage: sqlmap [options]

Target

At least one of these options has to be provided to define the target(s)

OptionDescription
-u URL, --url=URLTarget URL (e.g. "http://www.site.com/vuln.php?id=1")
-g GOOGLEDORKProcess Google dork results as target URLs

Request

These options can be used to specify how to connect to the target URL

OptionDescription
--data=DATAData string to be sent through POST (e.g. "id=1")
--cookie=COOKIEHTTP Cookie header value (e.g. "PHPSESSID=a8d127e..")
--random-agentUse randomly selected HTTP User-Agent header value
--proxy=PROXYUse a proxy to connect to the target URL
--torUse Tor anonymity network
--check-torCheck to see if Tor is used properly

Injection

These options can be used to specify which parameters to test for, provide custom injection payloads and optional tampering scripts

OptionDescription
-p TESTPARAMETERTestable parameter(s)
--dbms=DBMSForce back-end DBMS to provided value

Detection:

These options can be used to customize the detection phase

OptionDescription
--level=LEVELLevel of tests to perform (1–5, default 1)
--risk=RISKRisk of tests to perform (1–3, default 1)

Techniques

These options can be used to tweak testing of specific SQL injection techniques

OptionDescription
--technique=TECH...SQL injection techniques to use (default "BEUSTQ")

Enumeration

These options can be used to enumerate the back-end database management system information, structure and data contained in the tables

OptionDescription
-a, --allRetrieve everything
-b, --bannerRetrieve DBMS banner
--current-userRetrieve DBMS current user
--current-dbRetrieve DBMS current database
--passwordsEnumerate DBMS users password hashes
--dbsEnumerate DBMS databases
--tablesEnumerate DBMS database tables
--columnsEnumerate DBMS database table columns
--schemaEnumerate DBMS schema
--dumpDump DBMS database table entries
--dump-allDump all DBMS databases tables entries
-D DBDBMS database to enumerate
-T TBLDBMS database table(s) to enumerate
-C COLDBMS database table column(s) to enumerate

Operating system access

These options can be used to access the back-end database management system underlying operating system

OptionDescription
--os-shellPrompt for an interactive operating system shell
--os-pwnPrompt for an OOB shell, Meterpreter or VNC

General

These options can be used to set some general working parameters

OptionDescription
--batchNever ask for user input, use the default behavior
--flush-sessionFlush session files for current target

Miscellaneous

These options do not fit into any other category

OptionDescription
--wizardSimple wizard interface for beginner users