Reputation: 39
Today someone tried to steal my login info via a phishing site. So i decided to spam that site with random emails and passwords, i found a piece of code and it seems to work. My only issue is that i can't make the program run over and over again. If i run the program only one email/password will be sent and then the program ends. Perhaps im using the wrong python version? I'm on "Python 3.8.1" and this code was written back in 2018. This is the code:
import os
import random
import string
import json
chars = string.ascii_letters + string.digits + '!@#$%^&*()'
random.seed = (os.urandom(1024))
url = 'http://domainname/index.php'
names = json.loads(open('names.json').read())
for name in names:
name_extra = ''.join(random.choice(string.digits))
username = name.lower() + name_extra + '@yahoo.com'
password = ''.join(random.choice(chars) for i in range(8))
requests.post(url, allow_redirects=False, data={
'email': username,
'pass': password
})
print ('sending username %s and password %s' % (username, password))
The names.json is a json with random names.
Upvotes: 2
Views: 232
Reputation: 504
Try putting your code inside a while True
loop, and if you want to really be certain it will run continuously you should put it inside a try-except
block, too.
try something like this:
while True:
try:
#your current code
#(not including the import statements and the deceleration of the chars and url variables)
except Exception as error:
print(error)
Upvotes: 3