-
-
Save tdrjnr/fc8f3db211501fa7d3d87c7906ab51f8 to your computer and use it in GitHub Desktop.
executing netcat from a python script
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 os | |
| import subprocess | |
| test_cmd = 'netcat -vz 193.1.172.59 75-85' | |
| expected = 'vega.ucd.ie [193.1.172.59] 80 (http) open' | |
| process = subprocess.Popen(test_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
| err = process.stderr.read() | |
| print str(err) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment