|
| 1 | +# Installation |
| 2 | + |
| 3 | +## Prerequisites |
| 4 | + |
| 5 | +- Python 3.8+ |
| 6 | +- SQLMap (must be installed globally on your system) |
| 7 | +- Internet connection (for cloud AI providers) |
| 8 | +- 2GB+ RAM (for Ollama local models) |
| 9 | + |
| 10 | +## Step 1: Install SQLMap |
| 11 | + |
| 12 | +First, install SQLMap globally on your system: |
| 13 | + |
| 14 | +```bash |
| 15 | +# Kali/Debian/Ubuntu |
| 16 | +sudo apt install sqlmap |
| 17 | + |
| 18 | +# macOS |
| 19 | +brew install sqlmap |
| 20 | + |
| 21 | +# Or from source |
| 22 | +git clone https://github.com/sqlmapproject/sqlmap.git |
| 23 | +cd sqlmap |
| 24 | +sudo python setup.py install |
| 25 | + |
| 26 | +# Verify installation |
| 27 | +sqlmap --version |
| 28 | +``` |
| 29 | + |
| 30 | +## Step 2: Install SQLMap AI |
| 31 | + |
| 32 | +```bash |
| 33 | +# Clone the repository |
| 34 | +git clone https://github.com/atiilla/sqlmap-ai.git |
| 35 | +cd sqlmap-ai |
| 36 | + |
| 37 | +# Install the package |
| 38 | +pip install -e . |
| 39 | + |
| 40 | +# Or install from PyPI |
| 41 | +pip install sqlmap-ai |
| 42 | + |
| 43 | +# Run installation check (creates config files) |
| 44 | +sqlmap-ai --install-check |
| 45 | +``` |
| 46 | + |
| 47 | +## Step 3: Configure AI Providers |
| 48 | + |
| 49 | +Choose one or more AI providers to use: |
| 50 | + |
| 51 | +### Option A: Groq (Recommended - Fastest) |
| 52 | +1. Get a free API key from [https://console.groq.com](https://console.groq.com) |
| 53 | +2. Add to your `.env` file: |
| 54 | +```bash |
| 55 | +GROQ_API_KEY=your_groq_api_key_here |
| 56 | +``` |
| 57 | + |
| 58 | +### Option B: OpenAI |
| 59 | +1. Get an API key from [https://platform.openai.com](https://platform.openai.com) |
| 60 | +2. Add to your `.env` file: |
| 61 | +```bash |
| 62 | +OPENAI_API_KEY=your_openai_api_key_here |
| 63 | +``` |
| 64 | + |
| 65 | +### Option C: Anthropic (Claude) |
| 66 | +1. Get an API key from [https://console.anthropic.com](https://console.anthropic.com) |
| 67 | +2. Add to your `.env` file: |
| 68 | +```bash |
| 69 | +ANTHROPIC_API_KEY=your_anthropic_api_key_here |
| 70 | +``` |
| 71 | + |
| 72 | +### Option D: Ollama (Local AI - Privacy Focused) |
| 73 | +1. Install Ollama: [https://ollama.ai/download](https://ollama.ai/download) |
| 74 | +2. Start Ollama service: |
| 75 | +```bash |
| 76 | +ollama serve |
| 77 | +``` |
| 78 | +3. Download a model: |
| 79 | +```bash |
| 80 | +ollama pull llama3.2 |
| 81 | +``` |
| 82 | +4. Enable in your `.env` file: |
| 83 | +```bash |
| 84 | +ENABLE_OLLAMA=true |
| 85 | +OLLAMA_MODEL=llama3.2 |
| 86 | +``` |
| 87 | + |
| 88 | +### Ollama Model Selection |
| 89 | + |
| 90 | +If using Ollama, you can select different models: |
| 91 | + |
| 92 | +```bash |
| 93 | +# List available models |
| 94 | +sqlmap-ai --list-ollama-models |
| 95 | + |
| 96 | +# Interactive model selection |
| 97 | +sqlmap-ai --config-wizard |
| 98 | +``` |
| 99 | + |
| 100 | +Popular models: |
| 101 | +- **llama3.2** - Good general performance |
| 102 | +- **codellama** - Specialized for code analysis |
| 103 | +- **mistral** - Fast and efficient |
| 104 | +- **qwen2.5** - Good reasoning capabilities |
| 105 | + |
| 106 | +## Step 4: Run Configuration Wizard |
| 107 | + |
| 108 | +```bash |
| 109 | +# Interactive setup |
| 110 | +sqlmap-ai --config-wizard |
| 111 | +``` |
| 112 | + |
| 113 | +This will: |
| 114 | +- Check your AI provider setup |
| 115 | +- Let you select Ollama models (if using Ollama) |
| 116 | +- Configure security settings |
| 117 | +- Set up SQLMap options |
| 118 | + |
| 119 | +## Step 5: Test Your Setup |
| 120 | + |
| 121 | +```bash |
| 122 | +# Check if everything is working |
| 123 | +sqlmap-ai --check-providers |
| 124 | + |
| 125 | +# List available Ollama models (if using Ollama) |
| 126 | +sqlmap-ai --list-ollama-models |
| 127 | +``` |
| 128 | + |
| 129 | +## AI Providers Comparison |
| 130 | + |
| 131 | +| Provider | Setup | Speed | Privacy | Cost | |
| 132 | +|----------|-------|-------|---------|------| |
| 133 | +| **Groq** | API Key | Fastest | Cloud | Free tier available | |
| 134 | +| **OpenAI** | API Key | Fast | Cloud | Pay per use | |
| 135 | +| **Anthropic** | API Key | Fast | Cloud | Pay per use | |
| 136 | +| **Ollama** | Local install | Fast | Local | Free | |
0 commit comments