Articles of mod security

mod_security 960015阻止Google和其他好的机器人

mod_security规则960015不断捕捉谷歌和其他好的机器人。 我在vhost中有以下几个方面来防止被抓到的好机器人: SecRule REQUEST_HEADERS:User-Agent "Mail.ru" log,allow SecRule HTTP_USER_AGENT "Mail.RU_Bot" log,allow Google和Yandex也一样。 它工作99%的时间,但是在其他时间有一些真正的bizare原因失败,这里是Mail.ru bot的日志示例: 全成: 217.69.134.79 – – [07/Mar/2014:10:17:13 +0400] "GET / HTTP/1.1" 200 189934 "-" "Mozilla/5.0 (compatible; Linux x86_64; Mail.RU_Bot/Fast/2.0; +http://go.mail.ru/help/robots)" [Fri Mar 07 10:17:13 2014] [error] [client 217.69.134.79] ModSecurity: Access allowed (phase 2). Pattern match "Mail" at REQUEST_HEADERS:User-Agent. [file "/etc/apache2/sites-enabled/xxx"] [line "28"] [hostname "xxx"] […]

mod_unique_id:尽pipe设置了etc / hosts和Apache ServerName,但无法findFQDN的IPv4地址

我试图得到mod_security,并击中了非常常见的主机名错误 [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "computername.domain.com" 这通常意味着在主机文件中需要一个条目。 不过,我已经尝试了主机名的所有组合; 本地主机(127.0.0.1),本地IP地址(192.168 ….)和公共IP地址(“122.56.11.156”)。 我也尝试了Apache的ServerName的所有组合; computer.domain,域名,IP地址,并没有设置它。 没有什么似乎为我工作。 目前我的/ etc / hosts文件看起来像: # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 computername.domain.com computername localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.0.102 computername.domain.com computername […]

只为一个网站启用Mod_Security

有没有一种方法可以禁用所有网站的安全模式? 除了一个? 我有超过500个网站托pipe,只想打开一个网站,这是有它的攻击。

ModSecurity阻止请求中的特定string

我想要一个ModSecurity规则,阻止访问任何URL或任何身体请求Post / Get,如果它包含一个特定的string。 例如,我想阻止这个string:“km0ae9gr6m” 我有这个规则,但它似乎没有工作。 SecRule ARGS "km0ae9gr6m" "log,deny,msg:'Access Denied'"

modsecurity:在一分钟内访问404个页面的IP地址超过10次

我们正在使用mod_security,目前我们有一些机器人的问题。 我想在一分钟内阻止访问404个页面的IP地址超过10次。 如何才能做到这一点? 我怎样才能轮询404返回码? 如何计算阶段3中的错误404返回码? RESPONSE_STATUS在embedded模式下可能无法按预期工作,因为Apache有时会以不同的方式处理某些请求,而不会调用ModSecurity(所有其他模块)。 我怎样才能得到RESPONSE_STATUS每一次肯定? 阶段5?

Joomla的mod_security规则集! pipe理

我运行了几个托pipe服务器,最近我经历了很多针对joomla的网站的暴力攻击。 攻击者似乎试图对administrator/index.php页面bruteforce。 当他们尝试使用以下规则集强制Wordpresslogin时,我通常会lockingIP: SecAction phase:1,nolog,pass,initcol:ip=%{REMOTE_ADDR},id:5000134 <Locationmatch "/wp-login.php"> SecRule ip:bf_block "@gt 0" "deny,status:401,log,id:5000135,msg:'ip address blocked for 5 minutes, more than 10 login attempts in 3 minutes.'" SecRule RESPONSE_STATUS "^302" "phase:5,t:none,nolog,pass,setvar:ip.bf_counter=0,id:5000136" SecRule RESPONSE_STATUS "^200" "phase:5,chain,t:none,nolog,pass,setvar:ip.bf_counter=+1,deprecatevar:ip.bf_counter=1/180,id:5000137" SecRule ip:bf_counter "@gt 10" "t:none,setvar:ip.bf_block=1,expirevar:ip.bf_block=300,setvar:ip.bf_counter=0" </Locationmatch> 但是我找不到Joomla!的类似规则,因为响应状态是“303见其他”,有效的密码和无效的密码。 任何帮助? 提前致谢!

为什么mod_security需要一个ACCEPT HTTP头域?

经过一些debugging之后,我发现mod_security的核心规则集阻止了没有(可选的!)ACCEPT头域的请求。 这是我在日志中find的: ModSecurity:警告。 需要匹配“rx ^ OPTIONS $”和“REQUEST_METHOD”。 [file“/etc/apache2/conf.d/modsecurity/modsecurity_crs_21_protocol_anomalies.conf”] [line“41”] [id“960015”] [msg“Request Missing Accept Header”] [severity“CRITICAL”] [tag“ PROTOCOL_VIOLATION / MISSING_HEADER“] [主机名”example.com“] [uri”/“] [unique_id”T4F5 @ H8AAQEAAFU6aPEAAAAL“] ModSecurity:访问被代码400拒绝(阶段2)。 需要匹配“rx ^ OPTIONS $”和“REQUEST_METHOD”。 [file“/etc/apache2/conf.d/modsecurity/optional_rules/modsecurity_crs_21_protocol_anomalies.conf”] [line“41”] [id“960015”] [msg“Request Missing Accept Header”] [severity“CRITICAL”] [标签“PROTOCOL_VIOLATION / MISSING_HEADER”] [主机名“example.com”] [uri“/”] [unique_id“T4F5 @ H8AAQEAAFU6aPEAAAAL”] 为什么这个标题是必需的? 我知道“大多数”客户发送这些信息,但为什么他们的缺席被视为安全威胁?

阻止AWS ELB后面的stream量

我的Web服务器在ELB后面,我想阻止来自某个DDOS攻击的特定用户代理的stream量。 Apache总是看到ELB的IP地址作为最终用户,所以我尝试了下面的尝试: 阻止在ELB级别的IP地址是不可能的,因为它有20个IP地址的限制和IP地址在每次攻击时改变。 阻止访问使用重写条件,这个工程,但如果很多命中来,然后服务器负载超过100,所有的Apache线程忙于服务吨的403,所以网站出现合法的请求。 RewriteCond %{HTTP_USER_AGENT} ^SomeThing RewriteRule ^(.*)$ – [F] 用mod_sec块做同样的事情的服务403创造相同的效果上面#2。 使用iptables阻止数据包string模块:阻止具有特定用户代理的数据包。 在这种情况下,iptables发送DROP / REJECT给攻击者,apache没有得到连接现在已经死了的信号,并等待超时导致所有的apache线程超时使用,所以这个方法在这里没有用处。 iptables -I INPUT -i eth0 -p tcp –dport 80 -m string –algo bm –string 'user-agent: SomeThing' -j REJECT 我可以使用iptables的方式,它会从第一个包含user-agent: SomeThing数据包获取IP地址,并阻止所有下一个具有X-Forwarded-For: someIP数据包,时间为4-5小时。 我不想永远阻止IP地址阻塞,因为这些IP地址可以分配给一些合法的用户,并将被阻止。 或者还有其他更好的办法来处理这个攻击吗?

如何找出mod_security是否安装在我的apache服务器上?

我怎么才能找出mod_security是否安装在我的apache服务器上? 我也想学习它的版本。 我有一些上传问题,我试图使用.htaccess禁用mod_security。 但是,这开始产生500内部服务器错误。 我读的地方,取决于我的mod_security版本,我可能无法使用.htaccess禁用它。 所以我想明白,如果我已经安装了mod_security,它是什么版本。 我在一个centos 5盒子上。 谢谢! 更新-1 xxxxxxxxxxxxx 下面的输出是否意味着我没有安装mod_security? [root@u11 htdocs]# httpd -l Compiled in modules: core.c prefork.c http_core.c mod_so.c

modsecurity apache mod-security.conf丢失

问候Serverfaultians。 我不是一个服务器的人,你可以从我的noob得分1分看到。 但也许那些更精通可以帮助我。 我正在使用Ubuntu v13.10 32位服务器和Apache2 v2.4.6,我试图在互联网上的生产/testing服务器上设置和configurationmodsecurity和modevasive 。 我试图按照这个教程: http : //www.thefanclub.co.za/how-to/how-install-apache2-modsecurity-and-modevasive-ubuntu-1204-lts-server 。 但在步骤3: 现在将这些规则添加到Apache2。 打开terminal窗口并input: sudo vi /etc/apache2/mods-available/mod-security.conf 这个文件不存在。 有什么build议么?