最近,我通过了一些错误日志来看看,因为我们最近有一些networking高峰。 然而,我从来没有使用modsecurity(我是一个程序员,因为我们没有一个真正的系统pipe理员),并出现了一些令人担忧的事情。 ModSecurity: Access denied with code 503 (phase 2). Pattern match –cut– [line "23"] [id "390144"] [rev "2"] [msg "Command shell attack: Generic Attempt to remote include command shell"] [severity "CRITICAL"] 关键词,命令shell和攻击可能不是什么好事。 我认为“远程包含命令shell”意味着一个黑客在未经授权的情况下试图拉起一个shell,但这更像是一个猜测而已。 有人能告诉我这里发生了什么,或者链接到我应该阅读的一些文档? 条目的频率是什么意思?
我正在运行Mod_Security,并使用SecServerSignature来自定义Apache返回的Server头。 这部分工作正常,但是我也运行mod_fcgid附加“mod_fcgid / 2.3.5”头。 有什么办法可以把这个关掉吗? ServerSignature off服务器ServerSignature off不起任何作用。 我能够通过更改ServerTokens来消除它,但删除了我添加的定制。
快速浏览我所做的事情: apt-get install libapache-mod-security a2enmod mod-security 使用最新的核心规则集创build/etc/apache2/mod_security_rules/ with base_rules和optional_rules 像下面那样创build/etc/apache2/conf.d/mod_security 创build/var/www/test.php如下 conf文件看起来像 <IfModule security2_module> Include /etc/apache2/mod_security_rules/*.conf Include /etc/apache2/mod_security_rules/base_rules/*.conf Include /etc/apache2/mod_security_rules/optional_rules/*.conf </IfModule> test.php看起来像 <?php $secret_file = $_GET['secret_file']; include ( $secret_file); ?> 这几个网站说mod_security应该阻止。 我的问题是,访问test.php?secret_file='whatever'显示我的文件。 这是正常的,是mod_security工作,否则,我需要改变什么?
service httpd restart Stopping httpd: [ OK ] Starting httpd: httpd: Syntax error on line 205 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_security2.so into server: /etc/httpd/modules/mod_security2.so: undefined symbol: ap_unixd_set_global_mutex_perms [FAILED] 我的httpd文件: LoadModule unique_id_module modules/mod_unique_id.so LoadFile /usr/lib/libxml2.so #LoadFile /usr/lib/liblua5.1.so LoadModule security2_module modules/mod_security2.so 有任何想法吗? 谷歌什么都没有。 我遵循这些指导原则: https : //github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#wiki-SVN_Access Apache是2.2.15 PHP是5.3.3 我通过yum安装了apache / php
服务器是在CentOS 5.9上通过cpanelconfiguration的标准LAMP堆栈。 我们有一个文件,称之为bad.php,在我们的一个域名上被服务提供商错误地每秒钟访问10次。 该文件不再存在,我们希望以最有效的方式阻止这些请求。 目前,我们正在返回410个响应,但仍然涉及捆绑Apache线程,发送头文件等。 理想情况下,我想放弃请求,不发送任何回应。 由IP阻止不是一种select,因为我们需要允许这些IP合法地访问其他文件。 (不,我们不能要求他们停止)。我们也没有外部防火墙可以使用(租用服务器,自定义外部防火墙的额外费用)。 我的想法是,最好的select是这样的iptables规则: iptables -I INPUT -p tcp –dport 80 –destination [ip address] -m string \ –algo kmp –string "bad\.php" -j DROP 两个问题: 首先,我尝试了这个规则(用域名的IP地址代替ip地址),但是没有任何效果。 这是iptables -L显示的第一条规则,所以不应该被以前的规则覆盖: Chain INPUT (policy ACCEPT) target prot opt source destination DROP tcp — anywhere [ip address] tcp dpt:http STRING match "bad\.php" ALGO name kmp […]
是否有明确的文件来描述解决scheme? 这是非常普遍的,也是必要的。
我最近在Liquidweb的网站上遇到了一个问题,他们的技术人员似乎甚至在几天之后都无法解决这个问题。 希望能在这里得到一些帮助。 偶尔,我的网站的HTTP不会回应 – 通常每天2-3次。 它根本不会加载。 所有用户将无法连接到该网站约5分钟。 Google Analytics(分析)的实时统计信息也显示,用户在线上网从网上的200多个下降到零。 Apache工作正常,没有根据日志重启或closures。 技术指出的Apache日志中存在的错误是: [error] [client 169.199.175.224] ModSecurity: Error reading request body: Connection reset by peer [error] [client 169.199.175.224] Handler for (null) returned invalid result code 70014 [error] [client 54.234.74.100] client sent invalid HTTP/0.9 request: HEAD HTTP/1.1 [Wed May 08 08:35:36 2013] [error] [client 173.218.197.87] Handler for (null) […]
我在我的apache的security.conf文件中有以下代码 <DirectoryMatch "/(albums|attachment(s)?|upload(s)?)"> Options -ExecCGI <IfModule php5_module> php_flag engine off </IfModule> </DirectoryMatch> 这是为了防止这些目录中的任何文件的PHP执行。 但是,如果我有这个代码,那么名为attachment.php的文件也不会执行PHP代码。 我可以修改正则expression式不包含attachment.php文件。 但是,问题是为什么上面的DirectoryMatch导致我的文件没有得到执行。 如path: 文档根目录:/ var / www / html 上传/附件目录: 在/ var / WWW /上传 在/ var / WWW /上传/附件 在/ var / WWW /上传/相册 在/ var / www / html等/附件 attachment.php文件:/var/www/html/attachment.php
从squeeze升级到wheezy后,当我在myserver上打开一个网页(在这里更改为myserver.de )时,会在我的apache错误日志中收到这些消息的负载: [Sat Oct 19 01:06:21 2013] [error] [client 213.239.220.106] ModSecurity: Warning. Match of "rx ^OPTIONS$" against "REQUEST_METHOD" required. [file "/etc/apache2/modsecurity2/modsecurity_crs_21_protocol_anomalies.conf"] [line "41"] [id "960015"] [msg "Request Missing an Accept Header"] [severity "CRITICAL"] [tag "PROTOCOL_VIOLATION/MISSING_HEADER"] [hostname "www.myserver.de"] [uri "/js/jquery-ui-1.8.14.custom_myserver/css/custom-theme/images/ui-icons_ff7519_256x240.png"] [unique_id "UmG@7X8AAQEAAHHDMOkAAAAB"] [Sat Oct 19 01:06:21 2013] [error] [client 213.239.220.106] ModSecurity: Warning. Match of "rx ^OPTIONS$" […]
我忘了更新我的nginx的fail2banconfiguration。 我刚刚从apache移到了nginx。 今天,我从一个单一的知识产权获得了很多的好处。 IP试图访问login页面后获取方法 IP试图使用nginx作为代理(GET http:/ …) IPsearch图像,js,css文件夹 IP试图注入-d url_allow_fopen = 1和类似的东西。 大部分通话以404结束。 http { limit_req_zone $binary_remote_addr zone=app:10m rate=5r/s; … server { … location / { limit_req zone=app burst=50; } 我从那个IP获得了大约50个请求。 所以我更新了我的nginx像上面一样。 现在每秒会避免太多的连接吗? 我已经更新了我的fail2ban jail.local以支持nginx。 我对nginx-noscript.conf感到困惑 [Definition] failregex = ^<HOST> -.*GET.*(\.php|\.asp|\.exe|\.pl|\.cgi|\scgi) ignoreregex = 我使用nginx服务php。 我查了一下apache的noscript.conf,其中也有.php扩展名。 在重新启动fail2ban之前,我testing了以上设置并获得了数千个ips匹配。 我删除了PHP和没有匹配。 我需要.php | 在nginx-noscript.conf? 一起使用mod_security和fail2ban会带来什么问题? 当我今天search时,我也知道mod_security也可用于nginx。 所以我也打算使用它。