Skip to content

Quick Start Guide

Get up and running with SQLMap AI in minutes! This guide will walk you through installation, configuration, and your first SQL injection test.

Prerequisites

  • Python 3.8 or higher
  • Internet connection (for cloud AI providers)
  • 2GB+ RAM (for Ollama local models)

Step 1: Installation

pip install sqlmap-ai

Option B: Install from Source

git clone https://github.com/atiilla/sqlmap-ai.git
cd sqlmap-ai
pip install -e .

Verify Installation

sqlmap-ai --version

Step 2: Set Up AI Provider

Choose one of the following AI providers:

  1. Get a free API key from https://console.groq.com
  2. Create a .env file in your project directory:
GROQ_API_KEY=your_groq_api_key_here

OpenAI

  1. Get an API key from https://platform.openai.com
  2. Add to your .env file:
OPENAI_API_KEY=your_openai_api_key_here

Anthropic (Claude)

  1. Get an API key from https://console.anthropic.com
  2. Add to your .env file:
ANTHROPIC_API_KEY=your_anthropic_api_key_here

Ollama (Local AI - Privacy Focused)

  1. Install Ollama: https://ollama.ai/download
  2. Start Ollama service:
ollama serve
  1. Download a model:
ollama pull llama3.2
  1. Enable in your .env file:
ENABLE_OLLAMA=true
OLLAMA_MODEL=llama3.2

Step 3: Run Installation Check

sqlmap-ai --install-check

This command will: - Check your AI provider setup - Install SQLMap if needed - Create configuration files - Validate your environment

Step 4: Configure Settings (Optional)

Run the interactive configuration wizard:

sqlmap-ai --config-wizard

This will help you: - Select AI providers - Configure security settings - Set up SQLMap options - Choose Ollama models (if using Ollama)

Step 5: Test Your Setup

Check AI Providers

sqlmap-ai --check-providers

Expected output:

✅ Groq: Available
✅ OpenAI: Available
✅ Anthropic: Available
✅ Ollama: Available (llama3.2)

List Ollama Models (if using Ollama)

sqlmap-ai --list-ollama-models

Step 6: Your First Test

Basic SQL Injection Test

# Test a vulnerable website
sqlmap-ai -u "http://testphp.vulnweb.com/listproducts.php?cat=1"

Enhanced Mode with AI Analysis

# Use enhanced mode for AI-powered testing
sqlmap-ai --enhanced -u "http://testphp.vulnweb.com/listproducts.php?cat=1"

With Specific AI Provider

# Use Groq (fastest)
sqlmap-ai -u "http://testphp.vulnweb.com/listproducts.php?cat=1" --ai-provider groq

# Use Ollama (local, private)
sqlmap-ai -u "http://testphp.vulnweb.com/listproducts.php?cat=1" --ai-provider ollama

Step 7: View Results

After running a test, you'll see:

  1. Real-time Progress: Live updates on the testing process
  2. AI Analysis: Intelligent insights and recommendations
  3. HTML Report: Beautiful report saved to reports/ directory
  4. Console Output: Detailed results in the terminal

What's Next?

Now that you've completed your first test, explore these features:

Troubleshooting

If you encounter issues:

  1. Check AI Providers: sqlmap-ai --check-providers
  2. Validate Configuration: sqlmap-ai --validate-config
  3. Re-run Setup: sqlmap-ai --install-check
  4. See Help: sqlmap-ai --help

For more detailed troubleshooting, see the Troubleshooting Guide.

Example Output

Here's what a successful test looks like:

$ sqlmap-ai --enhanced -u "http://testphp.vulnweb.com/listproducts.php?cat=1"

🚀 SQLMap AI - AI-Powered SQL Injection Testing
================================================

📋 Target Information:
   URL: http://testphp.vulnweb.com/listproducts.php?cat=1
   Method: GET
   Parameter: cat

🤖 AI Provider: Groq (Auto-selected)

🔄 Starting Enhanced Mode...
   ├─ Initial Assessment: Checking for SQL injection vulnerabilities
   ├─ DBMS Identification: Detecting database type
   ├─ Enhanced Testing: Applying advanced techniques
   └─ AI Analysis: Generating insights and recommendations

 Results:
   ├─ Vulnerable Parameters: cat (GET)
   ├─ DBMS: MySQL >= 5.6
   ├─ Techniques: Boolean-based blind, time-based blind
   └─ Risk Level: HIGH

📊 Report generated: reports/sqlmap_ai_report_20241201_143022.html

🎯 AI Recommendations:
   - Target is vulnerable to SQL injection
   - Consider extracting database information
   - Implement proper input validation
   - Use parameterized queries