Detecting sql injection via waf logs

From killvxk/cybersecurity-skills-zh · View interactive version

Detecting sql injection via waf logs is an AI agent skill from the GitHub repository killvxk/cybersecurity-skills-zh. 分析 WAF(Web 应用防火墙,ModSecurity/AWS WAF/Cloudflare)日志,检测 SQL 注入(SQL Injection)攻击活动。 解析 ModSecurity 审计日志和 JSON WAF 事件日志,识别 SQLi 模式(UNION SELECT、OR 1=1、SLEEP()、BENCHMARK()), 追踪攻击源,关联多阶段注入尝试,并生成带 OWASP 分类的事件报告。

How to use this skill

Skill file

使用说明

  1. 安装依赖:pip install requests
  2. 收集 WAF 日志(ModSecurity 审计日志、AWS WAF JSON 日志或 Cloudflare 防火墙事件)。
  3. 运行 Agent 进行解析和分析:
python scripts/agent.py --log-file /var/log/modsec_audit.log --format modsecurity --output sqli_report.json

示例

ModSecurity SQLi 检测

Rule 942100 triggered: SQL Injection Attack Detected via libinjection
URI: /api/users?id=1' UNION SELECT username,password FROM users--
Source IP: 203.0.113.42 (47 requests in 5 minutes)
Classification: UNION-based SQLi campaign
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.