SQL注入MCP服务器
用于发现web应用程序中SQL注入漏洞的模型上下文协议(MCP)服务器。
特性
- 多种注射类型:基于错误、基于时间、基于布尔值、基于联合、盲SQL注入
- 数据库支持:MySQL、MSSQL、PostgreSQL、Oracle、SQLite
- HTTP方法:GET和POST参数测试
- 认证:自定义标头、Cookie、承载令牌
- 代理支持:通过Burp Suite或其他代理路由流量
- WAF旁路:URL编码、十六进制编码、Unicode、大小写交换、注释注入
- 自定义有效载荷:从外部文件加载有效载荷
安装
# Using uv (recommended)
cd SQLinjector_MCP
uv sync
# Using pip
pip install -e .用法
运行服务器
# Using uv
uv run sqli-mcp
# Or directly
python -m sqli_mcp.serverMCP客户端配置
克劳德桌面/克劳德代码
添加到MCP配置中:
{
"mcpServers": {
"sqli-scanner": {
"command": "uv",
"args": ["--directory", "C:/path/to/SQLinjector_MCP", "run", "sqli-mcp"]
}
}
}LM工作室/光标
启动HTTP传输后配置服务器URL:
uv run python -c "from sqli_mcp.server import mcp; mcp.run(transport='streamable-http')"然后连接到 http://localhost:8000/mcp
可用工具
| 工具 | 说明 |
|---|---|
scan_url | 在所有检测到的参数中进行SQLi的完整URL扫描 |
scan_get_parameter | 测试特定的GET参数 |
scan_post_parameter | 测试特定POST参数 |
test_payload | 针对目标测试单个有效载荷 |
list_payloads | 列出可用的内置有效载荷 |
load_custom_payloads_from_file | 从外部文件加载有效载荷 |
get_waf_bypass_payloads | 获取负载的WAF旁路变体 |
get_scan_result | 检索以前的扫描结果 |
| 批量扫描 | |
scan_urls_batch | 扫描多个URL(换行符分隔,最多500个) |
scan_urls_from_file | 扫描文件中的URL(每行一个) |
get_batch_result | 检索批量扫描结果 |
get_vulnerable_urls | 从批处理中仅获取易受攻击的URL |
例子
基本GET参数扫描
Use scan_url with:
- target_url: "http://vulnerable-site.com/page?id=1"经过身份验证的POST扫描
Use scan_post_parameter with:
- target_url: "http://site.com/login"
- post_data: "username=admin&password=test"
- parameter: "username"
- cookies: "session=abc123"
- bearer_token: "your-jwt-token"使用Burp Suite代理
Use scan_url with:
- target_url: "http://target.com/page?id=1"
- proxy_url: "http://127.0.0.1:8080"
- verify_ssl: falseWAF旁路
Use scan_url with:
- target_url: "http://target.com/page?id=1"
- waf_bypass: "comment_injection"批量URL扫描
从列表中扫描多个URL:
Use scan_urls_batch with:
- urls: "http://site1.com/page?id=1
http://site2.com/search?q=test
http://site3.com/user?uid=5"
- concurrency: 10
- waf_bypass: "url_encode"扫描文件中的URL:
Use scan_urls_from_file with:
- file_path: "C:/path/to/urls.txt"
- concurrency: 5
- proxy_url: "http://127.0.0.1:8080"仅获取易受攻击的URL:
Use get_vulnerable_urls with:
- batch_id: "abc12345"自定义有效载荷
创建一个每行包含一个有效载荷的文本文件:
# my_payloads.txt
' OR '1'='1
" OR "1"="1
' UNION SELECT NULL--然后加载:
Use load_custom_payloads_from_file with:
- file_path: "C:/path/to/my_payloads.txt"
- injection_type: "union_based"
- name: "my_custom"安全通知
⚠️ 此工具仅用于授权的安全测试。 在测试任何系统漏洞之前,始终获得适当的授权。未经授权访问计算机系统是非法的。
许可证
麻省理工学院
