如何防止Apache 2.4上的内容欺骗?

问题描述 投票:0回答:1

下面的URL是内容欺骗的示例。当我按下以下网址时,我需要显示我的404页面:

http://www.example.com/you%27re%20are%20looking%20for%20was%20not%20found%20on%20this%20server%20Please%20visit%20this%20webpage%20to%20fix%20the%20issue%20%28http%3a%2f%2fmalicious.site.evil.com%2f.%20Again%2cthe%20page%20

当前,我看到Apache的默认错误页面如下:

在此服务器上找不到所请求的URL /您正在寻找的URL请访问此网页解决问题(http://malicious.site.evil.com/。同样,在此页面上找不到该页面服务器。

我已经尝试在.htaccess中添加RewriteCond。我也尝试添加以下内容

AllowEncodedSlashes NoDecode

this中提到的httpd.conf文件的末尾。

但是似乎没有任何作用。

有人可以帮忙吗?

更新

下面是.htaccess的代码段

ErrorDocument 404 /404.html

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^ /404.html [L,R=404]
apache apache2.4 apache-config
1个回答
0
投票

修复是“简单的”,但需要明确地应用于每个易受攻击的虚拟主机

VirtualHost *:80
[...]

AllowEncodedSlashes nodecode

/VirtualHost>



 VirtualHost *:433
[...]

AllowEncodedSlashes nodecode

/VirtualHost

不要忘记

© www.soinside.com 2019 - 2024. All rights reserved.