【发布时间】:2022-01-24 14:16:43
【问题描述】:
我认为这太详细了。我将它安装在 Windows 7 上并使用 apache 服务器。
https://i.stack.imgur.com/F55Yp.jpg
https://i.stack.imgur.com/V09JL.jpg
https://i.stack.imgur.com/Lg7pd.jpg
【问题讨论】:
标签: apache mod-security mod-security2
我认为这太详细了。我将它安装在 Windows 7 上并使用 apache 服务器。
https://i.stack.imgur.com/F55Yp.jpg
https://i.stack.imgur.com/V09JL.jpg
https://i.stack.imgur.com/Lg7pd.jpg
【问题讨论】:
标签: apache mod-security mod-security2
CRS 开发人员在这里。确实,默认情况下日志包含大量信息。也许您可以通过使用 JSON 作为日志格式来帮助您。您可以通过添加:
SecAuditLogFormat JSON
到您的 mod_security.conf 文件。 (注意:我没有 Windows 经验,所以我不知道配置文件的确切名称和位置)。
然后,对于每个记录的事件,日志每行包含一个 JSON 对象。您可以使用jq 实用程序来漂亮地打印 JSON 或仅选择感兴趣的部分。
例如,如果您只想查看匹配的规则消息,您可以像这样使用jq:
curl 'https://sandbox.coreruleset.org/?test=posix_uname(123)' | jq .audit_data.messages
[
"Warning. Matched phrase \"posix_uname\" at ARGS:test. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf\"] [line \"294\"] [id \"933150\"] [msg \"PHP Injection Attack: High-Risk PHP Function Name Found\"] [data \"Matched Data: posix_uname found within ARGS:test: posix_uname(123)\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.3.2\"] [tag \"modsecurity\"] [tag \"application-multi\"] [tag \"language-php\"] [tag \"platform-multi\"] [tag \"attack-injection-php\"] [tag \"paranoia-level/1\"] [tag \"OWASP_CRS\"] [tag \"capec/1000/152/242\"]",
"Warning. Operator GE matched 5 at TX:anomaly_score. [file \"/etc/modsecurity.d/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf\"] [line \"93\"] [id \"949110\"] [msg \"Inbound Anomaly Score Exceeded (Total Score: 5)\"] [severity \"CRITICAL\"] [ver \"OWASP_CRS/3.3.2\"] [tag \"modsecurity\"] [tag \"application-multi\"] [tag \"language-multi\"] [tag \"platform-multi\"] [tag \"attack-generic\"]",
"Unconditional match in SecAction. [file \"/etc/modsecurity.d/crs-demo-setvar.conf\"] [line \"11\"] [id \"100000\"] [tag \"modsecurity\"]",
"Warning. Operator GE matched 5 at TX:inbound_anomaly_score. [file \"/etc/modsecurity.d/owasp-crs/rules/RESPONSE-980-CORRELATION.conf\"] [line \"91\"] [id \"980130\"] [msg \"Inbound Anomaly Score Exceeded (Total Inbound Score: 5 - SQLI=0,XSS=0,RFI=0,LFI=0,RCE=0,PHPI=5,HTTP=0,SESS=0): individual paranoia level scores: 5, 0, 0, 0\"] [ver \"OWASP_CRS/3.3.2\"] [tag \"modsecurity\"] [tag \"event-correlation\"]"
]
【讨论】: