| 17 | Inherits from the CommandProcessor class. |
| 18 | """ |
| 19 | class LocalCommandProcessor(CommandProcessor): |
| 20 | def __init__(self): |
| 21 | self.exploitClasses = [ASPClassicExploitProcessor, |
| 22 | FlaskExploitProcessor, |
| 23 | NodeExploitProcessor, |
| 24 | PHPExploitProcessor] |
| 25 | self.exploit: ExploitProcessor = None |
| 26 | |
| 27 | super().__init__() |
| 28 | self.commands["exploit"] = { |
| 29 | "method": self.__exploit, |
| 30 | "description": ("Start the exploit, " |
| 31 | "given the preconditions are met."), |
| 32 | "usage": "exploit" |
| 33 | } |
| 34 | |
| 35 | self.commands["set"] = { |
| 36 | "method": self.__set, |
| 37 | "description": "Set or display exploit variables.", |
| 38 | "usage": ("set variable [value]\n" |
| 39 | " variable: variable to set.\n" |
| 40 | " value: value to set variable to.") |
| 41 | } |
| 42 | |
| 43 | self.commands["loadext"] = { |
| 44 | "method": self.__loadext, |
| 45 | "description": "Load an extension.", |
| 46 | "usage": ("loadext path\n" |
| 47 | " path: path to the extension.") |
| 48 | } |
| 49 | |
| 50 | self.commands["botnet"] = { |
| 51 | "method": self.__botnet, |
| 52 | "description": "Switch to botnet mode.", |
| 53 | "usage": "botnet" |
| 54 | } |
| 55 | |
| 56 | # exploit variables |
| 57 | self.variables = { |
| 58 | "TARGET_HOST": {"value": "localhost:8000", "required": True}, |
| 59 | "TARGET_PATH": {"value": "/", "required": True}, |
| 60 | "TARGET_TYPE": {"value": "PHP", "required": True}, |
| 61 | "METHOD": {"value": "GET", "required": True}, |
| 62 | "HEADER": {"value": "EXPLOIT", "required": True} |
| 63 | } |
| 64 | |
| 65 | """ |
| 66 | @brief See base class for details. |
| 67 | """ |
| 68 | def _Base__get_prefix(self): |
| 69 | if self.exploit: |
| 70 | return self.exploit._Base__get_prefix() |
| 71 | return super()._Base__get_prefix() |
| 72 | |
| 73 | """ |
| 74 | @brief exploit the target machine. |
| 75 | @param options Not used. |
| 76 | @pre the TARGET_TYPE is a valid target type. |