Sunday, June 22, 2014

Python simple script to connect to a host/port and get response.

__author__ = 'admin'
import socket
s = socket.socket()
s.settimeout(3)
s.connect(("server.com",21))
ans  = s.recv(1024)
print ans

No comments:

Blog Archive