├── LICENSE ├── README.md ├── depthsearch.py └── requirements.txt /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Istoleyourbutter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DepthSearch 2 | 3 | DepthSearch is a powerful OSINT tool designed for conducting deep web searches. It enables users to search for specific keywords or strings across deep web search engines, providing detailed results with URLs, titles, and descriptions. The tool is built to support proxy rotation for enhanced anonymity and integrates system information retrieval to offer insights into the running environment. 4 | 5 | **NOTE**: 6 | - ``Integrating with Ominis-OSINT`` 7 | - ``Further updates in discussion`` 8 | 9 | ## Features 10 | 11 | - **Deep Web Search**: Query deep web search engines and retrieve results with URLs and titles. 12 | - **Proxy Support**: Optional proxy rotation to improve anonymity and circumvent access restrictions. 13 | - **System Information**: Displays detailed information about the operating system, memory, CPU frequency, and number of cores. 14 | - **Human-like Behavior**: Implements random delays between requests to mimic human interaction and reduce detection risk. 15 | - **User-Friendly**: Interactive command-line interface for easy input of search queries and configurations. 16 | 17 | To get started, ensure all required dependencies are installed and run the script to begin your deep web search. 18 | ``git clone https://github.com/AnonCatalyst/DepthSearch && cd DepthSearch`` 19 | ``pip install -r requirements.txt --break-system-packages`` 20 | ``python3 depthsearch.py`` 21 | -------------------------------------------------------------------------------- /depthsearch.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import requests 3 | from bs4 import BeautifulSoup 4 | import os 5 | import time 6 | import random 7 | from fake_useragent import UserAgent 8 | import platform 9 | import psutil 10 | from colorama import Fore, Style, init 11 | 12 | # Initialize colorama 13 | init(autoreset=True) 14 | 15 | sys.dont_write_bytecode = True 16 | 17 | 18 | class ConsoleConfig: 19 | # Console styles 20 | BOLD = Style.BRIGHT 21 | END = Style.RESET_ALL 22 | 23 | 24 | class Config: 25 | ERROR_CODE = -1 26 | SUCCESS_CODE = 0 27 | MIN_DATA_RETRIEVE_LENGTH = 1 28 | USE_PROXY = False 29 | 30 | SEARCH_ENGINE_URL = "https://ahmia.fi/search/?q=" 31 | PROXY_API_URLS = [ 32 | "https://api.proxyscrape.com/v2/?request=displayproxies&protocol=http&timeout=10000&country=all&ssl=all&anonymity=elite", 33 | "https://www.proxy-list.download/api/v1/get?type=https", 34 | "https://www.proxy-list.download/api/v1/get?type=http" 35 | ] 36 | 37 | 38 | class PlatformUtils: 39 | @staticmethod 40 | def get_os_descriptor(): 41 | os_name = platform.system().lower() 42 | os_version = platform.version() 43 | os_release = platform.release() 44 | machine = platform.machine() 45 | processor = platform.processor() 46 | 47 | print(f"{ConsoleConfig.BOLD}{Fore.WHITE}Operating System:{Fore.GREEN} {os_name.capitalize()}{ConsoleConfig.END}") 48 | print(f"{ConsoleConfig.BOLD}{Fore.WHITE}OS Version:{Fore.WHITE} {os_version}{ConsoleConfig.END}") 49 | print(f"{ConsoleConfig.BOLD}{Fore.WHITE}OS Release:{Fore.WHITE} {os_release}{ConsoleConfig.END}") 50 | print(f"{ConsoleConfig.BOLD}{Fore.WHITE}Machine:{Fore.WHITE} {machine}{ConsoleConfig.END}") 51 | print(f"{ConsoleConfig.BOLD}{Fore.WHITE}Processor:{Fore.WHITE} {processor}{ConsoleConfig.END}") 52 | 53 | try: 54 | mem_info = psutil.virtual_memory() 55 | print(f"{ConsoleConfig.BOLD}{Fore.WHITE}Total Memory:{Fore.WHITE} {mem_info.total // (1024 ** 2)} MB{ConsoleConfig.END}") 56 | 57 | cpu_freq = psutil.cpu_freq() 58 | if cpu_freq: 59 | print(f"{ConsoleConfig.BOLD}{Fore.WHITE}CPU Frequency:{Fore.WHITE} {cpu_freq.current} MHz{ConsoleConfig.END}") 60 | else: 61 | print(f"{ConsoleConfig.BOLD}{Fore.WHITE}CPU Frequency information not available{ConsoleConfig.END}") 62 | 63 | num_cores = psutil.cpu_count(logical=True) 64 | print(f"{ConsoleConfig.BOLD}{Fore.WHITE}Number of Cores:{Fore.WHITE} {num_cores}{ConsoleConfig.END}") 65 | 66 | except Exception as e: 67 | print(f"{ConsoleConfig.BOLD}{Fore.RED}Unable to retrieve some system information: {e}{ConsoleConfig.END}") 68 | 69 | @staticmethod 70 | def clear_screen(): 71 | os_name = platform.system().lower() 72 | if os_name in ["linux", "darwin"]: 73 | os.system('clear') 74 | elif os_name == "windows": 75 | os.system('cls') 76 | else: 77 | print("[!] Cannot clear screen. Unsupported OS.") 78 | 79 | 80 | class ProxyManager: 81 | def __init__(self): 82 | self.proxies = [] 83 | 84 | def update_proxies(self): 85 | all_proxies = set() 86 | for url in Config.PROXY_API_URLS: 87 | try: 88 | response = requests.get(url) 89 | response.raise_for_status() # Check for HTTP errors 90 | all_proxies.update(line.strip() for line in response.text.splitlines() if line.strip()) 91 | except requests.RequestException as e: 92 | print(f"[!] Error fetching proxies from {url}: {e}") 93 | self.proxies = ["http://" + proxy for proxy in all_proxies] 94 | 95 | def get_random_proxy(self): 96 | return random.choice(self.proxies) if self.proxies else None 97 | 98 | 99 | class DepthSearch: 100 | def __init__(self): 101 | self.user_agent = UserAgent() 102 | self.session = requests.Session() # Use session for persistent connections 103 | self.proxy_manager = ProxyManager() 104 | 105 | def search(self, query, amount): 106 | headers = {'User-Agent': self.user_agent.random} 107 | 108 | if Config.USE_PROXY: 109 | self.proxy_manager.update_proxies() # Update proxies before starting the search 110 | 111 | proxies_used = 0 112 | results_found = 0 113 | 114 | while results_found < amount: 115 | if Config.USE_PROXY: 116 | proxy = self.proxy_manager.get_random_proxy() 117 | if proxy: 118 | print(f"{ConsoleConfig.BOLD}{Fore.MAGENTA}Using Proxy:{Fore.CYAN} {proxy}{ConsoleConfig.END}\n") 119 | self.session.proxies.update({"http": proxy}) 120 | 121 | try: 122 | response = self.session.get(Config.SEARCH_ENGINE_URL + query, headers=headers, timeout=10) 123 | response.raise_for_status() # Ensure we handle HTTP errors 124 | 125 | soup = BeautifulSoup(response.content, 'html.parser') 126 | results = soup.find(id='ahmiaResultsPage') 127 | result_items = results.find_all('li', class_='result') 128 | 129 | titles = [item.find('p').text if item.find('p') else None for item in result_items] 130 | urls = [item.find('cite').text if item.find('cite') else None for item in result_items] 131 | 132 | if len(urls) >= Config.MIN_DATA_RETRIEVE_LENGTH: 133 | for i in range(len(urls)): 134 | url = urls[i] 135 | title = titles[i] if i < len(titles) else None 136 | 137 | output = f"{ConsoleConfig.BOLD}{Fore.LIGHTGREEN_EX}URL:{Fore.WHITE} {url}\n" 138 | if title: 139 | output += f"\t{ConsoleConfig.BOLD}Title:{Fore.LIGHTBLUE_EX} {title}\n" 140 | output += ConsoleConfig.END 141 | print(output) 142 | results_found += 1 143 | if results_found >= amount: 144 | break 145 | else: 146 | print(f"{ConsoleConfig.BOLD}{Fore.LIGHTRED_EX}No results found.{ConsoleConfig.END}") 147 | 148 | # Mimic human behavior with random delays between requests 149 | time.sleep(random.uniform(1, 3)) 150 | 151 | proxies_used += 1 152 | if Config.USE_PROXY and proxies_used >= len(self.proxy_manager.proxies): 153 | print(f"{ConsoleConfig.BOLD}{Fore.LIGHTRED_EX}Ran out of proxies.{ConsoleConfig.END}") 154 | break 155 | 156 | except requests.RequestException as e: 157 | print(f"{ConsoleConfig.BOLD}{Fore.LIGHTRED_EX}Request failed: {e}{ConsoleConfig.END}") 158 | if Config.USE_PROXY: 159 | self.proxy_manager.update_proxies() # Update proxies on failure 160 | 161 | if results_found < amount: 162 | print(f"{ConsoleConfig.BOLD}{Fore.LIGHTRED_EX}Not enough results found after using all proxies.{ConsoleConfig.END}") 163 | 164 | 165 | def main(): 166 | PlatformUtils.clear_screen() 167 | PlatformUtils.get_os_descriptor() 168 | time.sleep(1.3) 169 | 170 | # Get user inputs 171 | query = input(f"\n{ConsoleConfig.BOLD}Enter the query: {ConsoleConfig.END}").strip() 172 | amount_str = input(f"{ConsoleConfig.BOLD}Enter the number of results to retrieve (default: 25): {ConsoleConfig.END}").strip() 173 | use_proxy_str = input(f"{ConsoleConfig.BOLD}Use proxy for increased anonymity? (y/n): {ConsoleConfig.END}").strip().lower() 174 | 175 | # Set defaults 176 | amount = 25 177 | use_proxy = use_proxy_str in ['yes', 'y'] 178 | 179 | # Validate amount 180 | if amount_str.isdigit(): 181 | amount = int(amount_str) 182 | 183 | if query: 184 | print(f"{ConsoleConfig.BOLD}Searching For:{Fore.GREEN} {query} and showing {amount} results...\n{ConsoleConfig.END}") 185 | Config.USE_PROXY = use_proxy 186 | DepthSearch().search(query, amount) 187 | else: 188 | print(f"{ConsoleConfig.BOLD}{Fore.LIGHTRED_EX}No query arguments were passed. Please supply a query to search.{ConsoleConfig.END}") 189 | 190 | 191 | if __name__ == "__main__": 192 | main() 193 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | beautifulsoup4 3 | fake-useragent 4 | colorama 5 | psutil 6 | --------------------------------------------------------------------------------