• Inicio
  • Blog
  • Creandolared
  • Buscar
  • Ingresar
  • Registrarse

    • Hack x Crack - Comunidad de Seguridad informática »
    • Programación »
    • Otros »
    • Escáner de puerto manual | aleatorio con Python [Socket Library]
    ¿Quieres aprender de páginas web? Visita la comunidad Creandolared
    • Imprimir
    Páginas: [1]   Ir Abajo

    Autor Tema: Escáner de puerto manual | aleatorio con Python [Socket Library]  (Leído 471 veces)

    Desconectado R3LI4NT

    • { L2 } Nativo Digital
    • **
    • Mensajes: 134
    • El poder del usuario radica en su ANONIMATO.
      • Ver Perfil
      • GitHub
    Escáner de puerto manual | aleatorio con Python [Socket Library]
    « en: Diciembre 01, 2020, 01:02:51 am »
    Port OPEN




    Port CLOSED



    Código
    Código: Python
    1. #!/usr/bin/python
    2.  
    3. import socket
    4. from colorama import Style, init
    5.  
    6. print("\033[;32m"+"""
    7.  
    8.  
    9.  
    10.  
    11. ███████╗ ██████╗ █████╗ ███╗   ██╗███╗   ██╗███████╗██████╗
    12. ██╔════╝██╔════╝██╔══██╗████╗  ██║████╗  ██║██╔════╝██╔══██╗
    13. ███████╗██║     ███████║██╔██╗ ██║██╔██╗ ██║█████╗  ██████╔╝
    14. ╚════██║██║     ██╔══██║██║╚██╗██║██║╚██╗██║██╔══╝  ██╔══██╗
    15. ███████║╚██████╗██║  ██║██║ ╚████║██║ ╚████║███████╗██║  ██║
    16. ╚══════╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═══╝╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝
    17. ____________________________________________________________                                                            
    18.                                       Created by: ·R3LI4NT·
    19.  
    20.  
    21. \033[;37m""")
    22.  
    23.  
    24. sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    25.  
    26. ip = str(input("Introduzca la IP -▶ "))
    27.  
    28. puerto = int(input("Introduzca el puerto -▶ "))
    29.  
    30.  
    31. if sock.connect_ex((ip, puerto)):
    32.         print("\033[;31m"+"El puerto esta cerrado")
    33.  
    34. else:
    35.     print("\033[;32m"+"El puerto", puerto, "esta abierto")
    36.  
    37. print("\033[1;37m"+"Escaneo finalizado!")    
    38.  

    Si no lo desean hacer manual y quieren que realice un escaneo a determinados puertos:
    Código
    Código: Python
    1. #!/usr/bin/python
    2.  
    3. import socket
    4. from colorama import Style, init
    5.  
    6. print("\033[;32m"+"""
    7.  
    8.  
    9.  
    10.  
    11. ███████╗ ██████╗ █████╗ ███╗   ██╗███╗   ██╗███████╗██████╗
    12. ██╔════╝██╔════╝██╔══██╗████╗  ██║████╗  ██║██╔════╝██╔══██╗
    13. ███████╗██║     ███████║██╔██╗ ██║██╔██╗ ██║█████╗  ██████╔╝
    14. ╚════██║██║     ██╔══██║██║╚██╗██║██║╚██╗██║██╔══╝  ██╔══██╗
    15. ███████║╚██████╗██║  ██║██║ ╚████║██║ ╚████║███████╗██║  ██║
    16. ╚══════╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═══╝╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝
    17. ____________________________________________________________                                                            
    18.                                       Created by: ·R3LI4NT·
    19.  
    20.  
    21. \033[;37m""")
    22.  
    23. sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    24.  
    25. ip = str(input("Introduzca la IP -▶ "))
    26.  
    27. #Agregan los puertos
    28. lista_puertos = [20, 21, 23, 80, 443, 8080]
    29.  
    30. for puerto in lista_puertos:
    31.  
    32.     if sock.connect_ex((ip, puerto)):
    33.         print("\033[;31m"+"El puerto", puerto, "esta cerrado")
    34.  
    35.     else:
    36.         print("\033[;32m"+"El puerto", puerto, "esta abierto")
    37.  
    38. print("\033[1;37m"+"Escaneo finalizado!")    
    39.  

    RESULTADO



    Saludos

    #R3LI4NT
    « Última modificación: Diciembre 01, 2020, 01:15:12 am por R3LI4NT »
    En línea

    • Imprimir
    Páginas: [1]   Ir Arriba
    • Hack x Crack - Comunidad de Seguridad informática »
    • Programación »
    • Otros »
    • Escáner de puerto manual | aleatorio con Python [Socket Library]
     

    • SMF | SMF © 2013, Simple Machines
    • XHTML
    • RSS
    • WAP2
    Va un mudo y le dice a un sordo: Hack x Crack usa cookies. Pues eso... Learn more