tool exploit_frameworks.py NEW(design)

This commit is contained in:
Modark 2025-10-12 17:14:38 -04:00
parent c7cae3ba8b
commit a0abd38b0c

View file

@ -3,6 +3,14 @@ from core import HackingTool
from core import HackingToolsCollection
from tools.webattack import Web2Attack
from rich.console import Console
from rich.table import Table
from rich.panel import Panel
from rich.text import Text
console = Console()
PURPLE_STYLE = "bold magenta"
class RouterSploit(HackingTool):
TITLE = "RouterSploit"
@ -42,7 +50,7 @@ class Commix(HackingTool):
PROJECT_URL = "https://github.com/commixproject/commix"
def __init__(self):
super(Commix, self).__init__(runnable = False)
super(Commix, self).__init__(runnable=False)
class ExploitFrameworkTools(HackingToolsCollection):
@ -53,3 +61,25 @@ class ExploitFrameworkTools(HackingToolsCollection):
Commix(),
Web2Attack()
]
# --- Optional helper: pretty-print the tools list into a magenta-styled table.
# This function is non-invasive (does not change program logic) — call it from
# your UI code whenever you want a colored overview in terminal.
def render_tools_table(tools, title: str | None = None):
"""
Render a list of HackingTool instances (or objects with TITLE/DESCRIPTION/PROJECT_URL)
as a rich table in magenta style. This helper does not modify any tool logic.
"""
tbl = Table(title=title or "Tools", show_lines=False, header_style=PURPLE_STYLE)
tbl.add_column("Name", style=PURPLE_STYLE, no_wrap=True)
tbl.add_column("Description")
tbl.add_column("Project URL", overflow="fold")
for t in tools:
name = getattr(t, "TITLE", "<unknown>")
desc = getattr(t, "DESCRIPTION", "")
url = getattr(t, "PROJECT_URL", "")
tbl.add_row(name, desc, url)
console.print(Panel(tbl, border_style=PURPLE_STYLE, title=Text(title or "Toolset", style=PURPLE_STYLE)))