Posts

Showing posts from September, 2015

Python Port Scanner

Image
#!/usr/bin/python import socket def PortScanner():     gateway=raw_input("Please print router's gateway!")     print  "Your gateway is "+str(gateway)          for port in range(1,1024):         try:             socket.setdefaulttimeout(2)             s=socket.socket()             s.connect((gateway,port))                 #banner=s.recv(1024)             print '%d:OPEN' %port             s.close                     except: continue PortScanner()