-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGoSFinder.py
More file actions
134 lines (109 loc) · 5.12 KB
/
GoSFinder.py
File metadata and controls
134 lines (109 loc) · 5.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import requests
from concurrent.futures import ThreadPoolExecutor, as_completed
from tqdm import tqdm
from colorama import Fore, init
import argparse
import warnings
# Desactivar warnings de SSL (solo para testing)
warnings.filterwarnings("ignore", message="Unverified HTTPS request")
__author__ = 'Katz'
__version__ = '2.1' # Versión actualizada
# Herramienta mejorada para usarlo en Python3
# By: Hack Underway
init(autoreset=True)
# Banner
def print_banner():
"""Imprime el banner con arte ASCII."""
print(Fore.RED + " _.-,")
print(Fore.BLUE + Fore.YELLOW + " _ .-' / .._")
print(Fore.YELLOW + " .-:'/ - - \\:::::-.")
print(Fore.CYAN + " .::: ' e e ' '-::::.")
print(Fore.GREEN + " ::::'( ^ )_.::::::")
print(Fore.MAGENTA + " ::::.' '. o '.::::'.'/_")
print(Fore.YELLOW + " . :::.' - .::::'_ _.:")
print(Fore.BLUE + " .-''---' .'| .::::' '''::::")
print(Fore.RED + "'. ..-:::' | .::::' ::::")
print(Fore.MAGENTA + " '.' :::: \\ .::::' ::::")
print(Fore.CYAN + " :::: .::::' ::::")
print(Fore.GREEN + Fore.RED + " ::::.::::'._ ::::")
print(Fore.YELLOW + " ::::::' / '- .::::")
print(Fore.WHITE + " '::::-/__ __.-::::'")
print(Fore.RED + " '-::::::::::::::-'")
print(Fore.CYAN + " '''::::'''\n")
# Leer el archivo de rutas a escanear
def load_paths(file_path):
"""Carga los paths del archivo de texto."""
try:
with open(file_path, "r") as file:
return [line.strip() for line in file if line.strip()]
except FileNotFoundError:
print(Fore.RED + f"[!] Error: No se encontró el archivo {file_path}")
return []
except Exception as e:
print(Fore.RED + f"[!] Error al leer el archivo: {str(e)}")
return []
# Validar la URL del sitio web
def validate_url(website):
"""Valida y ajusta la URL del sitio web."""
if not website.startswith("http://") and not website.startswith("https://"):
website = "https://" + website # Por defecto usamos HTTPS
return website if website.endswith('/') else website + '/'
# Realizar una solicitud para verificar el panel de administración
def check_admin_path(website, path):
"""Realiza una solicitud a la URL y verifica si está disponible."""
full_url = website + path
try:
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
}
# Configuración para ignorar certificados SSL no válidos (solo testing)
session = requests.Session()
session.verify = False
response = session.get(
full_url,
headers=headers,
timeout=10,
allow_redirects=False
)
# Códigos de estado a considerar como "encontrado"
if response.status_code in [200, 403, 401, 302]:
# Verificar si parece ser un panel de login
content = response.text.lower()
if any(keyword in content for keyword in ['login', 'password', 'username', 'wp-admin', 'sign in']):
return f"{Fore.GREEN}[+] Encontrado: {full_url} (Status: {response.status_code})"
return None
except requests.exceptions.RequestException:
return None
# Función principal para escanear los paths en paralelo
def scan_website(website, paths):
"""Escanea todas las rutas en paralelo y muestra sólo los resultados encontrados."""
if not paths:
print(Fore.RED + "[!] No hay rutas para escanear. Verifica tu archivo de diccionario.")
return
found_count = 0
with ThreadPoolExecutor(max_workers=20) as executor:
futures = [executor.submit(check_admin_path, website, path) for path in paths]
for future in tqdm(as_completed(futures), total=len(paths), desc="Escaneando"):
result = future.result()
if result:
print(result)
found_count += 1
print(Fore.YELLOW + f"\n[+] Escaneo completado. Paneles encontrados: {found_count}")
# Función principal
def main():
print_banner()
parser = argparse.ArgumentParser(description="Web Crawler - Admin Panel Finder")
parser.add_argument("-n", "--nombre", help="Nombre del usuario", required=True)
parser.add_argument("-s", "--sitio", help="Sitio web para escanear (sin http:// ni https://)", required=True)
parser.add_argument("-f", "--file", help="Archivo de diccionario (por defecto: gosadmin.txt)", default="gosadmin.txt")
args = parser.parse_args()
print(Fore.GREEN + f"Buena suerte con tu escaneo, {args.nombre}.\n")
# Validar y ajustar la URL proporcionada
website = validate_url(args.sitio)
# Cargar paths desde el archivo
paths = load_paths(args.file)
# Iniciar el escaneo
scan_website(website, paths)
if __name__ == "__main__":
main()