hackingtool/hackingtool.py

212 lines
9.2 KiB
Python
Raw Normal View History

2023-03-04 15:02:23 +00:00
#!/usr/bin/env python3
import sys
2026-03-15 08:24:30 +00:00
# ── Python version guard (must be before any other local import) ───────────────
if sys.version_info < (3, 10):
print(
f"[ERROR] Python 3.10 or newer is required.\n"
f"You are running Python {sys.version_info.major}.{sys.version_info.minor}.\n"
f"Upgrade with: sudo apt install python3.10"
)
sys.exit(1)
import os
2020-06-27 06:05:51 +00:00
import webbrowser
from platform import system
2020-07-18 18:28:01 +00:00
2025-10-14 06:02:18 +00:00
from rich.console import Console
from rich.panel import Panel
from rich.table import Table
2026-03-15 08:24:30 +00:00
from rich.prompt import IntPrompt, Confirm
2025-10-14 06:02:18 +00:00
from rich.align import Align
from rich.text import Text
from rich import box
from rich.rule import Rule
from core import HackingToolsCollection
2026-03-15 08:24:30 +00:00
from constants import VERSION_DISPLAY, REPO_WEB_URL
from config import get_tools_dir
from tools.anonsurf import AnonSurfTools
from tools.ddos import DDOSTools
from tools.exploit_frameworks import ExploitFrameworkTools
from tools.forensic_tools import ForensicTools
from tools.information_gathering_tools import InformationGatheringTools
from tools.other_tools import OtherTools
from tools.payload_creator import PayloadCreatorTools
from tools.phising_attack import PhishingAttackTools
from tools.post_exploitation import PostExploitationTools
from tools.remote_administration import RemoteAdministrationTools
from tools.reverse_engineering import ReverseEngineeringTools
from tools.sql_tools import SqlInjectionTools
from tools.steganography import SteganographyTools
from tools.tool_manager import ToolManager
from tools.webattack import WebAttackTools
from tools.wireless_attack_tools import WirelessAttackTools
from tools.wordlist_generator import WordlistGeneratorTools
from tools.xss_attack import XSSAttackTools
2020-07-18 18:28:01 +00:00
2025-10-14 06:02:18 +00:00
console = Console()
ASCII_LOGO = r"""
2026-03-15 08:24:30 +00:00
2025-10-14 06:02:18 +00:00
"""
tool_definitions = [
2026-03-15 08:24:30 +00:00
("Anonymously Hiding Tools", "🛡️"),
("Information gathering tools", "🔍"),
("Wordlist Generator", "📚"),
("Wireless attack tools", "📶"),
("SQL Injection Tools", "🧩"),
("Phishing attack tools", "🎣"),
("Web Attack tools", "🌐"),
("Post exploitation tools", "🔧"),
("Forensic tools", "🕵️"),
("Payload creation tools", "📦"),
("Exploit framework", "🧰"),
("Reverse engineering tools", "🔁"),
("DDOS Attack Tools", ""),
("Remote Administrator Tools (RAT)", "🖥️"),
("XSS Attack Tools", "💥"),
("Steganography tools", "🖼️"),
("Other tools", ""),
("Update or Uninstall | Hackingtool", "♻️"),
2025-10-14 06:02:18 +00:00
]
2020-07-18 18:28:01 +00:00
all_tools = [
AnonSurfTools(),
InformationGatheringTools(),
WordlistGeneratorTools(),
WirelessAttackTools(),
SqlInjectionTools(),
PhishingAttackTools(),
WebAttackTools(),
PostExploitationTools(),
ForensicTools(),
PayloadCreatorTools(),
ExploitFrameworkTools(),
ReverseEngineeringTools(),
DDOSTools(),
RemoteAdministrationTools(),
XSSAttackTools(),
SteganographyTools(),
OtherTools(),
2026-03-15 08:24:30 +00:00
ToolManager(),
]
class AllTools(HackingToolsCollection):
TITLE = "All tools"
TOOLS = all_tools
def show_info(self):
2026-03-15 08:24:30 +00:00
header = Text(ASCII_LOGO, style="bold magenta")
2025-10-14 06:02:18 +00:00
footer = Text.assemble(
2026-03-15 08:24:30 +00:00
(f" {REPO_WEB_URL} ", "bold bright_black"),
2025-10-14 06:02:18 +00:00
(" | ",),
2026-03-15 08:24:30 +00:00
(VERSION_DISPLAY, "bold green"),
2025-10-14 06:02:18 +00:00
)
2026-03-15 08:24:30 +00:00
warning = Text(" Please Don't Use For Illegal Activity ", style="bold red")
2025-10-14 06:02:18 +00:00
panel = Panel(
Align.center(header + Text("\n") + footer + Text("\n") + warning),
box=box.DOUBLE,
padding=(1, 2),
2026-03-15 08:24:30 +00:00
border_style="magenta",
2025-10-14 06:02:18 +00:00
)
console.print(panel)
2020-07-18 18:28:01 +00:00
2020-06-27 06:05:51 +00:00
2025-10-14 06:02:18 +00:00
def build_menu():
table = Table.grid(expand=True)
table.add_column("idx", width=6, justify="right")
table.add_column("name", justify="left")
2025-10-14 06:02:18 +00:00
for idx, (title, icon) in enumerate(tool_definitions):
2026-03-15 08:24:30 +00:00
if idx == len(tool_definitions) - 1:
2025-10-14 06:02:18 +00:00
label = "[bold magenta]99[/bold magenta]"
2026-03-15 08:24:30 +00:00
name = f"[bold magenta]{icon} {title}[/bold magenta]"
2025-10-14 06:02:18 +00:00
else:
label = f"[bold magenta]{idx}[/bold magenta]"
2026-03-15 08:24:30 +00:00
name = f"[white]{icon}[/white] [magenta]{title}[/magenta]"
2025-10-14 06:02:18 +00:00
table.add_row(label, name)
2026-03-15 08:24:30 +00:00
console.print(Panel(
2025-10-14 06:02:18 +00:00
Align.center(Text("HackingTool — Main Menu", style="bold white on magenta"), vertical="middle"),
2026-03-15 08:24:30 +00:00
style="magenta", padding=(0, 1), box=box.ROUNDED,
))
console.print(Panel.fit(
2025-10-14 06:02:18 +00:00
table,
title="[bold magenta]Select a tool[/bold magenta]",
border_style="bright_magenta",
2026-03-15 08:24:30 +00:00
box=box.SQUARE,
))
2025-10-14 06:02:18 +00:00
console.print(Rule(style="bright_black"))
2026-03-15 08:24:30 +00:00
console.print(Align.center(Text(
"Choose number and press Enter — 99 to exit",
style="italic bright_black",
)))
2025-10-14 06:02:18 +00:00
console.print("")
def interact_menu():
while True:
try:
build_menu()
choice = IntPrompt.ask("[magenta]Choose a tool to proceed[/magenta]", default=0)
if choice == 99:
console.print(Panel("[bold white on magenta]Goodbye — Come Back Safely[/bold white on magenta]"))
break
if 0 <= choice < len(all_tools):
tool = all_tools[choice]
name = tool_definitions[choice][0]
2026-03-15 08:24:30 +00:00
console.print(Panel(
f"[bold magenta]{tool_definitions[choice][1]} Selected:[/bold magenta] [white]{name}[/white]"
))
2025-10-14 06:02:18 +00:00
try:
2026-03-15 08:24:30 +00:00
tool.show_options()
2025-10-14 06:02:18 +00:00
except Exception as e:
console.print(Panel(f"[red]Error while opening {name}[/red]\n{e}", border_style="red"))
if not Confirm.ask("[magenta]Return to main menu?[/magenta]", default=True):
console.print(Panel("[bold white on magenta]Exiting...[/bold white on magenta]"))
break
else:
console.print("[red]Invalid selection. Pick a number from the menu.[/red]")
except KeyboardInterrupt:
2026-03-15 08:24:30 +00:00
console.print("\n[bold red]Interrupted — exiting[/bold red]")
2025-10-14 06:02:18 +00:00
break
2026-03-15 08:24:30 +00:00
2025-10-14 06:02:18 +00:00
def main():
try:
2026-03-15 08:24:30 +00:00
from os_detect import CURRENT_OS
if CURRENT_OS.system == "windows":
console.print(Panel("[bold red]Please run this tool on Linux or macOS.[/bold red]"))
2025-10-14 06:02:18 +00:00
if Confirm.ask("Open guidance link in your browser?", default=True):
2026-03-15 08:24:30 +00:00
webbrowser.open_new_tab(f"{REPO_WEB_URL}#windows")
return
if CURRENT_OS.system not in ("linux", "macos"):
console.print(f"[yellow]Unsupported OS: {CURRENT_OS.system}. Proceeding anyway...[/yellow]")
# Ensure ~/.hackingtool/tools/ exists — no os.chdir(), tools use absolute paths
tools_dir = get_tools_dir()
console.print(f"[dim]Tools directory: {tools_dir}[/dim]")
AllTools().show_info()
interact_menu()
except KeyboardInterrupt:
2026-03-15 08:24:30 +00:00
console.print("\n[bold red]Exiting...[/bold red]")
2025-10-14 06:02:18 +00:00
if __name__ == "__main__":
main()