Created
December 31, 2017 12:06
-
-
Save samduy/d5e92897c0d432da48a196f930bcb99b to your computer and use it in GitHub Desktop.
Python port scanner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket as sk | |
for port in range(1,1024): | |
try: | |
s=sk.socket(sk.AF_NET,sk.SOCK_STREAM) | |
s.settimeout(1000) | |
s.connect(('127.0.0.1',port)) | |
print '%d: OPEN' % (port) | |
s.close | |
except: continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment