Files
hackingtool/tools/post_exploitation.py
Modark 7df27d8383
Some checks failed
lint_python / lint_python (push) Has been cancelled
test_install / test_install (17 0 1 99 99 99) (push) Has been cancelled
test_install / test_install (17 0 2 99 99 99) (push) Has been cancelled
test_install / test_install (17 1 1 ) (push) Has been cancelled
test_install / test_install (99) (push) Has been cancelled
Feat/rich UI menu lovely (#567)
2025-10-14 11:32:18 +05:30

123 lines
5.0 KiB
Python

# coding=utf-8
import os
from core import HackingTool
from core import HackingToolsCollection
from rich.console import Console
from rich.theme import Theme
from rich.table import Table
from rich.panel import Panel
from rich.prompt import Prompt
_theme = Theme({"purple": "#7B61FF"})
console = Console(theme=_theme)
class Vegile(HackingTool):
TITLE = "Vegile - Ghost In The Shell"
DESCRIPTION = "This tool will set up your backdoor/rootkits when " \
"backdoor is already setup it will be \n" \
"hidden your specific process,unlimited your session in " \
"metasploit and transparent."
INSTALL_COMMANDS = [
"sudo git clone https://github.com/Screetsec/Vegile.git",
"cd Vegile && sudo chmod +x Vegile"
]
RUN_COMMANDS = ["cd Vegile && sudo bash Vegile"]
PROJECT_URL = "https://github.com/Screetsec/Vegile"
def before_run(self):
os.system('echo "You can Use Command: \n'
'[!] Vegile -i / --inject [backdoor/rootkit] \n'
'[!] Vegile -u / --unlimited [backdoor/rootkit] \n'
'[!] Vegile -h / --help"|boxes -d parchment')
class ChromeKeyLogger(HackingTool):
TITLE = "Chrome Keylogger"
DESCRIPTION = "Hera Chrome Keylogger"
INSTALL_COMMANDS = [
"sudo git clone https://github.com/UndeadSec/HeraKeylogger.git",
"cd HeraKeylogger && sudo apt-get install python3-pip -y && sudo pip3 install -r requirements.txt"
]
RUN_COMMANDS = ["cd HeraKeylogger && sudo python3 hera.py"]
PROJECT_URL = "https://github.com/UndeadSec/HeraKeylogger"
class PostExploitationTools(HackingToolsCollection):
TITLE = "Post exploitation tools"
TOOLS = [
Vegile(),
ChromeKeyLogger()
]
def _get_attr(self, obj, *names, default=""):
for n in names:
if hasattr(obj, n):
return getattr(obj, n)
return default
def pretty_print(self):
table = Table(title="Post-Exploitation Tools", show_lines=True, expand=True)
table.add_column("Title", style="purple", no_wrap=True)
table.add_column("Description", style="purple")
table.add_column("Project URL", style="purple", no_wrap=True)
for t in self.TOOLS:
title = self._get_attr(t, "TITLE", "Title", "title", default=t.__class__.__name__)
desc = self._get_attr(t, "DESCRIPTION", "Description", "description", default="").strip().replace("\n", " ")
url = self._get_attr(t, "PROJECT_URL", "PROJECT_URL", "PROJECT", "project_url", "projectUrl", default="")
table.add_row(str(title), str(desc or ""), str(url))
panel = Panel(table, title="[purple]Available Tools[/purple]", border_style="purple")
console.print(panel)
def show_options(self, parent=None):
console.print("\n")
panel = Panel.fit("[bold magenta]Post-Exploitation Tools Collection[/bold magenta]\n"
"Select a tool to view options or run it.",
border_style="purple")
console.print(panel)
table = Table(title="[bold cyan]Available Tools[/bold cyan]", show_lines=True, expand=True)
table.add_column("Index", justify="center", style="bold yellow")
table.add_column("Tool Name", justify="left", style="bold green")
table.add_column("Description", justify="left", style="white")
for i, tool in enumerate(self.TOOLS):
title = self._get_attr(tool, "TITLE", "Title", "title", default=tool.__class__.__name__)
desc = self._get_attr(tool, "DESCRIPTION", "Description", "description", default="")
table.add_row(str(i + 1), title, desc or "")
table.add_row("[red]99[/red]", "[bold red]Exit[/bold red]", "Return to previous menu")
console.print(table)
try:
choice = Prompt.ask("[bold cyan]Select a tool to run[/bold cyan]", default="99")
choice = int(choice)
if 1 <= choice <= len(self.TOOLS):
selected = self.TOOLS[choice - 1]
# Delegate to collection-style show_options if available
if hasattr(selected, "show_options"):
selected.show_options(parent=self)
# Otherwise call run if available
elif hasattr(selected, "run"):
selected.run()
# If tool exposes before_run (like Vegile), call it to preserve original behavior
elif hasattr(selected, "before_run"):
selected.before_run()
else:
console.print("[bold yellow]Selected tool has no runnable interface.[/bold yellow]")
elif choice == 99:
return 99
except Exception:
console.print("[bold red]Invalid choice. Try again.[/bold red]")
return self.show_options(parent=parent)
if __name__ == "__main__":
tools = PostExploitationTools()
tools.pretty_print()
tools.show_options()