Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- from __future__ import print_function
- import random
- global j
- j = 100
- alphabet = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- pw_length = 12
- mypw = ""
- print(mypw)
- out = open('users.conf', 'a')
- mail = open('mail','a')
- with open('email.db', 'r') as emaillist:
- for line in emaillist:
- line = line.replace('\n', '')
- mypw = ""
- for i in range(pw_length):
- next_index = random.randrange(len(alphabet))
- mypw = mypw + alphabet[next_index]
- j+=1
- j=str(j)
- out.write("["+j+"]"+'\n')
- out.write("secret="+mypw+'\n')
- out.write("type=peer"+'\n')
- out.write("username="+j+'\n')
- out.write("host=dynamic"+'\n')
- out.write("qualify=yes"+'\n')
- out.write("nat=yes"+'\n')
- out.write("call-limit=1"+'\n')
- out.write("canreinvite=no"+'\n')
- out.write("disallow=all"+'\n')
- out.write("allow=alaw"+'\n')
- out.write("allow=ulaw"+'\n')
- out.write('\n')
- mail.write("toaddrs = \'"+line+"\'"+'\n')
- mail.write("msg = \'username=" + j + " password=" + mypw + " connection server=admin500.ru\'" + '\n')
- msg = "\r\n".join([
- "From: user_me@gmail.com",
- "To: user_you@gmail.com",
- "Subject: Just a message",
- "",
- "Why, oh why"
- ])
- mail.write("server.ehlo()"+'\n')
- mail.write("server.starttls()"+'\n')
- mail.write("server.login(username,password)"+'\n')
- mail.write("server.sendmail(fromaddr, toaddrs, msg)"+'\n')
- mail.write("server.quit()"+'\n')
- mail.write('\n')
- j=int(j)
- out.close
- mail.close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement