SQLmap – Automatic SQL Injection and DB Takeover Tool

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 and many features for penetration testers.

SQLMap is capable of databases fingerprinting, fetching data from the databases, accessing the database file systems, running different commands on the target server, etc.

SQLmap: Automatic SQL Injection Tool

This very powerful exploitation tool is developed in Python an it’s FREE to use. It requires Python version 2.6.x or 2.7.x. and comes preinstalled on Kali Linux, but can be run on any platform.


SQLmap have many features divided into 3 groups:


We’ll list some of them here:

  • Full support for:MySQL, Oracle, PostgreSQL, Microsoft SQL Server, Microsoft Access, IBM DB2, SQLite, Firebird, Sybase and SAP MaxDB database management systems.
  • Support for database process’ user privilege escalation via Metasploit’s Meterpreter getsystem command.


SQLmap can detect and exploit different SQL injections:

  • Boolean-based blind: sqlmap replaces or appends to the affected parameter in the HTTP request, a syntatically valid SQL statement string containing a SELECT sub-statement, or any other SQL statement whose the user want to retrieve the output.
  • Time-based blind: replaces or appends to the affected parameter in the HTTP request, a syntatically valid SQL statement string containing a query which put on hold the back-end DBMS to return for a certain number of seconds.
  • Error-based: replaces or appends to the affected parameter a database-specific error message provoking statement and parses the HTTP response headers and body in search of DBMS error messages containing the injected pre-defined chain of characters and the subquery statement output within.
  • UNION query-based: sqlmap appends to the affected parameter a syntactically valid SQL statement starting with an UNION ALL SELECT.
  • Stacked queries, also known as piggy backing: sqlmap tests if the web application supports stacked queries and then, in case it does support, it appends to the affected parameter in the HTTP request, a semi-colon (;) followed by the SQL statement to be executed.

Given that these are just basic explanations of techniques, you can read a more detailed explanation on the official SQLmap wiki page.



  • Python version 2.6.x or 2.7.x.

If you want to connect directly to a database server, you need to install the following Python bindings:


  • NTLM: python-ntlm (for web application attack behind NTLM authentication)
  • Readline: PyReadline (Windows users)

SQLmap Install

Clone it form the Git repository:


You can also download the latest .tar.gz or .zip.

To update sqlmap run:

python sqlmap.py --update


Type -h for basic options list:

python sqlmap.py -h

or -hh to get a full list of options and switches:

python sqlmap.py -hh

Sqlmap: Automatic Sql Injection example run

To see all of the sqlmap capabilities, list of supported features, all options, switches and examples click the DOCUMENTATION link bellow.

Documentation Box
Download Box

Leave a Reply
