我的一个客户抱怨一次袭击。我检查了访问日志,并从看似随机的IP地址中找到了大量的管理登录页面请求。我在.htacces目录中创建了一个/administrator文件,并使用以下内容填充它(IP地址被混淆):
order deny,allow
deny from all
allow from 96.xxx.xx.xxx #my IP address
allow from 97.xx.xxx.xxx #my client's IP address然后,我转到一个免费的代理服务器,输入管理页面的URL。该页面没有加载任何资产(图像),但它确实加载了实际页面本身。
乔姆拉!在.htaccess文件中执行DocumentRoot中的一些内容。看起来是这样的:
## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.我猜想管理员目录中的.htaccess文件不能正常工作的原因与主要的Joomla!.htaccess文件有关。这是真的吗?我尝试将它添加到我的主.htaccess文件中,但是它导致了500个错误:
<Directory /var/www/vhosts/sweathelp.org/httpdocs/administrator>
order deny,allow
deny from all
allow from 96.xxx.xx.xxx
allow from 97.xx.xxx.xxx
</Directory>如何有效地阻止对管理员目录的所有访问,不包括两个白色IP地址?
发布于 2013-08-27 22:53:25
实际的管理员页面(可能是PHP)是吗?存在于此,还是仅仅是由具有假目录结构的index.php生成的呢?
为了简化,可以这样做(在您的主配置文件中,而不是在.htaccess中):
<Location /administrator>
Order deny,allow
Deny from all
Allow from 96.xxx.xx.xxx
Allow from 97.xx.xxx.xxx
</Location>https://serverfault.com/questions/534249
复制相似问题