diff --git a/bbot/core/helpers/interactsh.py b/bbot/core/helpers/interactsh.py index 695fd6260..95f76d2f5 100644 --- a/bbot/core/helpers/interactsh.py +++ b/bbot/core/helpers/interactsh.py @@ -230,19 +230,22 @@ async def poll(self): if self.token: headers["Authorization"] = self.token - r = await self.parent_helper.request( - f"https://{self.server}/poll?id={self.correlation_id}&secret={self.secret}", headers=headers - ) - - ret = [] - data_list = r.json().get("data", None) - if data_list: - aes_key = r.json()["aes_key"] + try: + r = await self.parent_helper.request( + f"https://{self.server}/poll?id={self.correlation_id}&secret={self.secret}", headers=headers + ) - for data in data_list: - decrypted_data = self._decrypt(aes_key, data) - ret.append(decrypted_data) - return ret + ret = [] + data_list = r.json().get("data", None) + if data_list: + aes_key = r.json()["aes_key"] + + for data in data_list: + decrypted_data = self._decrypt(aes_key, data) + ret.append(decrypted_data) + return ret + except Exception as e: + raise InteractshError(f"Error polling interact.sh: {e}") async def poll_loop(self, callback): """