Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Z4nzu
GitHub Repository: Z4nzu/hackingtool
Path: blob/master/tools/anonsurf.py
1767 views
1
# coding=utf-8
2
import os
3
4
from rich.console import Console
5
from rich.panel import Panel
6
from rich.prompt import Prompt
7
from rich.text import Text
8
from rich.table import Table
9
10
from core import HackingTool
11
from core import HackingToolsCollection
12
13
console = Console()
14
P_COLOR = "magenta"
15
16
17
class AnonymouslySurf(HackingTool):
18
TITLE = "Anonymously Surf"
19
DESCRIPTION = (
20
"It automatically overwrites the RAM when\n"
21
"the system is shutting down and also change Ip."
22
)
23
INSTALL_COMMANDS = [
24
"sudo git clone https://github.com/Und3rf10w/kali-anonsurf.git",
25
"cd kali-anonsurf && sudo ./installer.sh && cd .. && sudo rm -r kali-anonsurf",
26
]
27
RUN_COMMANDS = ["sudo anonsurf start"]
28
PROJECT_URL = "https://github.com/Und3rf10w/kali-anonsurf"
29
30
def __init__(self):
31
super(AnonymouslySurf, self).__init__([("Stop", self.stop)])
32
33
def stop(self):
34
console.print(Panel(Text(self.TITLE, justify="center"), style=f"bold {P_COLOR}"))
35
console.print("Stopping Anonsurf...", style=f"bold {P_COLOR}")
36
os.system("sudo anonsurf stop")
37
38
39
class Multitor(HackingTool):
40
TITLE = "Multitor"
41
DESCRIPTION = "How to stay in multi places at the same time"
42
INSTALL_COMMANDS = [
43
"sudo git clone https://github.com/trimstray/multitor.git",
44
"cd multitor;sudo bash setup.sh install",
45
]
46
RUN_COMMANDS = [
47
"multitor --init 2 --user debian-tor --socks-port 9000 --control-port 9900 --proxy privoxy --haproxy"
48
]
49
PROJECT_URL = "https://github.com/trimstray/multitor"
50
51
def __init__(self):
52
# keep original behavior (non-runnable) while still initializing
53
super(Multitor, self).__init__(runnable=False)
54
55
56
class AnonSurfTools(HackingToolsCollection):
57
TITLE = "Anonymously Hiding Tools"
58
DESCRIPTION = ""
59
TOOLS = [
60
AnonymouslySurf(),
61
Multitor(),
62
]
63
64
def _get_attr(self, obj, *names, default=""):
65
for n in names:
66
if hasattr(obj, n):
67
return getattr(obj, n)
68
return default
69
70
def pretty_print(self):
71
table = Table(title="Anonymously Hiding Tools", show_lines=True, expand=True)
72
table.add_column("Title", style="magenta", no_wrap=True)
73
table.add_column("Description", style="magenta")
74
table.add_column("Project URL", style="magenta", no_wrap=True)
75
76
for t in self.TOOLS:
77
title = self._get_attr(t, "TITLE", "Title", "title", default=t.__class__.__name__)
78
desc = self._get_attr(t, "DESCRIPTION", "Description", "description", default="")
79
url = self._get_attr(t, "PROJECT_URL", "PROJECT_URL", "PROJECT", "project_url", "projectUrl", default="")
80
table.add_row(str(title), str(desc).strip().replace("\n", " "), str(url))
81
82
panel = Panel(table, title=f"[{P_COLOR}]Available Tools[/ {P_COLOR}]", border_style=P_COLOR)
83
console.print(panel)
84
85
def show_options(self, parent=None):
86
console.print("\n")
87
console.print(Panel.fit(
88
"[bold magenta]Anonymously Hiding Tools Collection[/bold magenta]\n"
89
"Select a tool to view options or run it.",
90
border_style=P_COLOR
91
))
92
93
table = Table(title="[bold cyan]Available Tools[/bold cyan]", show_lines=True, expand=True)
94
table.add_column("Index", justify="center", style="bold yellow")
95
table.add_column("Tool Name", justify="left", style="bold green")
96
table.add_column("Description", justify="left", style="white")
97
98
for i, tool in enumerate(self.TOOLS):
99
title = self._get_attr(tool, "TITLE", "Title", "title", default=tool.__class__.__name__)
100
desc = self._get_attr(tool, "DESCRIPTION", "Description", "description", default="—")
101
table.add_row(str(i + 1), title, desc or "—")
102
103
table.add_row("[red]99[/red]", "[bold red]Exit[/bold red]", "Return to previous menu")
104
console.print(table)
105
106
try:
107
choice = Prompt.ask("[bold cyan]Select a tool to run[/bold cyan]", default="99")
108
choice = int(choice)
109
if 1 <= choice <= len(self.TOOLS):
110
selected = self.TOOLS[choice - 1]
111
# delegate if collection-style interface exists
112
if hasattr(selected, "show_options"):
113
selected.show_options(parent=self)
114
# otherwise, if the tool has actions or a run method, prefer those
115
elif hasattr(selected, "run"):
116
selected.run()
117
else:
118
console.print("[bold yellow]Selected tool has no runnable interface.[/bold yellow]")
119
elif choice == 99:
120
return 99
121
except Exception:
122
console.print("[bold red]Invalid choice. Try again.[/bold red]")
123
return self.show_options(parent=parent)
124
125
126
if __name__ == "__main__":
127
tools = AnonSurfTools()
128
tools.pretty_print()
129
tools.show_options()
130
131