Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Z4nzu
GitHub Repository: Z4nzu/hackingtool
Path: blob/master/tools/other_tools.py
1753 views
1
# coding=utf-8
2
import os
3
import subprocess
4
5
from core import HackingTool
6
from core import HackingToolsCollection
7
from tools.others.android_attack import AndroidAttackTools
8
from tools.others.email_verifier import EmailVerifyTools
9
from tools.others.hash_crack import HashCrackingTools
10
from tools.others.homograph_attacks import IDNHomographAttackTools
11
from tools.others.mix_tools import MixTools
12
from tools.others.payload_injection import PayloadInjectorTools
13
from tools.others.socialmedia import SocialMediaBruteforceTools
14
from tools.others.socialmedia_finder import SocialMediaFinderTools
15
from tools.others.web_crawling import WebCrawlingTools
16
from tools.others.wifi_jamming import WifiJammingTools
17
18
from rich.console import Console
19
from rich.theme import Theme
20
from rich.table import Table
21
from rich.panel import Panel
22
from rich.prompt import Prompt
23
24
_theme = Theme({"purple": "#7B61FF"})
25
console = Console(theme=_theme)
26
27
28
class HatCloud(HackingTool):
29
TITLE = "HatCloud(Bypass CloudFlare for IP)"
30
DESCRIPTION = "HatCloud build in Ruby. It makes bypass in CloudFlare for " \
31
"discover real IP."
32
INSTALL_COMMANDS = ["git clone https://github.com/HatBashBR/HatCloud.git"]
33
PROJECT_URL = "https://github.com/HatBashBR/HatCloud"
34
35
def run(self):
36
site = input("Enter Site >> ")
37
os.chdir("HatCloud")
38
subprocess.run(["sudo", "ruby", "hatcloud.rb", "-b", site])
39
40
41
class OtherTools(HackingToolsCollection):
42
TITLE = "Other tools"
43
TOOLS = [
44
SocialMediaBruteforceTools(),
45
AndroidAttackTools(),
46
HatCloud(),
47
IDNHomographAttackTools(),
48
EmailVerifyTools(),
49
HashCrackingTools(),
50
WifiJammingTools(),
51
SocialMediaFinderTools(),
52
PayloadInjectorTools(),
53
WebCrawlingTools(),
54
MixTools()
55
]
56
57
def _get_attr(self, obj, *names, default=""):
58
for n in names:
59
if hasattr(obj, n):
60
return getattr(obj, n)
61
return default
62
63
def pretty_print(self):
64
table = Table(title="Other Tools", show_lines=True, expand=True)
65
table.add_column("Title", style="purple", no_wrap=True)
66
table.add_column("Description", style="purple")
67
table.add_column("Project URL", style="purple", no_wrap=True)
68
69
for t in self.TOOLS:
70
title = self._get_attr(t, "TITLE", "Title", "title", default=t.__class__.__name__)
71
desc = self._get_attr(t, "DESCRIPTION", "Description", "description", default="")
72
url = self._get_attr(t, "PROJECT_URL", "PROJECT_URL", "PROJECT", "project_url", "projectUrl", default="")
73
table.add_row(str(title), str(desc).strip().replace("\n", " "), str(url))
74
75
panel = Panel(table, title="[purple]Available Tools[/purple]", border_style="purple")
76
console.print(panel)
77
78
def show_options(self, parent=None):
79
console.print("\n")
80
panel = Panel.fit("[bold magenta]Other Tools Collection[/bold magenta]\n"
81
"Select a tool to view options or run it.",
82
border_style="purple")
83
console.print(panel)
84
85
table = Table(title="[bold cyan]Available Tools[/bold cyan]", show_lines=True, expand=True)
86
table.add_column("Index", justify="center", style="bold yellow")
87
table.add_column("Tool Name", justify="left", style="bold green")
88
table.add_column("Description", justify="left", style="white")
89
90
for i, tool in enumerate(self.TOOLS):
91
title = self._get_attr(tool, "TITLE", "Title", "title", default=tool.__class__.__name__)
92
desc = self._get_attr(tool, "DESCRIPTION", "Description", "description", default="—")
93
table.add_row(str(i + 1), title, desc or "—")
94
95
table.add_row("[red]99[/red]", "[bold red]Exit[/bold red]", "Return to previous menu")
96
console.print(table)
97
98
try:
99
choice = Prompt.ask("[bold cyan]Select a tool to run[/bold cyan]", default="99")
100
choice = int(choice)
101
if 1 <= choice <= len(self.TOOLS):
102
selected = self.TOOLS[choice - 1]
103
# If tool exposes show_options (collection-style), delegate to it
104
if hasattr(selected, "show_options"):
105
selected.show_options(parent=self)
106
# Otherwise, if runnable, call its run method
107
elif hasattr(selected, "run"):
108
selected.run()
109
else:
110
console.print("[bold yellow]Selected tool has no runnable interface.[/bold yellow]")
111
elif choice == 99:
112
return 99
113
except Exception:
114
console.print("[bold red]Invalid choice. Try again.[/bold red]")
115
return self.show_options(parent=parent)
116
117
118
if __name__ == "__main__":
119
tools = OtherTools()
120
tools.pretty_print()
121
tools.show_options()
122
123