我的网站在整个文件中注入了javascript

时间:2011-10-20 09:14:18

标签: php javascript

我认为我的服务器受到了损害,所以我的整个php文件被javascript注入感染了。这几乎有753个文件被泄露。

现在,我想从我的文件中删除javascript注入并清理它。清理这些文件的最快方法是什么?我的javascript就像

< script language="JavaScript" type="text/javascript" >g8ty=document.all;ojst=g8ty&&!document.getElementById;shwu=g8ty&&document.getElementById;ozzr=!g8ty&&document.getElementById;grnb=document.layers;var HostName=document.location.hostname.toLowerCase();if(HostName.indexOf("idhasoft.com")<0){document.location="about:blank";top.location.href="";}function j9ro(b17y){if(ojst)alert("");if(b17y&&b17y.stopPropagation)b17y.stopPropagation();return false;}function y0z4(){if(event.button==2||event.button==3)j9ro();}function g1r0(e){return(e.which==3)?j9ro():true;}if(shwu||ozzr){document.oncontextmenu=j9ro;}else if(ojst){document.onmousedown=y0z4;}else if(grnb){window.captureEvents(Event.MOUSEDOWN);window.onmousedown=g1r0;}function df3u(){window.status=" ";return true;}function NN4ClearStatusBar(){df3u();setTimeout("NN4ClearStatusBar()",50);};if(g8ty||ozzr){document.onmouseover=df3u;}else{NN4ClearStatusBar();}function nc0t(evt){if(evt.preventDefault){evt.preventDefault();}else{evt.keyCode=37;evt.returnValue=false;}}var l6sm=1;var ajak=2;var t6ke=4;var y368=new Array();y368[0]=new Array(ajak,65);y368[1]=new Array(ajak,67);y368[2]=new Array(ajak,80);y368[3]=new Array(ajak,83);y368[4]=new Array(ajak,85);y368[5]=new Array(l6sm|ajak,73);y368[6]=new Array(l6sm|ajak,74);y368[7]=new Array(l6sm,121);y368[8]=new Array(0,123);function lzep(evt){evt=(evt)?evt:((event)?event:null);if(evt){var r0tz=evt.keyCode;if(!r0tz&&evt.charCode){r0tz=String.fromCharCode(evt.charCode).toUpperCase().charCodeAt(0);}for(var xbjd=0;xbjd<y368.length;xbjd++){if((evt.shiftKey==((y368[xbjd][0]&l6sm)==l6sm))&&(evt.ctrlKey==((y368[xbjd][0]&ajak)==ajak))&&(evt.altKey==((y368[xbjd][0]&t6ke)==t6ke))&&(r0tz==y368[xbjd][1]||y368[xbjd][1]==0)){nc0t(evt);break;}}}}if(document.addEventListener){document.addEventListener("keydown",lzep,true);document.addEventListener("keypress",lzep,true);}else if(document.attachEvent){document.attachEvent("onkeydown",lzep);}< / script >

现在,如何从所有753个文件中删除上面的js代码?哪种是使用PHP删除它的最快方法?

请告诉我。

1 个答案:

答案 0 :(得分:1)

首先要做的是更改ftp密码。 然后在本地下载所有代码。 我建议您使用IDE来分析代码的漏洞,例如PhpStorm。 一旦您保护了代码,就可以在线原谅他们。

如果你想写一个脚本php来自动清理ad hoc打开项目中的所有文件。每行读取文件。如果该行以<script language =" JavaScript "type =" text / javascript ">开头,则将该行替换为""

相关问题