├── README.md ├── autoinject.py └── requirements.txt /README.md: -------------------------------------------------------------------------------- 1 | # autoinject 2 | Herramienta automática para escanear puertos y servicios con Nmap y realizar pruebas de injección SQL con SQLmap. 3 | Es la solución perfecta si quieres centralizar estas herramientas en una sola aplicación, y si quieres que tus escaneos con nmap se muestren de una forma más visual. 4 | 5 | ![image](https://github.com/user-attachments/assets/664bd19e-3b5f-4f1f-b7fa-96bc0ad0c2a5) 6 | 7 | ## Instalación y uso 8 | ``` 9 | git clone https://github.com/afsh4ck/autoinject 10 | cd autoinject 11 | sudo chmod 777 autoinject.py requirements.txt 12 | pip install -r requirements.txt 13 | python3 autoinject.py 14 | ``` 15 | 16 | ## Créditos 17 | - Autor: afsh4ck 18 | - Instagram: afsh4ck 19 | - Youtube: afsh4ck 20 | 21 | ## Soporte 22 | 23 | 24 | ![buy-me-a-coffe](https://github.com/user-attachments/assets/8c8f9e81-334e-469e-b25e-29888cfc9fcc) 25 | 26 | -------------------------------------------------------------------------------- /autoinject.py: -------------------------------------------------------------------------------- 1 | import nmap 2 | import os 3 | import socket 4 | 5 | # Definir variables de color 6 | AMARILLO = "\033[93m" 7 | BLANCO = "\033[97m" 8 | CYAN = "\033[96m" 9 | VERDE = "\033[92m" 10 | ROJO = "\033[91m" 11 | MAGENTA = "\033[95m" 12 | RESET = "\033[0m" 13 | 14 | def cabecera(): 15 | print(ROJO + title + RESET) 16 | print(divider) 17 | 18 | title = """ 19 | __ _ _ __ 20 | ____ _ __ __ / /_ ____ (_)____ (_)___ _____ / /_ 21 | / __ `// / / // __// __ \ / // __ \ / // _ \ / ___// __/ 22 | / /_/ // /_/ // /_ / /_/ // // / / / / // __// /__ / /_ 23 | \__,_/ \__,_/ \__/ \____//_//_/ /_/__/ / \___/ \___/ \__/ 24 | /___/ 25 | 26 | Nmap & SQL injection automation tool < afsh4ck >""" 27 | 28 | divider = """------------------------------------------------------------ 29 | """ 30 | 31 | # Mostrar cabecera 32 | cabecera() 33 | 34 | def escanear_puertos(ip): 35 | nm = nmap.PortScanner() 36 | print(VERDE + "[*] Escaneando puertos en " + ip + RESET) 37 | try: 38 | nm.scan(ip) 39 | except KeyboardInterrupt: 40 | print(ROJO + "\n[!] Escaneo de puertos interrumpido por el usuario." + RESET) 41 | return 42 | except: 43 | print(ROJO + "[!] Error al escanear puertos." + RESET) 44 | return 45 | for host in nm.all_hosts(): 46 | print(VERDE+ "[*] Host : %s (%s)" % (host, nm[host].hostname()) + RESET) 47 | print(VERDE + "[*] Estado : %s" % nm[host].state() + RESET) 48 | for proto in nm[host].all_protocols(): 49 | print(VERDE + "[*] Protocolo : %s" % proto + RESET) 50 | lport = nm[host][proto].keys() 51 | for port in sorted(lport): 52 | if nm[host][proto][port]['state'] == 'open': 53 | print(VERDE + "[*] Puerto : %s Estado : %s" % (port, nm[host][proto][port]['state']) + RESET) 54 | else: 55 | print(ROJO + "[*] Puerto : %s Estado : %s" % (port, nm[host][proto][port]['state']) + RESET) 56 | 57 | def escanear_servicios(ip): 58 | print(VERDE + "[*] Escaneando servicios en " + ip + RESET) 59 | try: 60 | for port in range(1, 65536): 61 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 62 | sock.settimeout(0.1) 63 | result = sock.connect_ex((ip, port)) 64 | if result == 0: 65 | try: 66 | service = socket.getservbyport(port) 67 | except: 68 | service = "unknown" 69 | print(VERDE + "[*] Puerto : %s Servicio : %s" % (port, service) + RESET) 70 | sock.close() 71 | except KeyboardInterrupt: 72 | print(ROJO + "\n[!] Escaneo de servicios interrumpido por el usuario." + RESET) 73 | return 74 | except: 75 | print(ROJO + "[!] Error al escanear servicios." + RESET) 76 | return 77 | 78 | def inyeccion_sql(url): 79 | print(VERDE + "[*] Escaneando vulnerabilidades de inyección SQL en " + url + RESET) 80 | try: 81 | os.system("sqlmap -u " + url) 82 | except KeyboardInterrupt: 83 | print(ROJO + "\n[!] Escaneo de inyección SQL interrumpido por el usuario." + RESET) 84 | return 85 | except: 86 | print(ROJO + "[!] Error al escanear vulnerabilidades de inyección SQL." + RESET) 87 | return 88 | 89 | def main(): 90 | while True: 91 | print(CYAN + "[+] ¿Que quieres auditar hoy?" + RESET) 92 | print("1. Escaneo de puertos") 93 | print("2. Escaneo de servicios") 94 | print("3. Pruebas de inyección SQL") 95 | print("4. Salir del programa") 96 | opcion = input(VERDE + "> " + RESET) 97 | if opcion == "1": 98 | ip = input(CYAN + "[*] Ingrese la IP o dominio a escanear: " + RESET) 99 | escanear_puertos(ip) 100 | input("\nPresione Enter para continuar...") 101 | os.system("clear") 102 | cabecera() 103 | elif opcion == "2": 104 | ip = input(CYAN + "[*] Ingrese la IP o dominio a escanear: " + RESET) 105 | escanear_servicios(ip) 106 | input("\nPresione Enter para continuar...") 107 | os.system("clear") 108 | cabecera() 109 | elif opcion == "3": 110 | url = input(CYAN + "[*] Ingrese la URL para realizar pruebas de inyección SQL: " + RESET) 111 | inyeccion_sql(url) 112 | input("\nPresione Enter para continuar...") 113 | os.system("clear") 114 | cabecera() 115 | elif opcion == "4": 116 | print(ROJO + "[*] Saliendo del programa..." + RESET) 117 | print(VERDE + "[+] Happy hacking ;)" + RESET) 118 | exit() 119 | else: 120 | print(ROJO + "[!] Opción inválida." + RESET) 121 | 122 | if __name__ == "__main__": 123 | main() 124 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | python-nmap 2 | sqlmap 3 | --------------------------------------------------------------------------------