Configuration Guide¶
Learn how to configure SQLMap AI for optimal performance and security. This guide covers all configuration options and best practices.
Configuration Files¶
SQLMap AI uses several configuration files to manage settings:
~/.sqlmap-ai/
├── .env # Environment variables
├── config.yaml # Main configuration
└── logs/ # Log files
Environment Variables (.env)¶
The .env
file contains sensitive information like API keys and security
settings.
AI Provider Configuration¶
# Groq (Recommended - Fastest)
GROQ_API_KEY=your_groq_api_key_here
# OpenAI
OPENAI_API_KEY=your_openai_api_key_here
# Anthropic (Claude)
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Ollama (Local AI)
ENABLE_OLLAMA=true
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3.2
Security Settings¶
# Rate limiting
MAX_REQUESTS_PER_MINUTE=60
# Safety features
SAFE_MODE=true
AUDIT_LOGGING=true
# Network settings
REQUEST_TIMEOUT=30
MAX_RETRIES=3
Advanced Settings¶
# Logging
LOG_LEVEL=INFO
LOG_FILE=~/.sqlmap-ai/logs/sqlmap_ai.log
# Output
DEFAULT_OUTPUT_DIR=./results
HTML_REPORT_ENABLED=true
# Performance
DEFAULT_THREADS=5
DEFAULT_TIMEOUT=120
Main Configuration (config.yaml)¶
The config.yaml
file contains non-sensitive configuration options.
Basic Configuration¶
version: "2.0"
# Security settings
security:
safe_mode: true
max_requests_per_minute: 60
audit_logging: true
request_timeout: 30
max_retries: 3
# SQLMap settings
sqlmap:
default_timeout: 120
default_risk: 1
default_level: 1
default_threads: 5
batch_mode: false
force: false
# AI settings
ai:
default_provider: "auto"
enable_analysis: true
enable_recommendations: true
analysis_timeout: 30
# UI settings
ui:
show_banner: true
interactive_mode: false
progress_bars: true
color_output: true
# Output settings
output:
default_directory: "./results"
html_report: true
json_report: true
log_file: true
screenshots: false
Advanced Configuration¶
# Database settings
database:
enabled: false
type: "sqlite"
path: "~/.sqlmap-ai/database.db"
# Proxy settings
proxy:
enabled: false
http: ""
https: ""
username: ""
password: ""
# Custom headers
headers:
User-Agent: "SQLMap AI/2.0.1"
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
Accept-Language: "en-US,en;q=0.5"
Accept-Encoding: "gzip, deflate"
# Tamper scripts
tamper:
enabled: false
scripts: []
custom_scripts: []
# WAF evasion
waf_evasion:
enabled: true
techniques:
- "randomcase"
- "space2comment"
- "space2plus"
custom_techniques: []
Configuration Wizard¶
Use the interactive configuration wizard for easy setup:
The wizard will guide you through:
- AI Provider Selection
- Choose your preferred AI providers
- Configure API keys
-
Test provider connectivity
-
Security Settings
- Set rate limiting
- Configure safe mode
-
Enable audit logging
-
SQLMap Options
- Set default risk and level
- Configure timeouts
-
Set thread count
-
Output Settings
- Choose output directory
- Enable/disable reports
-
Configure logging
-
Advanced Options
- Proxy settings
- Custom headers
- Tamper scripts
Command Line Configuration¶
You can override configuration settings via command line:
AI Provider Options¶
# Select AI provider
sqlmap-ai -u "http://example.com" --ai-provider groq
# Set Ollama model
sqlmap-ai -u "http://example.com" --ai-provider ollama --ollama-model codellama
# Disable AI analysis
sqlmap-ai -u "http://example.com" --no-ai
Security Options¶
# Set rate limit
sqlmap-ai -u "http://example.com" --max-requests 30
# Disable safe mode
sqlmap-ai -u "http://example.com" --no-safe-mode
# Enable audit logging
sqlmap-ai -u "http://example.com" --audit-log
SQLMap Options¶
# Set risk and level
sqlmap-ai -u "http://example.com" --risk 3 --level 5
# Set threads and timeout
sqlmap-ai -u "http://example.com" --threads 10 --timeout 60
# Enable batch mode
sqlmap-ai -u "http://example.com" --batch
Output Options¶
# Set output directory
sqlmap-ai -u "http://example.com" --output-dir ./my_results
# Generate HTML report
sqlmap-ai -u "http://example.com" --html-report
# Enable verbose output
sqlmap-ai -u "http://example.com" --verbose
Configuration Validation¶
Validate Configuration¶
Check if your configuration is valid:
This will check: - Environment variables - Configuration file syntax - AI provider connectivity - File permissions
Check AI Providers¶
Verify AI provider setup:
Expected output:
Test Configuration¶
Run a test with your configuration:
# Test with sample target
sqlmap-ai -u "http://testphp.vulnweb.com/listproducts.php?cat=1" --test-config
Best Practices¶
Security Configuration¶
-
Use Environment Variables
-
Enable Safe Mode
-
Use Rate Limiting
Performance Configuration¶
-
Optimize Threads
-
Set Timeouts
-
Enable Caching
Privacy Configuration¶
-
Use Local AI
-
Disable Cloud Providers
-
Use Proxy
Configuration Examples¶
Development Configuration¶
# config.yaml
version: "2.0"
security:
safe_mode: true
max_requests_per_minute: 30
sqlmap:
default_risk: 1
default_level: 1
default_threads: 3
ai:
default_provider: "groq"
output:
default_directory: "./dev_results"
html_report: true
Production Configuration¶
# config.yaml
version: "2.0"
security:
safe_mode: true
max_requests_per_minute: 100
audit_logging: true
sqlmap:
default_risk: 2
default_level: 3
default_threads: 10
ai:
default_provider: "auto"
output:
default_directory: "./production_results"
html_report: true
json_report: true
Privacy-Focused Configuration¶
# config.yaml
version: "2.0"
security:
safe_mode: true
max_requests_per_minute: 60
ai:
default_provider: "ollama"
enable_analysis: true
output:
default_directory: "./private_results"
html_report: false
json_report: true
Troubleshooting¶
Common Configuration Issues¶
"Configuration file not found"¶
Solution: Run the configuration wizard
"Invalid YAML syntax"¶
Solution: Validate YAML syntax
# Use online YAML validator
# Or check with Python
python -c "import yaml; yaml.safe_load(open('config.yaml'))"
"Permission denied"¶
Solution: Check file permissions
Getting Help¶
- Validate config:
sqlmap-ai --validate-config
- Check providers:
sqlmap-ai --check-providers
- Run wizard:
sqlmap-ai --config-wizard
- View logs:
~/.sqlmap-ai/logs/
Next Steps¶
After configuring SQLMap AI:
- Quick Start: Test your configuration
- Basic Usage: Learn how to use the tool
- Testing Modes: Explore different testing approaches
- Examples: See real-world examples