crazymarky/pentest-skills/exploit-sqli
Claude Code and agent skill by crazymarky/pentest-skills
- community
Checking that the SKILL.md file is still in the repository.
SQL injection detection and exploitation using sqlmap, manual techniques, and custom payloads. Use this skill when user needs to test for SQL injection vulnerabilities, extract database information, or exploit SQLi in parameters, headers, or cookies.
Install
npx vskill@latest install crazymarky/pentest-skills/exploit-sqliSKILL.md
SQL Injection Detection & Exploitation
Authorization Warning
DANGER: SQL injection testing can damage or destroy data in production databases. Always ensure you have:
- Written permission from the target application owner
- Isolated testing environment
- Backups of affected systems
- Legal compliance with local regulations
Never test SQL injection on production databases without authorization.
Prerequisites
Required tools that must be installed on your system:
- sqlmap -
pip install sqlmaporgit clone https://github.com/sqlmapproject/sqlmap
Optional tools:
- BBQSQL - Semi-automated SQL injection tool
- NoSQLMap - NoSQL injection testing
Quick Start
Most commonly used commands for SQL injection testing:
Automated SQLMap Scan
POST Request Testing
Cookie Testing
Common Scenarios
Scenario 1: Basic Parameter Testing
When you need to test a URL parameter for SQL injection:
Parameters:
-u- Target URL-p- Specific parameter to test (default: all)--batch- Avoid interactive prompts--random-agent- Use random User-Agent
Example:
Scenario 2: POST Request Injection
When you need to test POST body parameters:
From file:
Scenario 3: Cookie/Header Injection
When you need to test cookies or headers:
Multiple headers:
Scenario 4: Specific DBMS Testing
When you know or suspect the database type:
Scenario 5: Database Enumeration
When you need to extract database information:
Scenario 6: User Enumeration
When you need to extract user credentials:
Scenario 7: Union-Based SQL Injection
Manual testing for Union-based SQLi:
Determine column count:
Check for string vs integer:
Scenario 8: Error-Based SQL Injection
When error messages are displayed:
Scenario 9: Blind SQL Injection
When no error messages are returned:
Boolean-based:
Time-based (MySQL):
Time-based (PostgreSQL):
Scenario 10: WAF Evasion
When WAF blocks injection attempts:
Injection Testing Workflow
1. Initial Detection
2. Confirmation
3. Fingerprint Database
4. Enumeration
SQLMap Options Reference
| Option | Description | |
|---|---|---|
-u | Target URL | |
-r | Parse log file | |
-l | Load from file | |
-m | Scan multiple targets | |
-p | Test specific parameters | |
--skip | Skip parameters | |
--dbms | Force DBMS | |
--os | Force OS | |
--tamper | Tamper script | |
--level | Test level (1-5) | |
--risk | Risk level (1-3) | |
--technique | Specific technique (B/E/U/S/T) | |
--batch | Non-interactive | |
--random-agent | Random User-Agent | |
--proxy | Use proxy | |
--delay | Delay between requests | |
--timeout | Request timeout | |
--retries | Retry attempts | |
--string | Match string | |
--not-string | Not match string | |
--regexp | Regexp filter | |
--grep | Regexp filter for pages | |
--crawl | Crawl site | |
--forms | Parse forms | |
--cookie | Cookie value | |
--headers | Extra headers | |
--user-agent | Custom User-Agent | |
--method | Force method | |
--data | POST data | |
-d | POST data from file | |
--dbs | Enumerate databases | |
--tables | Enumerate tables | |
--columns | Enumerate columns | |
--schema | Enumerate schema | |
--dump | Dump data | |
--dump-all | Dump all | |
--search | Search | |
--users | Enumerate DB users | |
--passwords | Enumerate password hashes | |
--priv-esc | Privilege escalation | |
--os-shell | OS shell | |
--os-pwn | Meterpreter/OBM shell | |
--sql-shell | SQL shell | |
--wizard | Wizard mode | |
-v | Verbosity (0-6) |
Manual Payloads
MySQL Payloads
PostgreSQL Payloads
SQL Server Payloads
Oracle Payloads
Testing Checklist
- [ ] URL parameters
- [ ] POST parameters
- [ ] Cookies
- [ ] User-Agent
- [ ] Referer
- [ ] X-Forwarded-For
- [ ] Accept headers
- [ ] JSON body fields
- [ ] GraphQL queries
- [ ] API endpoints
Scenario: Persistent Storage of SQL Injection Findings
When you need to persist SQL injection findings to the database:
Parameters:
--host-ip- Target host IP (required)--url- Vulnerable URL (required)--parameter- Vulnerable parameter name (required)--payload- Payload used (required)--severity- Severity level (default: High)--cvss-score- CVSS score (0.0-10.0)--db-type- Database type (e.g., MySQL, PostgreSQL)--subsystem- Subsystem name (optional)--title- Vulnerability title (auto-generated if not specified)--description- Vulnerability description
Database location: ./data/results.db
Related skills: results-storage - Query data, generate reports
Resources
Scripts
scripts/sqli_payload_generator.py- Generate SQL injection payloadsscripts/boolean_sqli_tester.py- Test blind SQL injectionscripts/response_analyzer.py- Analyze responses for injection clues
References
references/sqlmap_guide.md- Comprehensive SQLMap referencereferences/manual_sqli_techniques.md- Manual injection techniquesreferences/nosql_injection.md- NoSQL injection guide
Assets
assets/common_error_payloads.txt- Common error-based payloadsassets/time-based_payloads.txt- Time-based blind payloadsassets/dbms_fingerprints.txt- Database fingerprinting patterns
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingexploit-sqli/SKILL.md
Popularity
- Repository stars
- 216
- Repository forks
- 26
- 7-day trend score
- 27
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/crazymarky/pentest-skills/exploit-sqli)