Add roadmap API and mock dashboard

This commit is contained in:
2025-11-13 15:05:34 -05:00
parent e21301cffb
commit 4455640afa
29 changed files with 3717 additions and 1 deletions

34
sqlmap_runner.py Normal file
View File

@@ -0,0 +1,34 @@
"""Wrapper for sqlmap tasks."""
from __future__ import annotations
from typing import Any, Dict, List
from runner_utils import run_subprocess
def build_command(task: Dict[str, Any]) -> List[str]:
if not task.get("target_url"):
raise ValueError("target_url is required")
command = ["sqlmap", "-u", task["target_url"], "--batch"]
options = task.get("options", {})
for key, value in options.items():
flag = f"--{key.replace('_', '-')}"
if isinstance(value, bool):
if value:
command.append(flag)
else:
command.extend([flag, str(value)])
return command
def run_task(task: Dict[str, Any]) -> Dict[str, Any]:
try:
command = build_command(task)
except ValueError as exc:
return {"status": "error", "exit_code": None, "error": str(exc)}
return run_subprocess(command, "sqlmap")
if __name__ == "__main__":
example = {"target_url": "http://example.com/vuln.php?id=1", "options": {"level": 2}}
print(run_task(example))