当前位置:网站首页>在SQL注入中,为什么union联合查询,id必须等于0
在SQL注入中,为什么union联合查询,id必须等于0
2022-07-02 06:34:00 【hangshao0.0】
其实也不是非得让 id=0
?id=0' union select 1,2,3 --+ ?id=0' union select 1,database(),3 --+
?id=0' union select 1,database(),user() --+
这里的 id 需要格外注意:
如果只有两个回显位置
那么 id 必须填写一个不存在的数(-1或者0),联合查询才能回显成功
因为在数据表中,id 为 1,2,3,……
如果参数为:?id=1' union select 1,2,3 --+
那么查询语句就是:select * from users where id='1' union select 1,2,3 --+' limit 0,1
id=1 的数据被查询出来,返回到页面中,就占据了两个回显位
这个时候, union 查询的内容,会因为唯二的两个回显位被占据了,导致无法回显
如果 id=2,返回的内容也会占据回显位,导致 union 查询的内容无法回显到页面中
如果 id 为表中不存在的数,例如 id=0,id=-1 等等
那么查询语句就是:select * from users where id='0' union select 1,2,3 --+' limit 0,1
因为 id=0 没有查询结果,所以页面中就返回 union 查询的内容
不一定要让 id=0
其实 id=-1,id=-5 等等都是可以的
所以,我们可以知道:
只要 union 前面的查询失败,那么 union 后面的查询结果就能回显到页面
id=1’ and 1=2 union select 1,2,3 –+ 通过 and 1=2 语句来触发报错
id=1’ or 1=1 union select 1,2,3 –+ 通过 or 1=1 语句来触发报错
边栏推荐
- "Interview high frequency question" is 1.5/5 difficult, and the classic "prefix and + dichotomy" application question
- Servlet全解:继承关系、生命周期、容器和请求转发与重定向等
- Matplotlib剑客行——布局指南与多图实现(更新)
- JVM指令助记符
- Micro service practice | introduction and practice of zuul, a micro service gateway
- Cloud computing in my eyes - PAAS (platform as a service)
- 概念到方法,绝了《统计学习方法》——第三章、k近邻法
- Flink-使用流批一体API统计单词数量
- 以字节跳动内部 Data Catalog 架构升级为例聊业务系统的性能优化
- Microservice practice | Eureka registration center and cluster construction
猜你喜欢
Knowledge points are very detailed (code is annotated) number structure (C language) -- Chapter 3, stack and queue
Servlet全解:继承关系、生命周期、容器和请求转发与重定向等
Dix ans d'expérience dans le développement de programmeurs vous disent quelles compétences de base vous manquez encore?
[go practical basis] how to verify request parameters in gin
Microservice practice | fuse hytrix initial experience
Say goodbye to 996. What are the necessary plug-ins in idea?
Talk about the secret of high performance of message queue -- zero copy technology
I've taken it. MySQL table 500W rows, but someone doesn't partition it?
概率还不会的快看过来《统计学习方法》——第四章、朴素贝叶斯法
Required request body is missing:(跨域问题)
随机推荐
Talk about the secret of high performance of message queue -- zero copy technology
[go practical basis] how to install and use gin
I've taken it. MySQL table 500W rows, but someone doesn't partition it?
Watermelon book -- Chapter 5 neural network
西瓜书--第五章.神经网络
Idea view bytecode configuration
Cloud computing in my eyes - PAAS (platform as a service)
Redis zadd导致的一次线上问题排查和处理
Typora安装包分享
Dix ans d'expérience dans le développement de programmeurs vous disent quelles compétences de base vous manquez encore?
Knife4j 2. Solution to the problem of file control without selection when uploading x version files
MySQL事务
[go practical basis] how to customize and use a middleware in gin
Long summary (code with comments) number structure (C language) -- Chapter 4, string (Part 1)
DTM distributed transaction manager PHP collaboration client V0.1 beta release!!!
A detailed explanation takes you to reproduce the statistical learning method again -- Chapter 2, perceptron model
Amq6126 problem solving ideas
Ora-12514 problem solving method
Statistical learning methods - Chapter 5, decision tree model and learning (Part 1)
Insight into cloud native | microservices and microservice architecture