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:

    1. Basic SQL Injection Test:
      • sqlmap -u “http://example.com/vuln?id=1”

Explanation: Tests the target URL for SQL injection vulnerabilities and attempts to enumerate databases.

    1. List Databases:
      • sqlmap -u “http://example.com/vuln?id=1” –dbs

Explanation: Finds SQL injection vulnerabilities and lists all the databases.

    1. Dump Database:
      • sqlmap -u “http://example.com/vuln?id=1” -D testdb -T users –dump

Explanation: Dumps the “users” table from the “testdb” database if the injection is successful.

    1. Specify HTTP Headers:
      • sqlmap -u “http://example.com/vuln?id=1″ –headers=”User-Agent: Mozilla”

Explanation: Uses a custom User-Agent header for the SQL injection attempt.

Scroll to Top