Advertisement
Guest User

antimatripheantispamcolor.py

a guest
Jan 29th, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.23 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # how to use : python antimatripheantispamcolor.py link username email
  3. # e.g : python http://localhost/matriphe tes tes@gmail.com
  4.  
  5. import urllib
  6. import urllib2
  7. import cookielib
  8. import re
  9. import sys
  10.  
  11. colors = {
  12.     '#ff0000' : ('red',0),
  13.     '#008000' : ('green',1),
  14.     '#0060b6' : ('blue',2),
  15.     '#ffd700' : ('yellow',3),
  16.     '#000000' : ('black',4),
  17.     '#ffffff' : ('white',5),
  18.     '#ff69b4' : ('pink',6),
  19.     '#ffa500' : ('orange',7),
  20.     '#800080' : ('purple',8),
  21.     '#7f7f7f' : ('grey',9),
  22. }
  23.  
  24. cj = cookielib.CookieJar()
  25. opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
  26. temp = opener.open('%s/wp-login.php?action=register' %sys.argv[1])
  27. resp = temp.read()
  28.  
  29. search_color = re.findall(r'background-color:(.*); border-color: rgb', resp)
  30.  
  31. post_date = urllib.urlencode({'user_login':sys.argv[2], 'user_email':sys.argv[3], 'color_name':colors[search_color[0]][0], 'color_id':colors[search_color[0]][1], 'redirect_to':'', 'wp-submit':'Register'})
  32. final = opener.open('%s/wp-login.php?action=register' %sys.argv[1], post_date)
  33. final_resp = final.read()
  34.  
  35. if re.search(r"Registration complete. Please check your e-mail.", final_resp):
  36.     print "register complete, please check your email"
  37. else:
  38.     print "error register"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement