(self, options: str)
| 78 | @throw CommandException if the pre-condition is not met. |
| 79 | """ |
| 80 | def __exploit(self, options: str): |
| 81 | if self.exploit_status() == True: |
| 82 | raise CommandException("Already exploited target.") |
| 83 | for var in self.variables: |
| 84 | if (self.variables[var]["required"] and |
| 85 | len(self.variables[var]["value"]) == 0): |
| 86 | raise CommandException(f"{var} not set.") |
| 87 | print((f"Attempting to exploit " |
| 88 | f"{self.variables['TARGET_HOST']['value']} " |
| 89 | f"at {self.variables['TARGET_PATH']['value']}")) |
| 90 | |
| 91 | for exploitClass in self.exploitClasses: |
| 92 | if (self.variables['TARGET_TYPE']['value'].upper() |
| 93 | == exploitClass.get_name().upper()): |
| 94 | self.exploit = (exploitClass( |
| 95 | self.variables['TARGET_HOST']['value'], |
| 96 | self.variables['TARGET_PATH']['value'], |
| 97 | self.variables['METHOD']['value'], |
| 98 | self.variables['HEADER']['value'])) |
| 99 | return |
| 100 | raise CommandException("TARGET_TYPE is not supported.") |
| 101 | |
| 102 | """ |
| 103 | @brief Command to set and display exploit variables. |
nothing calls this directly
no test coverage detected