Update Python Ofensivo - Pruebas de conexión con la librería socket

This commit is contained in:
2024-01-11 20:26:58 +01:00
parent 653e96cc2b
commit ec29b5cde0
4 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#!/usr/bin/env python3
"""
Client socket
"""
import socket
def start_client():
host = 'localhost'
port = 1234
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((host, port))
print(f"[*] Conexión establecida con {host}:{port}")
s.sendall("Ola k ase server!\n".encode())
data = s.recv(1024)
print(f"[i] Mensaje de {host}:{port}:\n\t{data.decode()}")
start_client()