Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random, subprocess, socket, thread
- from colorama import init, Fore
- init()
- IPList = []
- newIP = []
- f = open("Addresses.txt", "r")
- for i in f:
- IPList.append(i)
- f.close()
- def endall():
- raw_input(Fore.WHITE + "Press any key to see the list of valid addresses, sire.")
- f = open("Addresses.txt", "r")
- n = 1
- for i in f:
- print Fore.GREEN + "IP ADDRESS #"+str(n)+" "+i
- n += 1
- raw_input(Fore.WHITE + "Press any key to end program, sire.")
- exit()
- def Everything():
- while(True):
- rawIP = str(random.randint(0, 255))+"."+str(random.randint(0, 255))+"."+str(random.randint(0, 255))+"."+str(random.randint(0, 255))
- while(rawIP in IPList):
- rawIP = str(random.randint(0, 255))+"."+str(random.randint(0, 255))+"."+str(random.randint(0, 255))+"."+str(random.randint(0, 255))
- IPList.append(rawIP)
- response = subprocess.call("ping -n 1 -f -l 0 -w 4 " + rawIP, stdout=subprocess.PIPE)
- if response == 0:
- print Fore.GREEN + "\nCONSOLE --- VALID IP ADDRESS: "+rawIP
- f = open("Addresses.txt", "a")
- f.write(rawIP+"\n")
- f.close
- try:
- NTP = int(raw_input("How many addresses would you like to check per thread, sire?\n"))
- numThreads = int(raw_input("How many threads, sire?\n"))
- except:
- "Enter a valid number next time, sire."
- raw_input()
- exit(0)
- for i in range(0, numThreads):
- thread.start_new_thread(Everything, ())
- Everything()
- endall()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement