在设置mod_security后,我得到了很多误报[??].我只是在检测中运行它,所以没有任何问题,但这些过滤器将在我需要它生效后开始阻止请求.
我不敢100%理解这些过滤器的重要性,我几乎在每个域上获得了100个,所有请求看起来都合法.
Request Missing a User Agent Header
Request Missing an Accept Header
Run Code Online (Sandbox Code Playgroud)
这里最好的事情是什么?我应该禁用这些过滤器吗?我可以将严重性设置得更低,以便不会阻止请求吗?
这是一个完整的条目
[22/Nov/2011:21:32:37 --0500] u6t6IX8AAAEAAHSiwYMAAAAG 72.47.232.216 38543 72.47.232.216 80
--5fcb9215-B--
GET /Assets/XHTML/mainMenu.html HTTP/1.0
Host: www.domain.com
Content-type: text/html
Cookie: pdgcomm-babble=413300:451807c5d49b8f61024afdd94e57bdc3; __utma=100306584.1343043347.1321115981.1321478968.1321851203.4; __utmz=100306584.1321115981.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=XXXXXXXX%20clip%20ons
--5fcb9215-F--
HTTP/1.1 200 OK
Last-Modified: Wed, 23 Nov 2011 02:01:02 GMT
ETag: "21e2a7a-816d"
Accept-Ranges: bytes
Content-Length: 33133
Vary: Accept-Encoding
Connection: close
Content-Type: text/html
--5fcb9215-H--
Message: Operator EQ matched 0 at REQUEST_HEADERS. [file "/etc/httpd/modsecurity_crs/base_rules/modsecurity_crs_21_protocol_anomalies.conf"] [line "47"] [id "960015"] [rev "2.2.1"] [msg "Request Missing an Accept Header"] [severity …Run Code Online (Sandbox Code Playgroud) 我在Mod_Security包中看到了名为standalone的模块; 但我不确定如何在制作和安装后使用它!启动时有没有好的资源?
据我尝试,通常的解决方案都不适用于我。好吧,我的问题,每次上传“大文件”(600 KB ~)时,我都会收到 500 错误,使用较小的图像可以正常工作。所以...,即使有这个(极端).htaccess 文件,它也会不断发生,是的,.htaccess 是活动的:
upload_max_filesize = 100M
post_max_size = 100M
memory_limit = 128M
max_input_time = 6000
max_execution_time = 6000
Run Code Online (Sandbox Code Playgroud)
因此,我查看了日志并发现了这一点(只有一行,只是将其粘贴为易于阅读的行跳转):
[Mon Jul 27 17:09:28.<port> 2015] [:error] [pid 21423] [client <ip>]
ModSecurity: Access denied with code 44 (phase 2).
Match of "eq 0" against "MULTIPART_UNMATCHED_BOUNDARY" required.
[file "/etc/httpd/conf.d/mod_security.conf"]
[line "35"] [id "<another id>"]
[msg "Multipart parser detected a possible unmatched boundary."]
[hostname "<my host>"] [uri "<my script>"] [unique_id "<id (useless I think)"]
Run Code Online (Sandbox Code Playgroud)
但是,现在我无法找到如何编辑 mod_security(它具有默认配置和空的 activate_rules)配置以便(我认为)允许这个“大”文件上传。我在 Apache 2.4/CentOS 7 …
我一直有很多与Mod Security有关的问题.我正忙于为工作中的项目编写CMS,在开发编辑某个数据库记录的页面时,我不断收到403错误.经过几个小时的敲打我的桌子后,调整了一些代码,我最后只是更改了我的表单发布到的脚本,包含一个简单的echo "test";.即使提交到这个简单的页面也会引发403错误.我搞砸了我的表格,我最终发现,如果我减少了数据量,我发布的表单提交得很好(特别是我减少了textarea中的文本数量).
检查完日志后(是的,这不是我做的第一件事 - 感叹)我注意到我从ModSecurity那里收到了很多错误,例如:
[Mon Aug 12 16:34:45 2013] [error] [client XX.XXX.XXX.XXX] ModSecurity: Failed to access DBM file "/etc/httpd/logs//global": Permission denied [hostname "XXXXXXX.XXX"] [uri "/admin/index.php"] [unique_id "UgkAlW1shFcAAHTMK80AAAAF"]
[Mon Aug 12 16:34:45 2013] [error] [client XX.XXX.XXX.XXX] ModSecurity: Failed to access DBM file "/etc/httpd/logs//ip": Permission denied [hostname "XXXXXXX.XXX"] [uri "/admin/index.php"] [unique_id "UgkAlW1shFcAAHTMK80AAAAF"]
[Mon Aug 12 17:11:33 2013] [error] [client XX.XXX.XXX.XXX] ModSecurity: Rule execution error - PCRE limits exceeded (-8): (null). [hostname "XXXXXXX.XXX"] [uri "/admin/index.php"] [unique_id "UgkJNW1shFcAAHXUMHkAAAAH"]
[Mon Aug …Run Code Online (Sandbox Code Playgroud) 我正在对使用django和活塞上传文件的休息服务进行POST请求,但是当我执行请求时,我得到这个(奇怪的?)错误:
[Sun Jul 04 16:12:38 2010] [error] [client 79.39.191.166] ModSecurity: Output filter: Failed to read bucket (rc 104): Connection reset by peer [hostname "url"] [uri "/api/odl/"] [unique_id "TDEVZEPNBIMAAGLwU9AAAAAG"]
Run Code Online (Sandbox Code Playgroud)
这是什么意思?我该如何调试呢?
我用WAF安装nginx(使用Docker)
mkdir -p /usr/src \
&& cd /usr/src/ \
&& git clone --depth 1 -b v3/master --single-branch https://github.com/SpiderLabs/ModSecurity \
&& cd ModSecurity \
&& git submodule init \
&& git submodule update \
&& ./build.sh \
&& ./configure \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install
... previous commands to install nginx from source...
&& cd /usr/src \
&& git clone --depth 1 https://github.com/SpiderLabs/ModSecurity-nginx.git \
&& cd /usr/src/nginx-$NGINX_VERSION \
&& ./configure --with-compat --add-dynamic-module=../ModSecurity-nginx \
&& make modules \
&& …Run Code Online (Sandbox Code Playgroud) 我在http://mlecturedownload.com/test-qt.php上设置了测试页面,其中包含以下代码:
<?php
$foo = $_GET['foo'];
if ($foo == "0" || $foo == "1") {
echo $foo;
} else {
echo "Invalid foo";
}
Run Code Online (Sandbox Code Playgroud)
在Web浏览器中转到此页面并修改foo的值可以正常工作,并且使用curl也可以正常工作.但是当我从Qt发送请求时,我得到一个HTTP 406错误代码,这意味着"不可接受".以下是我提出请求的方式:
void MainWindow::on_send_clicked()
{
QString url = "http://mlecturedownload.com/test-qt.php?foo=1";
QNetworkRequest request;
request.setUrl(QUrl(url));
nam->get(request); // nam is a QNetworkAccessManager
}
Run Code Online (Sandbox Code Playgroud)
这是从Wireshark获得的整个HTTP请求和响应
GET /test-qt.php?foo=1 HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
Accept-Language: en-CA,*
User-Agent: Mozilla/5.0
Host: mlecturedownload.com
HTTP/1.1 406 Not Acceptable
Date: Sat, 19 Jan 2013 17:14:37 GMT
Server: Apache
Content-Length: 275
Keep-Alive: timeout=5, max=75
Connection: Keep-Alive
Content-Type: …Run Code Online (Sandbox Code Playgroud) 美好的一天,
我在Tomcat前面运行Apache2服务器,我需要在Apache2层上实现DDOS保护机制.我有两个候选人:mod_evasive和mod_security2以及OWASP核心规则集.
已经安装了Mod_security用于整体保护,但问题是:除了mod_security之外是否值得为DDOS添加mod_evasive(它有任何主要优点)还是/ experimental_rules /目录中的OWASP crs规则(modsecurity_crs_11_dos_protection.conf)提供了同样的保护?或者这只是一个偏好问题?这些网站的流量通常不是很高.
马丁
我正在尝试使用 Ubuntu 18.04 在 Google Cloud 上下载 ModSecurity,但是每当我尝试编写sudo nano *file*.conf或nano *file*.conf. 我收到一条错误消息,说-bash: nano: command not found或sudo: nano: command not found。我不确定是不是因为我为此使用了 Google Cloud Platform,但我只需要知道如何解决这个问题