From ddd0101b09621bfd6e3381735dfa9a4abcd96953 Mon Sep 17 00:00:00 2001
From: Aleff
@@ -233,7 +233,7 @@
## Step : 4 Run hackingtool
- sudo bash install.sh
+ sudo python install.py
## Step : 5 For installing tools in directory
diff --git a/README_template.md b/README_template.md
index ea2f0e62..58f2fff0 100644
--- a/README_template.md
+++ b/README_template.md
@@ -23,11 +23,11 @@
# Hackingtool Menu 🧰
-
-
-
-
-
+
+
+
+
+
## Installation guide for Linux
@@ -41,7 +41,7 @@
sudo pip3 install -r requirements.txt
- bash install.sh
+ python install.py
sudo hackingtool
diff --git a/core.py b/core.py
index 49156602..9fb68eec 100644
--- a/core.py
+++ b/core.py
@@ -1,11 +1,21 @@
+from rich.console import Console
+from rich.panel import Panel
+from rich.table import Table
+from rich import box
+from rich.traceback import install
+from rich.theme import Theme
+
import os
import sys
import webbrowser
from platform import system
from traceback import print_exc
-from typing import Callable
-from typing import List
-from typing import Tuple
+from typing import Callable, List, Tuple
+
+# Enable rich tracebacks
+install()
+_theme = Theme({"purple": "#7B61FF"})
+console = Console(theme=_theme)
def clear_screen():
@@ -24,57 +34,57 @@ def validate_input(ip, val_range):
class HackingTool(object):
- # About the HackingTool
- TITLE: str = "" # used to show info in the menu
+ TITLE: str = ""
DESCRIPTION: str = ""
-
INSTALL_COMMANDS: List[str] = []
INSTALLATION_DIR: str = ""
-
UNINSTALL_COMMANDS: List[str] = []
-
RUN_COMMANDS: List[str] = []
-
OPTIONS: List[Tuple[str, Callable]] = []
-
PROJECT_URL: str = ""
- def __init__(self, options = None, installable: bool = True,
- runnable: bool = True):
+ def __init__(self, options=None, installable=True, runnable=True):
options = options or []
if isinstance(options, list):
self.OPTIONS = []
if installable:
- self.OPTIONS.append(('Install', self.install))
+ self.OPTIONS.append(("Install", self.install))
if runnable:
- self.OPTIONS.append(('Run', self.run))
+ self.OPTIONS.append(("Run", self.run))
self.OPTIONS.extend(options)
else:
- raise Exception(
- "options must be a list of (option_name, option_fn) tuples")
+ raise Exception("options must be a list of (option_name, option_fn) tuples")
def show_info(self):
- desc = self.DESCRIPTION
+ desc = f"[cyan]{self.DESCRIPTION}[/cyan]"
if self.PROJECT_URL:
- desc += '\n\t[*] '
- desc += self.PROJECT_URL
- os.system(f'echo "{desc}"|boxes -d boy | lolcat')
+ desc += f"\n[green]🔗 {self.PROJECT_URL}[/green]"
+ console.print(Panel(desc, title=f"[bold purple]{self.TITLE}[/bold purple]", border_style="purple", box=box.DOUBLE))
- def show_options(self, parent = None):
+ def show_options(self, parent=None):
clear_screen()
self.show_info()
+
+ table = Table(title="Options", box=box.SIMPLE_HEAVY)
+ table.add_column("No.", style="bold cyan", justify="center")
+ table.add_column("Action", style="bold yellow")
+
for index, option in enumerate(self.OPTIONS):
- print(f"[{index + 1}] {option[0]}")
+ table.add_row(str(index + 1), option[0])
+
if self.PROJECT_URL:
- print(f"[{98}] Open project page")
- print(f"[{99}] Back to {parent.TITLE if parent is not None else 'Exit'}")
- option_index = input("Select an option : ").strip()
+ table.add_row("98", "Open Project Page")
+ table.add_row("99", f"Back to {parent.TITLE if parent else 'Exit'}")
+
+ console.print(table)
+
+ option_index = input("\n[?] Select an option: ").strip()
try:
option_index = int(option_index)
if option_index - 1 in range(len(self.OPTIONS)):
ret_code = self.OPTIONS[option_index - 1][1]()
if ret_code != 99:
- input("\n\nPress ENTER to continue:").strip()
+ input("\nPress [Enter] to continue...")
elif option_index == 98:
self.show_project_page()
elif option_index == 99:
@@ -82,95 +92,101 @@ def show_options(self, parent = None):
sys.exit()
return 99
except (TypeError, ValueError):
- print("Please enter a valid option")
- input("\n\nPress ENTER to continue:").strip()
+ console.print("[red]⚠ Please enter a valid option.[/red]")
+ input("\nPress [Enter] to continue...")
except Exception:
- print_exc()
- input("\n\nPress ENTER to continue:").strip()
- return self.show_options(parent = parent)
+ console.print_exception(show_locals=True)
+ input("\nPress [Enter] to continue...")
+ return self.show_options(parent=parent)
- def before_install(self):
- pass
+ def before_install(self): pass
def install(self):
self.before_install()
if isinstance(self.INSTALL_COMMANDS, (list, tuple)):
for INSTALL_COMMAND in self.INSTALL_COMMANDS:
+ console.print(f"[yellow]→ {INSTALL_COMMAND}[/yellow]")
os.system(INSTALL_COMMAND)
self.after_install()
def after_install(self):
- print("Successfully installed!")
+ console.print("[green]✔ Successfully installed![/green]")
def before_uninstall(self) -> bool:
- """ Ask for confirmation from the user and return """
return True
def uninstall(self):
if self.before_uninstall():
if isinstance(self.UNINSTALL_COMMANDS, (list, tuple)):
for UNINSTALL_COMMAND in self.UNINSTALL_COMMANDS:
+ console.print(f"[red]→ {UNINSTALL_COMMAND}[/red]")
os.system(UNINSTALL_COMMAND)
self.after_uninstall()
- def after_uninstall(self):
- pass
+ def after_uninstall(self): pass
- def before_run(self):
- pass
+ def before_run(self): pass
def run(self):
self.before_run()
if isinstance(self.RUN_COMMANDS, (list, tuple)):
for RUN_COMMAND in self.RUN_COMMANDS:
+ console.print(f"[cyan]⚙ Running:[/cyan] [bold]{RUN_COMMAND}[/bold]")
os.system(RUN_COMMAND)
self.after_run()
- def after_run(self):
- pass
+ def after_run(self): pass
- def is_installed(self, dir_to_check = None):
- print("Unimplemented: DO NOT USE")
+ def is_installed(self, dir_to_check=None):
+ console.print("[yellow]⚠ Unimplemented: DO NOT USE[/yellow]")
return "?"
def show_project_page(self):
+ console.print(f"[blue]🌐 Opening project page: {self.PROJECT_URL}[/blue]")
webbrowser.open_new_tab(self.PROJECT_URL)
class HackingToolsCollection(object):
- TITLE: str = "" # used to show info in the menu
+ TITLE: str = ""
DESCRIPTION: str = ""
- TOOLS = [] # type: List[Any[HackingTool, HackingToolsCollection]]
+ TOOLS: List = []
def __init__(self):
pass
def show_info(self):
- os.system("figlet -f standard -c {} | lolcat".format(self.TITLE))
- # os.system(f'echo "{self.DESCRIPTION}"|boxes -d boy | lolcat')
- # print(self.DESCRIPTION)
+ console.rule(f"[bold purple]{self.TITLE}[/bold purple]", style="purple")
+ console.print(f"[italic cyan]{self.DESCRIPTION}[/italic cyan]\n")
- def show_options(self, parent = None):
+ def show_options(self, parent=None):
clear_screen()
self.show_info()
+
+ table = Table(title="Available Tools", box=box.MINIMAL_DOUBLE_HEAD)
+ table.add_column("No.", justify="center", style="bold cyan")
+ table.add_column("Tool Name", style="bold yellow")
+
for index, tool in enumerate(self.TOOLS):
- print(f"[{index} {tool.TITLE}")
- print(f"[{99}] Back to {parent.TITLE if parent is not None else 'Exit'}")
- tool_index = input("Choose a tool to proceed: ").strip()
+ table.add_row(str(index), tool.TITLE)
+
+ table.add_row("99", f"Back to {parent.TITLE if parent else 'Exit'}")
+ console.print(table)
+
+ tool_index = input("\n[?] Choose a tool: ").strip()
try:
tool_index = int(tool_index)
if tool_index in range(len(self.TOOLS)):
- ret_code = self.TOOLS[tool_index].show_options(parent = self)
+ ret_code = self.TOOLS[tool_index].show_options(parent=self)
if ret_code != 99:
- input("\n\nPress ENTER to continue:").strip()
+ input("\nPress [Enter] to continue...")
elif tool_index == 99:
if parent is None:
sys.exit()
return 99
except (TypeError, ValueError):
- print("Please enter a valid option")
- input("\n\nPress ENTER to continue:").strip()
+ console.print("[red]⚠ Please enter a valid option.[/red]")
+ input("\nPress [Enter] to continue...")
except Exception:
- print_exc()
- input("\n\nPress ENTER to continue:").strip()
- return self.show_options(parent = parent)
+ console.print_exception(show_locals=True)
+ input("\nPress [Enter] to continue...")
+ return self.show_options(parent=parent)
diff --git a/generate_readme.py b/generate_readme.py
index 069b015d..fa3cba5d 100644
--- a/generate_readme.py
+++ b/generate_readme.py
@@ -1,9 +1,16 @@
+# coding=utf-8
import re
+from rich.console import Console
+from rich.theme import Theme
+
from core import HackingTool
from core import HackingToolsCollection
from hackingtool import all_tools
+_theme = Theme({"purple": "#7B61FF"})
+console = Console(theme=_theme)
+
def sanitize_anchor(s):
return re.sub(r"\W", "-", s.lower())
@@ -48,4 +55,4 @@ def generate_readme():
if __name__ == '__main__':
- generate_readme()
+ generate_readme()
\ No newline at end of file
diff --git a/hackingtool.py b/hackingtool.py
index 1e433e89..9db5a938 100755
--- a/hackingtool.py
+++ b/hackingtool.py
@@ -1,11 +1,22 @@
#!/usr/bin/env python3
-# Version 1.1.0
+# Version 1.1.0 (rich UI - purple theme)
import os
import sys
import webbrowser
from platform import system
from time import sleep
+from rich.console import Console
+from rich.panel import Panel
+from rich.table import Table
+from rich.prompt import Prompt, IntPrompt, Confirm
+from rich.align import Align
+from rich.text import Text
+from rich import box
+from rich.columns import Columns
+from rich.rule import Rule
+from rich.padding import Padding
+
from core import HackingToolsCollection
from tools.anonsurf import AnonSurfTools
from tools.ddos import DDOSTools
@@ -26,7 +37,9 @@
from tools.wordlist_generator import WordlistGeneratorTools
from tools.xss_attack import XSSAttackTools
-logo = """\033[33m
+console = Console()
+
+ASCII_LOGO = r"""
▄█ █▄ ▄████████ ▄████████ ▄█ ▄█▄ ▄█ ███▄▄▄▄ ▄██████▄ ███ ▄██████▄ ▄██████▄ ▄█
███ ███ ███ ███ ███ ███ ███ ▄███▀ ███ ███▀▀▀██▄ ███ ███ ▀█████████▄ ███ ███ ███ ███ ███
███ ███ ███ ███ ███ █▀ ███▐██▀ ███▌ ███ ███ ███ █▀ ▀███▀▀██ ███ ███ ███ ███ ███
@@ -35,11 +48,29 @@
███ ███ ███ ███ ███ █▄ ███▐██▄ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███
███ ███ ███ ███ ███ ███ ███ ▀███▄ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███▌ ▄
███ █▀ ███ █▀ ████████▀ ███ ▀█▀ █▀ ▀█ █▀ ████████▀ ▄████▀ ▀██████▀ ▀██████▀ █████▄▄██
- ▀ ▀
- \033[34m[✔] https://github.com/Z4nzu/hackingtool [✔]
- \033[34m[✔] Version 1.1.0 [✔]
- \033[91m[X] Please Don't Use For illegal Activity [X]
-\033[97m """
+ ▀ ▀
+"""
+
+tool_definitions = [
+ ("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", "💥"),
+ ("Steganograhy tools", "🖼️"),
+ ("Other tools", "✨"),
+ ("Update or Uninstall | Hackingtool", "♻️"),
+]
all_tools = [
AnonSurfTools(),
@@ -68,55 +99,129 @@ class AllTools(HackingToolsCollection):
TOOLS = all_tools
def show_info(self):
- print(logo + '\033[0m \033[97m')
+ header = Text()
+ header.append(ASCII_LOGO, style="bold magenta")
+ header.append("\n\n",)
+ footer = Text.assemble(
+ (" https://github.com/Z4nzu/hackingtool ", "bold bright_black"),
+ (" | ",),
+ ("Version 1.1.0", "bold green"),
+ )
+ warning = Text(" Please Don't Use For illegal Activity ", style="bold red")
+ panel = Panel(
+ Align.center(header + Text("\n") + footer + Text("\n") + warning),
+ box=box.DOUBLE,
+ padding=(1, 2),
+ border_style="magenta"
+ )
+ console.print(panel)
-if __name__ == "__main__":
- try:
- if system() == 'Linux':
- fpath = os.path.expanduser("~/hackingtoolpath.txt")
- if not os.path.exists(fpath):
- os.system('clear')
- # run.menu()
- print("""
- [@] Set Path (All your tools will be installed in that directory)
- [1] Manual
- [2] Default
- """)
- choice = input("Z4nzu =>> ").strip()
-
- if choice == "1":
- inpath = input("Enter Path (with Directory Name) >> ").strip()
- with open(fpath, "w") as f:
- f.write(inpath)
- print("Successfully Set Path to: {}".format(inpath))
- elif choice == "2":
- autopath = "/home/hackingtool/"
- with open(fpath, "w") as f:
- f.write(autopath)
- print("Your Default Path Is: {}".format(autopath))
- sleep(3)
- else:
- print("Try Again..!!")
- sys.exit(0)
+def build_menu():
+ table = Table.grid(expand=True)
+ table.add_column("idx", width=6, justify="right")
+ table.add_column("name", justify="left")
+ for idx, (title, icon) in enumerate(tool_definitions):
+ if idx == 17:
+ label = "[bold magenta]99[/bold magenta]"
+ name = f"[bold magenta]{icon} {title}[/bold magenta]"
+ else:
+ label = f"[bold magenta]{idx}[/bold magenta]"
+ name = f"[white]{icon}[/white] [magenta]{title}[/magenta]"
+ table.add_row(label, name)
+
+ top_panel = Panel(
+ Align.center(Text("HackingTool — Main Menu", style="bold white on magenta"), vertical="middle"),
+ style="magenta",
+ padding=(0, 1),
+ box=box.ROUNDED
+ )
+ menu_panel = Panel.fit(
+ table,
+ title="[bold magenta]Select a tool[/bold magenta]",
+ border_style="bright_magenta",
+ box=box.SQUARE
+ )
+ footer = Align.center(Text("Choose number and press Enter — 99 to exit", style="italic bright_black"))
+ console.print(top_panel)
+ console.print(menu_panel)
+ console.print(Rule(style="bright_black"))
+ console.print(footer)
+ console.print("")
+
+
+def choose_path():
+ fpath = os.path.expanduser("~/hackingtoolpath.txt")
+ if not os.path.exists(fpath):
+ os.system("clear" if system() == "Linux" else "cls")
+ build_menu()
+ console.print(Panel("Setup path for tool installations", border_style="magenta"))
+ choice = Prompt.ask("[magenta]Set Path[/magenta]", choices=["1", "2"], default="2")
+ if choice == "1":
+ inpath = Prompt.ask("[magenta]Enter Path (with Directory Name)[/magenta]")
+ with open(fpath, "w") as f:
+ f.write(inpath)
+ console.print(f"[green]Successfully Set Path to:[/green] {inpath}")
+ else:
+ autopath = "/home/hackingtool/"
+ with open(fpath, "w") as f:
+ f.write(autopath)
+ console.print(f"[green]Your Default Path Is:[/green] {autopath}")
+ sleep(1)
+ return fpath
+
+
+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]
+ console.print(Panel(f"[bold magenta]{tool_definitions[choice][1]} Selected:[/bold magenta] [white]{name}"))
+ try:
+ fn = getattr(tool, "show_options", None)
+ if callable(fn):
+ fn()
+ else:
+ console.print(f"[yellow]Tool '{name}' has no interactive menu (show_options).[/yellow]")
+ 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:
+ console.print("\n[bold red]Interrupted by user — exiting[/bold red]")
+ break
+
+def main():
+ try:
+ if system() == "Linux":
+ fpath = choose_path()
with open(fpath) as f:
- archive = f.readline()
+ archive = f.readline().strip()
os.makedirs(archive, exist_ok=True)
os.chdir(archive)
- AllTools().show_options()
-
- # If not Linux and probably Windows
+ AllTools().show_info()
+ interact_menu()
elif system() == "Windows":
- print(
- r"\033[91m Please Run This Tool On A Debian System For Best Results\e[00m"
- )
+ console.print(Panel("[bold red]Please run this tool on a Debian/Linux system for best results[/bold red]"))
+ if Confirm.ask("Open guidance link in your browser?", default=True):
+ webbrowser.open_new_tab("https://tinyurl.com/y522modc")
sleep(2)
- webbrowser.open_new_tab("https://tinyurl.com/y522modc")
-
else:
- print("Please Check Your System or Open New Issue ...")
-
+ console.print("[yellow]Please Check Your System or Open New Issue ...[/yellow]")
except KeyboardInterrupt:
- print("\nExiting ..!!!")
- sleep(2)
+ console.print("\n[bold red]Exiting ..!!![/bold red]")
+ sleep(1)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/images/A.png b/images/A.png
new file mode 100644
index 0000000000000000000000000000000000000000..80d43f8bc75f0e70f0019f04588d81cb7e7886b9
GIT binary patch
literal 195851
zcmZs?2UL?w)HaHufb>vBng#(us&oi&)I^jjC6ovvE%X|CRca`LsFYAO^eRXv6zK?|
z3rOz?MQZ4wT+aFKIp2T(bthR1)+FytX3uW(>}MihYO2ss-k~HRA)$Hk9IQh^LjIP7
zgcL(@{i;X)5$&I=KX)yj>u8XW`0|mEybUEGIlbz7yGlahAx1*7{^sgi$s{DKE@}1J
zpsNqa%+*xDB$t1`zBJ~2y6Pc!f1v>(U!$a mq>5@BDZ+oUu IpyOHq#4&5zUzU|#qzNjdVwAHVOkcVmv=jYOjdzp%7z6e~
9EeeCDmpYD4U)2rBNS8o)js(3!ISOQ?V^&g>x
zgBE{oekPy$
U1?`pLJW<8S2~^`(p)
zn%2`N{0etCWr-5U@W0!RztnzDjS2Z1dOk1DXIvg4SdZ2_?hKdfJN5ecd|mQ(q7k*Q
zl~hd
2eI?m37K;-MmOZcxXr~0g{rWAb=a(H$gU`sA`X^n)-6?L_rIw7)t;hW5l?y+%)dv8y^DMFWq
zF|;ZkLN^PC->6_sOh-GCk8eD))+uBIEfxeOmUg5_WLff`QqVExx82D;%>?xs__%W|
ztO1t&Gjk52iKpy_`dIGZ|Gy~(^z;7hJN}CWg6e6pwhbLroucoNXQps|WvGiV-N6N2
zmvR!_!l?>~sQS(rl>P?3f(I5A`|;wR|A=a