import socket for port in range(1, 1024): # scan logic