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)
R3LI4NT
{ L2 } Nativo Digital
Mensajes: 134
El poder del usuario radica en su ANONIMATO.
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
#!/usr/bin/python
import
socket
from
colorama
import
Style
,
init
print
(
"
\0
33[;32m"
+
"""
███████╗ ██████╗ █████╗ ███╗ ██╗███╗ ██╗███████╗██████╗
██╔════╝██╔════╝██╔══██╗████╗ ██║████╗ ██║██╔════╝██╔══██╗
███████╗██║ ███████║██╔██╗ ██║██╔██╗ ██║█████╗ ██████╔╝
╚════██║██║ ██╔══██║██║╚██╗██║██║╚██╗██║██╔══╝ ██╔══██╗
███████║╚██████╗██║ ██║██║ ╚████║██║ ╚████║███████╗██║ ██║
╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝
____________________________________________________________
Created by: ·R3LI4NT·
\0
33[;37m"""
)
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
ip
=
str
(
input
(
"Introduzca la IP -▶ "
)
)
puerto
=
int
(
input
(
"Introduzca el puerto -▶ "
)
)
if
sock.
connect_ex
(
(
ip
,
puerto
)
)
:
print
(
"
\0
33[;31m"
+
"El puerto esta cerrado"
)
else
:
print
(
"
\0
33[;32m"
+
"El puerto"
,
puerto
,
"esta abierto"
)
print
(
"
\0
33[1;37m"
+
"Escaneo finalizado!"
)
Si no lo desean hacer manual y quieren que realice un escaneo a determinados puertos:
Código
Código: Python
#!/usr/bin/python
import
socket
from
colorama
import
Style
,
init
print
(
"
\0
33[;32m"
+
"""
███████╗ ██████╗ █████╗ ███╗ ██╗███╗ ██╗███████╗██████╗
██╔════╝██╔════╝██╔══██╗████╗ ██║████╗ ██║██╔════╝██╔══██╗
███████╗██║ ███████║██╔██╗ ██║██╔██╗ ██║█████╗ ██████╔╝
╚════██║██║ ██╔══██║██║╚██╗██║██║╚██╗██║██╔══╝ ██╔══██╗
███████║╚██████╗██║ ██║██║ ╚████║██║ ╚████║███████╗██║ ██║
╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝
____________________________________________________________
Created by: ·R3LI4NT·
\0
33[;37m"""
)
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
ip
=
str
(
input
(
"Introduzca la IP -▶ "
)
)
#Agregan los puertos
lista_puertos
=
[
20
,
21
,
23
,
80
,
443
,
8080
]
for
puerto
in
lista_puertos:
if
sock.
connect_ex
(
(
ip
,
puerto
)
)
:
print
(
"
\0
33[;31m"
+
"El puerto"
,
puerto
,
"esta cerrado"
)
else
:
print
(
"
\0
33[;32m"
+
"El puerto"
,
puerto
,
"esta abierto"
)
print
(
"
\0
33[1;37m"
+
"Escaneo finalizado!"
)
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]
Va un mudo y le dice a un sordo: Hack x Crack usa cookies. Pues eso...
OK
Learn more