(self, message: str)
| 36 | @brief See base class for details. |
| 37 | """ |
| 38 | def _Base__send_message(self, message: str): |
| 39 | url = f"{self.host}{self.path}" |
| 40 | if not self.host.startswith("http"): |
| 41 | url = "http://" + url |
| 42 | try: |
| 43 | response = requests.request( |
| 44 | self.method, |
| 45 | url, |
| 46 | headers={ f"{self.header}": message } |
| 47 | ) |
| 48 | if not response.ok: |
| 49 | raise Exception() |
| 50 | if not self.header in response.headers: |
| 51 | raise CommandException( |
| 52 | f"No message sent back from server, your exploit is " |
| 53 | f"probably being filtered by a firewall.") |
| 54 | return response.headers[self.header] |
| 55 | except: |
| 56 | raise CommandException(f"Message was not successfully processed.") |
| 57 | |
| 58 | """ |
| 59 | @brief Run a command on the target machine, and return its output as a |
no test coverage detected