Created
February 27, 2018 16:25
-
-
Save GarnetSunset/34b78d398a91931f52bf7c724d6f1679 to your computer and use it in GitHub Desktop.
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 subprocess | |
goUp = 0 | |
range = raw_input("What range would you like to test for \"xxx.xxx.xxx\"\n>") | |
text_file = open(range + ".XXX.txt", "w") | |
while(goUp < 255): | |
goUp = goUp + 1 | |
excuseMePrincess = range + "." + str(goUp) | |
excuseMePrincess.strip() | |
print(range + "." + str(goUp)) | |
try: | |
proc = subprocess.Popen(["nslookup", excuseMePrincess], stdout=subprocess.PIPE, shell=True) | |
(out, err) = proc.communicate() | |
text_file.write(excuseMePrincess + "\n" + out) | |
except: | |
text_file.write(excuseMePrincess + ": Does not exist according to nslookup\n") | |
text_file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment