sqlmap
Automatic SQL injection tool that detects and exploits SQL injection vulnerabilities in web applications. It allows fingerprinting of the back-end DBMS, enumeration of databases, users, tables, and data dumping.
Description
sqlmap is designed to detect and take advantage of SQL injection vulnerabilities in web applications. Once it identifies SQL injections on the target host, users can perform extensive back-end database management system fingerprinting, retrieve DBMS session user and database information, enumerate users, password hashes, privileges, databases, and dump entire or specific DBMS tables and columns. It also supports running custom SQL statements, reading files on the file system, and gaining operating system access.
Use cases include automated testing for SQL injection flaws in web apps, extracting sensitive data from vulnerable databases, and demonstrating the impact of SQLi vulnerabilities. The tool emphasizes legal use with prior consent and includes a disclaimer about user responsibility for compliance with laws.
Additional components like sqlmapapi provide REST-JSON API server and client functionality for integrating sqlmap capabilities programmatically.
How It Works
sqlmap tests target URLs for SQL injection by sending crafted payloads and analyzing responses for DBMS-specific behaviors across techniques like Boolean-based blind, Error-based, UNION query, Stacked queries, Time-based blind, and Out-of-band. It supports customizable detection levels (1-5) and risk levels (1-3), parameter selection, DBMS forcing, proxies, Tor, and random agents. Upon detection, it enumerates DBMS details, structures, and data using injection points, and can escalate to OS shells or file access via DBMS privileges.
Installation
sudo apt install sqlmapFlags
Examples
sqlmap -u "http://192.168.1.250/?p=1&forumaction=search" --dbssqlmap -hsqlmap -hhsqlmap --versionsqlmap -u "http://www.site.com/vuln.php?id=1"sqlmap --data="id=1"sqlmap --cookie="PHPSESSID=a8d127e.."sqlmap --tor