病毒/恶意软件修改 Joomla CMS 网站上的 .htaccess [英] Virus/malware modifying .htaccess on Joomla CMS website

查看:21
本文介绍了病毒/恶意软件修改 Joomla CMS 网站上的 .htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在共享主机上运行的 Joomla 1.0 网站,但我没有 shell 访问权限(只有 FTP 可用).最近我的网站被谷歌标记为恶意网站,我通知 .htaccess 文件被恶意内容修改.这些重定向到名为depositpeter.ru"的网站的规则被添加到 .htaccess 中:

I have a Joomla 1.0 website running on a shared host which I don't have shell access (only FTP available). Recently my website has been marked as malware site by Google and I notify that the .htaccess file is modified with malicious contents. These redirections rule to a website called 'depositpeter.ru' are added to the .htaccess:

ErrorDocument 400 http://depositpeter.ru/mnp/index.php
错误文档 401 http://depositpeter.ru/mnp/index.php...

ErrorDocument 400 http://depositpeter.ru/mnp/index.php
ErrorDocument 401 http://depositpeter.ru/mnp/index.php ...

如果我清理了这个 .htaccess 文件,几分钟后它就会被恶意内容修改回来.

If I clean this .htaccess file, it will be modified back with malicious contents a few minutes later.

我怀疑有一些后门 PHP 和 javascript 已被注入到我们的代码库中,它们不断修改 .htaccess 文件.但是,我不知道这些恶意软件最初是如何登陆我的网站的.我很确定没有 FTP 用户将它们上传到我的网站.病毒扫描发现有一个用户上传的图像被注入了 PHP.ShellExec 恶意软件(我不确定这个 PHP.ShellExec 是如何工作的,但它是否与 .htaccess 病毒有关).

I suspect there are some backdoor PHP and javascript has been injected to our codebase which constantly modifies the .htaccess file. However I have no idea how these malware landed on my site in the first place. I'm pretty sure that no FTP users have uploaded those to my site. A virus scan found that there is a user-uploaded image being injected with PHP.ShellExec malware (I'm not sure how this PHP.ShellExec work and if it is related to the .htaccess virus though).

我的问题是我应该如何开始对该恶意软件进行故障排除和清理?我非常无能为力,并且几乎没有处理网络恶意软件的经验.非常感谢任何帮助!

My question is how should I start troubleshooting and cleaning this malware? I'm pretty clueless and have little experience dealing with web malware. Any help is greatly appreciate!

推荐答案

您可能无法自行解决此问题.但这里有一些你应该做的事情.

It might be beyond your power to fix this yourself. But here are some things that you should do.

  • 下载您拥有的任何 apache/php 日志 - 这些可以指向正在被利用的安全漏洞.如果您能找到条目,请确保将孔洞盖住.
  • 删除被指示为受感染的图像.
  • 联系您的主机 - 一些主机公司提供了自动解决方案来查找和清理常见漏洞.此外,如果您的站点被感染,很有可能同一服务器上的其他客户端也被感染.
    • 相反,可能是同一服务器上的另一个客户端导致您出现此问题.

    在上传目录中添加一个 .htaccess 文件,该文件将阻止访问上传图像以外的任何内容.它可能看起来像这样:

    Add an .htaccess file in the uploads directory that would prevent access to anything other than uploaded images. It might look something like this:

    订单拒绝,允许
    拒绝所有人
    <FilesMatch ".(jpe?g|bmp|png)$">
    允许所有
    </FilesMatch>

    如果您的主机没有阻止允许 php 调用系统命令的功能(您会感到惊讶)并且您知道该怎么做,您可以使用 system 使用自定义 php 脚本模拟 shell 访问execpopen 等一些函数.我使用自己制作的脚本:https://github.com/DCoderLT/Misc_Tools/blob/master/sh/sh.php .它相当原始,但在我需要的时候完成了工作.

    If your host hasn't blocked functions that allow php to invoke system commands (you'd be surprised) and you know what to do, you can mimic shell access with a custom php script using system, exec, popen and some other functions. I use a script I made myself: https://github.com/DCoderLT/Misc_Tools/blob/master/sh/sh.php . It's fairly primitive, but got the job done when I needed it to.

    未来考虑:

    • 做好备份.您的托管公司可能会在某个时间段内提供这些信息.
    • 密切关注更新.订阅 Joomla 公告邮件列表.尽快应用这些更新.Joomla 和 WordPress 等流行应用程序经常成为脚本小子和自动化机器人的目标.
    • 进行备份.
    • 确保您的托管公司已正确设置服务器,以便用户 A 无法影响用户 B 的文件(文件权限、suexec 或类似权限).我不知道这些天这有多普遍,但过去它经常被忽视.
    • 进行备份.
    • 不要对不需要的文件和文件夹启用写入权限.
    • 进行备份.

    这篇关于病毒/恶意软件修改 Joomla CMS 网站上的 .htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆