Path: blob/master/tools/information_gathering_tools.py
1769 views
# coding=utf-81import os2import socket3import subprocess4import webbrowser5import sys67from core import HackingTool8from core import HackingToolsCollection9from core import clear_screen1011from rich.console import Console12from rich.panel import Panel13from rich.text import Text14from rich.prompt import Prompt15from rich.table import Table1617console = Console()18PURPLE_STYLE = "bold magenta"192021class NMAP(HackingTool):22TITLE = "Network Map (nmap)"23DESCRIPTION = "Free and open source utility for network discovery and security auditing"24INSTALL_COMMANDS = [25"sudo git clone https://github.com/nmap/nmap.git",26"sudo chmod -R 755 nmap && cd nmap && sudo ./configure && make && sudo make install"27]28PROJECT_URL = "https://github.com/nmap/nmap"2930def __init__(self):31super(NMAP, self).__init__(runnable=False)323334class Dracnmap(HackingTool):35TITLE = "Dracnmap"36DESCRIPTION = "Dracnmap is an open source program which is using to \n" \37"exploit the network and gathering information with nmap help."38INSTALL_COMMANDS = [39"sudo git clone https://github.com/Screetsec/Dracnmap.git",40"cd Dracnmap && chmod +x dracnmap-v2.2-dracOs.sh dracnmap-v2.2.sh"41]42RUN_COMMANDS = ["cd Dracnmap;sudo ./dracnmap-v2.2.sh"]43PROJECT_URL = "https://github.com/Screetsec/Dracnmap"444546class PortScan(HackingTool):47TITLE = "Port scanning"4849def __init__(self):50super(PortScan, self).__init__(installable=False)5152def run(self):53clear_screen()54console.print(Panel(Text(self.TITLE, justify="center"), style=PURPLE_STYLE))55target = Prompt.ask("[bold]Select a Target IP[/]", default="", show_default=False)56subprocess.run(["sudo", "nmap", "-O", "-Pn", target])575859class Host2IP(HackingTool):60TITLE = "Host to IP "6162def __init__(self):63super(Host2IP, self).__init__(installable=False)6465def run(self):66clear_screen()67console.print(Panel(Text(self.TITLE, justify="center"), style=PURPLE_STYLE))68host = Prompt.ask("Enter host name (e.g. www.google.com):- ")69ips = socket.gethostbyname(host)70console.print(f"[{PURPLE_STYLE}]{host} -> {ips}[/]")717273class XeroSploit(HackingTool):74TITLE = "Xerosploit"75DESCRIPTION = "Xerosploit is a penetration testing toolkit whose goal is to perform\n" \76"man-in-the-middle attacks for testing purposes"77INSTALL_COMMANDS = [78"git clone https://github.com/LionSec/xerosploit.git",79"cd xerosploit && sudo python install.py"80]81RUN_COMMANDS = ["sudo xerosploit"]82PROJECT_URL = "https://github.com/LionSec/xerosploit"838485class RedHawk(HackingTool):86TITLE = "RED HAWK (All In One Scanning)"87DESCRIPTION = "All in one tool for Information Gathering and Vulnerability Scanning."88INSTALL_COMMANDS = [89"git clone https://github.com/Tuhinshubhra/RED_HAWK.git"]90RUN_COMMANDS = ["cd RED_HAWK;php rhawk.php"]91PROJECT_URL = "https://github.com/Tuhinshubhra/RED_HAWK"929394class ReconSpider(HackingTool):95TITLE = "ReconSpider(For All Scanning)"96DESCRIPTION = "ReconSpider is most Advanced Open Source Intelligence (OSINT)" \97" Framework for scanning IP Address, Emails, \n" \98"Websites, Organizations and find out information from" \99" different sources.\n"100INSTALL_COMMANDS = [101"sudo git clone https://github.com/bhavsec/reconspider.git",102"sudo apt install python3 python3-pip && cd reconspider && sudo python3 setup.py install"103]104RUN_COMMANDS = ["cd reconspider;python3 reconspider.py"]105PROJECT_URL = "https://github.com/bhavsec/reconspider"106107108class IsItDown(HackingTool):109TITLE = "IsItDown (Check Website Down/Up)"110DESCRIPTION = "Check Website Is Online or Not"111112def __init__(self):113super(IsItDown, self).__init__(114[('Open', self.open)], installable=False, runnable=False)115116def open(self):117console.print(Panel("Opening isitdownrightnow.com", style=PURPLE_STYLE))118webbrowser.open_new_tab("https://www.isitdownrightnow.com/")119120121class Infoga(HackingTool):122TITLE = "Infoga - Email OSINT"123DESCRIPTION = "Infoga is a tool gathering email accounts information\n" \124"(ip, hostname, country,...) from different public source"125INSTALL_COMMANDS = [126"git clone https://github.com/m4ll0k/Infoga.git",127"cd Infoga;sudo python3 setup.py install"128]129RUN_COMMANDS = ["cd Infoga;python3 infoga.py"]130PROJECT_URL = "https://github.com/m4ll0k/Infoga"131132133class ReconDog(HackingTool):134TITLE = "ReconDog"135DESCRIPTION = "ReconDog Information Gathering Suite"136INSTALL_COMMANDS = ["git clone https://github.com/s0md3v/ReconDog.git"]137RUN_COMMANDS = ["cd ReconDog;sudo python dog"]138PROJECT_URL = "https://github.com/s0md3v/ReconDog"139140141class Striker(HackingTool):142TITLE = "Striker"143DESCRIPTION = "Recon & Vulnerability Scanning Suite"144INSTALL_COMMANDS = [145"git clone https://github.com/s0md3v/Striker.git",146"cd Striker && pip3 install -r requirements.txt"147]148PROJECT_URL = "https://github.com/s0md3v/Striker"149150def run(self):151console.print(Panel(Text(self.TITLE, justify="center"), style=PURPLE_STYLE))152site = Prompt.ask("Enter Site Name (example.com) >> ")153os.chdir("Striker")154subprocess.run(["sudo", "python3", "striker.py", site])155156157class SecretFinder(HackingTool):158TITLE = "SecretFinder (like API & etc)"159DESCRIPTION = "SecretFinder - A python script for find sensitive data \n" \160"like apikeys, accesstoken, authorizations, jwt,..etc \n " \161"and search anything on javascript files.\n\n " \162"Usage: python SecretFinder.py -h"163INSTALL_COMMANDS = [164"git clone https://github.com/m4ll0k/SecretFinder.git secretfinder",165"cd secretfinder; sudo pip3 install -r requirements.txt"166]167PROJECT_URL = "https://github.com/m4ll0k/SecretFinder"168169def __init__(self):170super(SecretFinder, self).__init__(runnable=False)171172173class Shodan(HackingTool):174TITLE = "Find Info Using Shodan"175DESCRIPTION = "Get ports, vulnerabilities, information, banners,..etc \n " \176"for any IP with Shodan (no apikey! no rate limit!)\n" \177"[X] Don't use this tool because your ip will be blocked by Shodan!"178INSTALL_COMMANDS = ["git clone https://github.com/m4ll0k/Shodanfy.py.git"]179PROJECT_URL = "https://github.com/m4ll0k/Shodanfy.py"180181def __init__(self):182super(Shodan, self).__init__(runnable=False)183184185class PortScannerRanger(HackingTool):186TITLE = "Port Scanner - rang3r"187DESCRIPTION = "rang3r is a python script which scans in multi thread\n " \188"all alive hosts within your range that you specify."189INSTALL_COMMANDS = [190"git clone https://github.com/floriankunushevci/rang3r.git;"191"sudo pip install termcolor"]192PROJECT_URL = "https://github.com/floriankunushevci/rang3r"193194def run(self):195console.print(Panel(Text(self.TITLE, justify="center"), style=PURPLE_STYLE))196ip = Prompt.ask("Enter Ip >> ")197os.chdir("rang3r")198subprocess.run(["sudo", "python", "rang3r.py", "--ip", ip])199200201class Breacher(HackingTool):202TITLE = "Breacher"203DESCRIPTION = "An advanced multithreaded admin panel finder written in python."204INSTALL_COMMANDS = ["git clone https://github.com/s0md3v/Breacher.git"]205PROJECT_URL = "https://github.com/s0md3v/Breacher"206207def run(self):208console.print(Panel(Text(self.TITLE, justify="center"), style=PURPLE_STYLE))209domain = Prompt.ask("Enter domain (example.com) >> ")210os.chdir("Breacher")211subprocess.run(["python3", "breacher.py", "-u", domain])212213214class InformationGatheringTools(HackingToolsCollection):215TITLE = "Information gathering tools"216TOOLS = [217NMAP(),218Dracnmap(),219PortScan(),220Host2IP(),221XeroSploit(),222RedHawk(),223ReconSpider(),224IsItDown(),225Infoga(),226ReconDog(),227Striker(),228SecretFinder(),229Shodan(),230PortScannerRanger(),231Breacher()232]233234def _get_attr(self, obj, *names, default=""):235for n in names:236if hasattr(obj, n):237return getattr(obj, n)238return default239240def pretty_print(self):241table = Table(title="Information Gathering Tools", show_lines=True, expand=True)242table.add_column("Title", style=PURPLE_STYLE, no_wrap=True)243table.add_column("Description", style=PURPLE_STYLE)244table.add_column("Project URL", style=PURPLE_STYLE, no_wrap=True)245246for t in self.TOOLS:247title = self._get_attr(t, "TITLE", "Title", "title", default=t.__class__.__name__)248desc = self._get_attr(t, "DESCRIPTION", "Description", "description", default="")249url = self._get_attr(t, "PROJECT_URL", "PROJECT_URL", "PROJECT", "project_url", "projectUrl", default="")250table.add_row(str(title), str(desc).replace("\n", " "), str(url))251252console.print(Panel(table, title=f"[magenta]Available Tools[/magenta]", border_style=PURPLE_STYLE))253254def show_options(self, parent=None):255console.print("\n")256console.print(Panel.fit(257"[bold magenta]Information Gathering Collection[/bold magenta]\n"258"Select a tool to view/run it or return to the previous menu.",259border_style=PURPLE_STYLE260))261262table = Table(title="[bold cyan]Available Tools[/bold cyan]", show_lines=True, expand=True)263table.add_column("Index", justify="center", style="bold yellow")264table.add_column("Tool Name", justify="left", style="bold green")265table.add_column("Description", justify="left", style="white")266267for i, tool in enumerate(self.TOOLS):268title = self._get_attr(tool, "TITLE", "Title", "title", default=tool.__class__.__name__)269desc = self._get_attr(tool, "DESCRIPTION", "Description", "description", default="—")270table.add_row(str(i + 1), title, desc or "—")271272table.add_row("[red]99[/red]", "[bold red]Exit[/bold red]", "Return to previous menu")273console.print(table)274275try:276choice = Prompt.ask("[bold cyan]Select a tool to run[/bold cyan]", default="99")277choice = int(choice)278if 1 <= choice <= len(self.TOOLS):279selected = self.TOOLS[choice - 1]280# delegate to collection-style tools if available281if hasattr(selected, "show_options"):282selected.show_options(parent=self)283# if tool exposes actions/menu, try to call it284elif hasattr(selected, "show_actions"):285selected.show_actions(parent=self)286# otherwise try to call run if present287elif hasattr(selected, "run"):288selected.run()289else:290console.print("[bold yellow]Selected tool has no runnable interface.[/bold yellow]")291elif choice == 99:292return 99293except Exception:294console.print("[bold red]Invalid choice. Try again.[/bold red]")295return self.show_options(parent=parent)296297298if __name__ == "__main__":299tools = InformationGatheringTools()300tools.pretty_print()301tools.show_options()302303304