D
detecting-sql-injection-via-waf-logs
About detecting-sql-injection-via-waf-logs
A SQL injection detection procedure for SOC analysts working with WAF logs. It describes log parsing, attack classification, source clustering, and request correlation.
Key features
- 01Parse several WAF log formats
- 02Detect SQL injection with regex patterns
- 03Classify by OWASP injection type
- 04Cluster IPs to identify persistent attackers
- 05Correlate campaigns and estimate success likelihood
Use cases
- 01Investigate SQL injection events in WAF logs
- 02Build injection detection rules
- 03Analyze attacks from recurring IP addresses
- 04Validate security monitoring coverage
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill detecting-sql-injection-via-waf-logsAfter installing, type/detecting-sql-injection-via-waf-logsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
LICENSEreferences/api-reference.mdscripts/agent.pyDetails
From the project READMEDetecting SQL Injection via WAF Logs
When to Use
- When investigating security incidents that require detecting sql injection via waf logs
- When building detection rules or threat hunting queries for this domain
- When SOC analysts need structured procedures for this analysis type
- When validating security monitoring coverage for related attack techniques
Prerequisites
- Familiarity with security operations concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Instructions
- Install dependencies:
pip install requests - Collect WAF logs (ModSecurity audit log, AWS WAF JSON logs, or Cloudflare firewall events).
- Run the agent to parse and analyze:
- Detect SQLi payloads via 15+ regex patterns
- Classify attacks by OWASP injection type (classic, blind, time-based, UNION-based)
- Identify persistent attackers by IP clustering
- Correlate multi-request injection campaigns
- Calculate attack success probability based on response codes
python scripts/agent.py --log-file /var/log/modsec_audit.log --format modsecurity --output sqli_report.json
Examples
ModSecurity SQLi Detection
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
Comments
Markdown supported