I’m not very experienced with python, but I occasionally program with some help from a friend. This script generates random ip addresses and tries to connect to them, displaying the addresses that work:
import socket
from random import randint
def randip():
while True:
yield ".".join(str(randint(1, 255)) for i in range(4))
a = []
for address in randip():
try:
s = socket.socket()
s.settimeout(0.3)
s.connect((address, 80))
print address, "WORKS!!!"
a.append(address)
except socket.error:
if len(a) != 5:
continue
else:
print a
raw_input("press enter")
break


Hi there. I am looking for a way to do exactly what you describe above…generate IP addresses randomly. However, I am not programmer so I don’t know exactly how to employ your script. Can you give me some more details on where and how to use it please? Thank you.
You should become more familiar with python, for example by googling you can find lots of guides and docs. You could compile this to be run as a windows executable. What exactly do you want to do?