Created
August 7, 2016 12:00
-
-
Save kkirsche/354e491d85810e0467eaf8d0da40d8ef to your computer and use it in GitHub Desktop.
Python Port Checker — Detect a port opening
This file contains hidden or 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; | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| openPort = False | |
| while openPort == False: | |
| result = sock.connect_ex(('10.10.10.136', 20)) | |
| if result == 0: | |
| openPort = True | |
| print 'FTP Port is open' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment