neeljain21/security-log-analyzer

GitHub: neeljain21/security-log-analyzer

这是一个轻量级的自动化Web服务器日志解析工具,用于检测攻击模式、识别可疑IP并生成JSON格式的事件响应报告。

Stars: 0 | Forks: 0

# security-log-analyzer 设置 Apache/Nginx 访问日志的自动解析器,用于检测攻击模式、标记可疑 IP 并生成 JSON 事件响应报告。 检测规则位于 `rules.py` 中——只需在 `RULES` 列表中添加一个新的字典即可添加新规则。无需修改其他文件。 ## 设置 ``` pip install requests # no other dependencies ``` ## 使用 ``` python analyzer.py sample_logs/access.log python analyzer.py /var/log/nginx/access.log -o report.json python analyzer.py access.log --severity high # only high severity hits ``` ## 检测内容 **规则(基于模式):** - SQL 注入 — `UNION SELECT`、`' OR '1'='1`、`DROP TABLE` 等。 - XSS — `