Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import requests
  2. import os
  3. import sys
  4. import random, string
  5.  
  6. def register(username, password, email, register_url):
  7. try:
  8. data = {'username':username, 'password':password, 'email':email}
  9. headers = {'Referer':register_url}
  10. r = requests.post(register_url, json=data, headers=headers, verify=False, timeout=4)
  11. if r.status_code == 201:
  12. return 0
  13. else:
  14. return 1
  15. except:
  16. print sys.exc_info()
  17. return 10
  18.  
  19. def randomword(length):
  20. return ''.join(random.choice(string.lowercase) for i in range(length))
  21.  
  22. while 1:
  23. username = randomword(6)
  24. password = randomword(6)
  25. email = randomword(6)
  26. #print(username)
  27. #print(password)
  28. register(username, password, email, "http://www.team27.isucdc.com/register")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement