Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Z4nzu
GitHub Repository: Z4nzu/hackingtool
Path: blob/master/tools/information_gathering_tools.py
1769 views
1
# coding=utf-8
2
import os
3
import socket
4
import subprocess
5
import webbrowser
6
import sys
7
8
from core import HackingTool
9
from core import HackingToolsCollection
10
from core import clear_screen
11
12
from rich.console import Console
13
from rich.panel import Panel
14
from rich.text import Text
15
from rich.prompt import Prompt
16
from rich.table import Table
17
18
console = Console()
19
PURPLE_STYLE = "bold magenta"
20
21
22
class NMAP(HackingTool):
23
TITLE = "Network Map (nmap)"
24
DESCRIPTION = "Free and open source utility for network discovery and security auditing"
25
INSTALL_COMMANDS = [
26
"sudo git clone https://github.com/nmap/nmap.git",
27
"sudo chmod -R 755 nmap && cd nmap && sudo ./configure && make && sudo make install"
28
]
29
PROJECT_URL = "https://github.com/nmap/nmap"
30
31
def __init__(self):
32
super(NMAP, self).__init__(runnable=False)
33
34
35
class Dracnmap(HackingTool):
36
TITLE = "Dracnmap"
37
DESCRIPTION = "Dracnmap is an open source program which is using to \n" \
38
"exploit the network and gathering information with nmap help."
39
INSTALL_COMMANDS = [
40
"sudo git clone https://github.com/Screetsec/Dracnmap.git",
41
"cd Dracnmap && chmod +x dracnmap-v2.2-dracOs.sh dracnmap-v2.2.sh"
42
]
43
RUN_COMMANDS = ["cd Dracnmap;sudo ./dracnmap-v2.2.sh"]
44
PROJECT_URL = "https://github.com/Screetsec/Dracnmap"
45
46
47
class PortScan(HackingTool):
48
TITLE = "Port scanning"
49
50
def __init__(self):
51
super(PortScan, self).__init__(installable=False)
52
53
def run(self):
54
clear_screen()
55
console.print(Panel(Text(self.TITLE, justify="center"), style=PURPLE_STYLE))
56
target = Prompt.ask("[bold]Select a Target IP[/]", default="", show_default=False)
57
subprocess.run(["sudo", "nmap", "-O", "-Pn", target])
58
59
60
class Host2IP(HackingTool):
61
TITLE = "Host to IP "
62
63
def __init__(self):
64
super(Host2IP, self).__init__(installable=False)
65
66
def run(self):
67
clear_screen()
68
console.print(Panel(Text(self.TITLE, justify="center"), style=PURPLE_STYLE))
69
host = Prompt.ask("Enter host name (e.g. www.google.com):- ")
70
ips = socket.gethostbyname(host)
71
console.print(f"[{PURPLE_STYLE}]{host} -> {ips}[/]")
72
73
74
class XeroSploit(HackingTool):
75
TITLE = "Xerosploit"
76
DESCRIPTION = "Xerosploit is a penetration testing toolkit whose goal is to perform\n" \
77
"man-in-the-middle attacks for testing purposes"
78
INSTALL_COMMANDS = [
79
"git clone https://github.com/LionSec/xerosploit.git",
80
"cd xerosploit && sudo python install.py"
81
]
82
RUN_COMMANDS = ["sudo xerosploit"]
83
PROJECT_URL = "https://github.com/LionSec/xerosploit"
84
85
86
class RedHawk(HackingTool):
87
TITLE = "RED HAWK (All In One Scanning)"
88
DESCRIPTION = "All in one tool for Information Gathering and Vulnerability Scanning."
89
INSTALL_COMMANDS = [
90
"git clone https://github.com/Tuhinshubhra/RED_HAWK.git"]
91
RUN_COMMANDS = ["cd RED_HAWK;php rhawk.php"]
92
PROJECT_URL = "https://github.com/Tuhinshubhra/RED_HAWK"
93
94
95
class ReconSpider(HackingTool):
96
TITLE = "ReconSpider(For All Scanning)"
97
DESCRIPTION = "ReconSpider is most Advanced Open Source Intelligence (OSINT)" \
98
" Framework for scanning IP Address, Emails, \n" \
99
"Websites, Organizations and find out information from" \
100
" different sources.\n"
101
INSTALL_COMMANDS = [
102
"sudo git clone https://github.com/bhavsec/reconspider.git",
103
"sudo apt install python3 python3-pip && cd reconspider && sudo python3 setup.py install"
104
]
105
RUN_COMMANDS = ["cd reconspider;python3 reconspider.py"]
106
PROJECT_URL = "https://github.com/bhavsec/reconspider"
107
108
109
class IsItDown(HackingTool):
110
TITLE = "IsItDown (Check Website Down/Up)"
111
DESCRIPTION = "Check Website Is Online or Not"
112
113
def __init__(self):
114
super(IsItDown, self).__init__(
115
[('Open', self.open)], installable=False, runnable=False)
116
117
def open(self):
118
console.print(Panel("Opening isitdownrightnow.com", style=PURPLE_STYLE))
119
webbrowser.open_new_tab("https://www.isitdownrightnow.com/")
120
121
122
class Infoga(HackingTool):
123
TITLE = "Infoga - Email OSINT"
124
DESCRIPTION = "Infoga is a tool gathering email accounts information\n" \
125
"(ip, hostname, country,...) from different public source"
126
INSTALL_COMMANDS = [
127
"git clone https://github.com/m4ll0k/Infoga.git",
128
"cd Infoga;sudo python3 setup.py install"
129
]
130
RUN_COMMANDS = ["cd Infoga;python3 infoga.py"]
131
PROJECT_URL = "https://github.com/m4ll0k/Infoga"
132
133
134
class ReconDog(HackingTool):
135
TITLE = "ReconDog"
136
DESCRIPTION = "ReconDog Information Gathering Suite"
137
INSTALL_COMMANDS = ["git clone https://github.com/s0md3v/ReconDog.git"]
138
RUN_COMMANDS = ["cd ReconDog;sudo python dog"]
139
PROJECT_URL = "https://github.com/s0md3v/ReconDog"
140
141
142
class Striker(HackingTool):
143
TITLE = "Striker"
144
DESCRIPTION = "Recon & Vulnerability Scanning Suite"
145
INSTALL_COMMANDS = [
146
"git clone https://github.com/s0md3v/Striker.git",
147
"cd Striker && pip3 install -r requirements.txt"
148
]
149
PROJECT_URL = "https://github.com/s0md3v/Striker"
150
151
def run(self):
152
console.print(Panel(Text(self.TITLE, justify="center"), style=PURPLE_STYLE))
153
site = Prompt.ask("Enter Site Name (example.com) >> ")
154
os.chdir("Striker")
155
subprocess.run(["sudo", "python3", "striker.py", site])
156
157
158
class SecretFinder(HackingTool):
159
TITLE = "SecretFinder (like API & etc)"
160
DESCRIPTION = "SecretFinder - A python script for find sensitive data \n" \
161
"like apikeys, accesstoken, authorizations, jwt,..etc \n " \
162
"and search anything on javascript files.\n\n " \
163
"Usage: python SecretFinder.py -h"
164
INSTALL_COMMANDS = [
165
"git clone https://github.com/m4ll0k/SecretFinder.git secretfinder",
166
"cd secretfinder; sudo pip3 install -r requirements.txt"
167
]
168
PROJECT_URL = "https://github.com/m4ll0k/SecretFinder"
169
170
def __init__(self):
171
super(SecretFinder, self).__init__(runnable=False)
172
173
174
class Shodan(HackingTool):
175
TITLE = "Find Info Using Shodan"
176
DESCRIPTION = "Get ports, vulnerabilities, information, banners,..etc \n " \
177
"for any IP with Shodan (no apikey! no rate limit!)\n" \
178
"[X] Don't use this tool because your ip will be blocked by Shodan!"
179
INSTALL_COMMANDS = ["git clone https://github.com/m4ll0k/Shodanfy.py.git"]
180
PROJECT_URL = "https://github.com/m4ll0k/Shodanfy.py"
181
182
def __init__(self):
183
super(Shodan, self).__init__(runnable=False)
184
185
186
class PortScannerRanger(HackingTool):
187
TITLE = "Port Scanner - rang3r"
188
DESCRIPTION = "rang3r is a python script which scans in multi thread\n " \
189
"all alive hosts within your range that you specify."
190
INSTALL_COMMANDS = [
191
"git clone https://github.com/floriankunushevci/rang3r.git;"
192
"sudo pip install termcolor"]
193
PROJECT_URL = "https://github.com/floriankunushevci/rang3r"
194
195
def run(self):
196
console.print(Panel(Text(self.TITLE, justify="center"), style=PURPLE_STYLE))
197
ip = Prompt.ask("Enter Ip >> ")
198
os.chdir("rang3r")
199
subprocess.run(["sudo", "python", "rang3r.py", "--ip", ip])
200
201
202
class Breacher(HackingTool):
203
TITLE = "Breacher"
204
DESCRIPTION = "An advanced multithreaded admin panel finder written in python."
205
INSTALL_COMMANDS = ["git clone https://github.com/s0md3v/Breacher.git"]
206
PROJECT_URL = "https://github.com/s0md3v/Breacher"
207
208
def run(self):
209
console.print(Panel(Text(self.TITLE, justify="center"), style=PURPLE_STYLE))
210
domain = Prompt.ask("Enter domain (example.com) >> ")
211
os.chdir("Breacher")
212
subprocess.run(["python3", "breacher.py", "-u", domain])
213
214
215
class InformationGatheringTools(HackingToolsCollection):
216
TITLE = "Information gathering tools"
217
TOOLS = [
218
NMAP(),
219
Dracnmap(),
220
PortScan(),
221
Host2IP(),
222
XeroSploit(),
223
RedHawk(),
224
ReconSpider(),
225
IsItDown(),
226
Infoga(),
227
ReconDog(),
228
Striker(),
229
SecretFinder(),
230
Shodan(),
231
PortScannerRanger(),
232
Breacher()
233
]
234
235
def _get_attr(self, obj, *names, default=""):
236
for n in names:
237
if hasattr(obj, n):
238
return getattr(obj, n)
239
return default
240
241
def pretty_print(self):
242
table = Table(title="Information Gathering Tools", show_lines=True, expand=True)
243
table.add_column("Title", style=PURPLE_STYLE, no_wrap=True)
244
table.add_column("Description", style=PURPLE_STYLE)
245
table.add_column("Project URL", style=PURPLE_STYLE, no_wrap=True)
246
247
for t in self.TOOLS:
248
title = self._get_attr(t, "TITLE", "Title", "title", default=t.__class__.__name__)
249
desc = self._get_attr(t, "DESCRIPTION", "Description", "description", default="")
250
url = self._get_attr(t, "PROJECT_URL", "PROJECT_URL", "PROJECT", "project_url", "projectUrl", default="")
251
table.add_row(str(title), str(desc).replace("\n", " "), str(url))
252
253
console.print(Panel(table, title=f"[magenta]Available Tools[/magenta]", border_style=PURPLE_STYLE))
254
255
def show_options(self, parent=None):
256
console.print("\n")
257
console.print(Panel.fit(
258
"[bold magenta]Information Gathering Collection[/bold magenta]\n"
259
"Select a tool to view/run it or return to the previous menu.",
260
border_style=PURPLE_STYLE
261
))
262
263
table = Table(title="[bold cyan]Available Tools[/bold cyan]", show_lines=True, expand=True)
264
table.add_column("Index", justify="center", style="bold yellow")
265
table.add_column("Tool Name", justify="left", style="bold green")
266
table.add_column("Description", justify="left", style="white")
267
268
for i, tool in enumerate(self.TOOLS):
269
title = self._get_attr(tool, "TITLE", "Title", "title", default=tool.__class__.__name__)
270
desc = self._get_attr(tool, "DESCRIPTION", "Description", "description", default="—")
271
table.add_row(str(i + 1), title, desc or "—")
272
273
table.add_row("[red]99[/red]", "[bold red]Exit[/bold red]", "Return to previous menu")
274
console.print(table)
275
276
try:
277
choice = Prompt.ask("[bold cyan]Select a tool to run[/bold cyan]", default="99")
278
choice = int(choice)
279
if 1 <= choice <= len(self.TOOLS):
280
selected = self.TOOLS[choice - 1]
281
# delegate to collection-style tools if available
282
if hasattr(selected, "show_options"):
283
selected.show_options(parent=self)
284
# if tool exposes actions/menu, try to call it
285
elif hasattr(selected, "show_actions"):
286
selected.show_actions(parent=self)
287
# otherwise try to call run if present
288
elif hasattr(selected, "run"):
289
selected.run()
290
else:
291
console.print("[bold yellow]Selected tool has no runnable interface.[/bold yellow]")
292
elif choice == 99:
293
return 99
294
except Exception:
295
console.print("[bold red]Invalid choice. Try again.[/bold red]")
296
return self.show_options(parent=parent)
297
298
299
if __name__ == "__main__":
300
tools = InformationGatheringTools()
301
tools.pretty_print()
302
tools.show_options()
303
304