Why is my python port-scanner taking so much time to scan?

50 Views Asked by At

I'm using this python portscanner, and for some reason, it's been 16+ minutes and no results came up, still in scanning phase. Where can I add in the code, to make it scan faster?

try:
    for port in range(1,1025):
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        result = sock.connect_ex((remoteServerIP, port))
        if result == 0:
            print("Port{}: Open".format(port))
        sock.close()
0

There are 0 best solutions below