批量处理网站文件挂马方法与程序
批量处理网站文件挂马方法与程序
很多网站因为种路原因被挂上了木马,我们来讲讲几种比较快的去除网页木马的方法吧,
第一种:用dw直接连接到服务器上查找-替换就OK了.
第二种:在线替换就是把下面的代码保存成一个asp文件,执行就OK了.
<%
Server.ScriptTimeout="600"
call getfile(server.mappath(".\"))
sub getfile(c_path)
set file_system=createobject("scripting.filesystemobject")
set cur_folder=file_system.getfolder(c_path)
set sub_folders=cur_folder.subfolders
for each each_sub_folder in sub_folders
set sub_files=each_sub_folder.files
for each each_file in sub_files
if(lcase(right(each_file.name,3)="asp") then
ReadFile(each_sub_folder&"\"&each_file.name) '取文件名
end if
response.write("已处理 "&each_sub_folder&"\"&each_file.name&"<br>")
response.flush()
next
sub_folder_name=each_sub_folder.name '目录名
sub_folder_path=c_path&"\"&each_sub_folder.name
call getfile(sub_folder_path)
next
end sub
Function ReadFile(filespec)
response.write(filespec)
response.flush()
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(filespec,1)
ReadAllTextFile = f.ReadAll
Set file1 = fs.CreateTextFile(filespec, True)
content = replace(ReadAllTextFile,"<iframe src=""http://226500.cn"" width=0 height=0></iframe>","")
file1.WriteLine content
file1.Close
Set fs = nothing
End Function
%>
补充:asp教程,安全加密