I haven't tried the code, but it looks like you need to increment on
connection failures, too. I think it's more pythonic to iterate over
a range, as in the following
for test_port in range(start_port, end_port)
but it would suffice to just move the start_port+=1 outside of the try
_
Hi all.
I'm trying to build a simple port scanner (just to learn sockets).
here is the code (doesn't work) :
import socket
sk=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host=raw_input("Enter name of host to scan: ")
start_port=input("Enter the start port: ")
end_port=input("Enter the end por