Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open ("iplist.txt", "r") as file:
- filecontents = file.read()
- for line in filecontents.split('n'):
- filename = (line) + ".txt "
- command = "nmap -O -oG " + ".\ips\" + (filename) + (line)
- print(command)
- print(filename)
- strlen = int (len(filename))
- print(strlen)
- compareline = line[:4]
- print(compareline)
- if compareline == beginline: #beginline is declared as 10.9 earlier in the file
- print("Testing 1..2...")
- os.system(command)
- filenameforos = (line + ".txt")
- #detailedosdetection = open(filenameforos)
- #next(filecontents)
- else:
- print("Testing...")
- del line
- #next(StopIteration)
- 10.9.10.38
- 10.9.10.45
- 10.9.11.10
- #extra line
Add Comment
Please, Sign In to add comment