Simple port scanner

LocalRoot
MontenegroPosts: 29VIP in Perl / Python / Shell scripting
import socket
socket.setdefaulttimeout(0.1)


host = raw_input("Enter target: ")

for i in range(1, 65535):
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    if s.connect_ex((host, i)) == 0:
        print "Port %s is open" % (i)
Sign In or Register to comment.

Welcome

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions