Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
kazet committed Mar 6, 2024
1 parent ab1072a commit 4331fbe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions karton_wpscan/karton_wpscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
from extra_modules_config import ExtraModulesConfig


class ScanningException(Exception):
pass


class WPScan(ArtemisBase): # type: ignore
"""
Runs WPScan -> WordPress Vulnerability Scanner
Expand Down Expand Up @@ -58,13 +62,14 @@ def run(self, current_task: Task) -> None:
capture_output=True,
)

# Parse the JSON data
try:
result = json.loads(data.stdout.decode("utf-8"))
except json.JSONDecodeError:
result = {"error": "Failed to decode JSON output from WPScan."}

# Check if the input string is empty
if result.get("scan_aborted", None):
raise ScanningException(result["scan_aborted"])

if not result:
result = {"error": "No JSON output from WPScan."}

Expand Down

0 comments on commit 4331fbe

Please sign in to comment.