-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
executable file
·71 lines (64 loc) · 2.62 KB
/
Copy pathutils.py
File metadata and controls
executable file
·71 lines (64 loc) · 2.62 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
import json
import os
import time
import platform
CONFIG_FILE = "config_dana.json"
# 🎨 Paleta hacker
def color(texto, color):
colores = {
"red": "\033[91m",
"green": "\033[92m",
"yellow": "\033[93m",
"cyan": "\033[96m",
"blue": "\033[94m",
"magenta": "\033[95m",
"white": "\033[97m",
"reset": "\033[0m"
}
return f"{colores.get(color, '')}{texto}{colores['reset']}"
# 📂 Configuración
def cargar_config():
"""Carga configuración desde archivo JSON."""
if not os.path.exists(CONFIG_FILE):
return {}
try:
with open(CONFIG_FILE, "r") as f:
return json.load(f)
except Exception:
return {}
def guardar_config(config):
"""Guarda configuración en archivo JSON."""
try:
with open(CONFIG_FILE, "w") as f:
json.dump(config, f, indent=4)
except Exception as e:
print(color(f"[!] Error guardando configuración: {e}", "red"))
def cargar_top_ports(path="top_1000_nmap_ports.json"):
try:
with open(path, "r", encoding="utf-8") as f:
import json
return json.load(f)
except Exception as e:
print(color(f"[!] No se pudo cargar top ports: {e}", "red"))
return []
# 🧹 Limpieza de pantalla
def limpiar_pantalla():
os.system("cls" if platform.system() == "Windows" else "clear")
# 💀 Banner estilo hacker
def banner():
limpiar_pantalla()
arte = r"""
╔════════════════════════════════════════════╗
║ ██████╗ █████╗ ███╗ ██╗ █████╗ ║
║ ██╔══██╗██╔══██╗████╗ ██║██╔══██╗ ║
║ ██║ ██║███████║██╔██╗ ██║███████║ ║
║ ██║ ██║██╔══██║██║╚██╗██║██╔══██║ ║
║ ██████╔╝██║ ██║██║ ╚████║██║ ██║ ║
║ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ║
║ D.A.N.A Network Tools v2.0 ║
╚════════════════════════════════════════════╝
"""
for linea in arte.split("\n"):
print(color(linea, "green"))
time.sleep(0.02) # efecto "animado"
print(color("[*] Bienvenido a DANA - Herramienta Modular de Escaneo\n", "cyan"))