当前位置:网站首页>在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 语句来触发报错
边栏推荐
- [staff] time mark and note duration (staff time mark | full note rest | half note rest | quarter note rest | eighth note rest | sixteenth note rest | thirty second note rest)
- Probability is not yet. Look at statistical learning methods -- Chapter 4, naive Bayesian method
- VIM operation command Encyclopedia
- How to install PHP in CentOS
- idea查看字节码配置
- Flink-使用流批一体API统计单词数量
- Cloudreve自建云盘实践,我说了没人能限制得了我的容量和速度
- Microservice practice | teach you to develop load balancing components hand in hand
- Programmers with ten years of development experience tell you, what core competitiveness do you lack?
- [go practical basis] how can gin get the request parameters of get and post
猜你喜欢
Data type case of machine learning -- using data to distinguish men and women based on Naive Bayesian method
In depth analysis of how the JVM executes Hello World
【Go实战基础】如何安装和使用 gin
Break the cocoon | one article explains what is the real cloud primordial
Redis zadd导致的一次线上问题排查和处理
idea查看字节码配置
Solutions to Chinese garbled code in CMD window
微服务实战|熔断器Hystrix初体验
Matplotlib剑客行——布局指南与多图实现(更新)
自定義Redis連接池
随机推荐
Microservice practice | declarative service invocation openfeign practice
定时线程池实现请求合并
Matplotlib剑客行——初相识Matplotlib
盘点典型错误之TypeError: X() got multiple values for argument ‘Y‘
Jingdong senior engineer has developed for ten years and compiled "core technology of 100 million traffic website architecture"
企业级SaaS CRM实现
[go practical basis] how to bind and use URL parameters in gin
Matplotlib剑客行——容纳百川的艺术家教程
Solution to amq4036 error in remote connection to IBM MQ
What are the differences between TP5 and laravel
Attributes of classfile
Supplier selection and prequalification of Oracle project management system
"Interview high frequency question" is 1.5/5 difficult, and the classic "prefix and + dichotomy" application question
Machine learning practice: is Mermaid a love movie or an action movie? KNN announces the answer
我服了,MySQL表500W行,居然有人不做分区?
Redis installation and deployment (windows/linux)
别找了,Chrome浏览器必装插件都在这了
Say goodbye to 996. What are the necessary plug-ins in idea?
Solutions to Chinese garbled code in CMD window
Long summary (code with comments) number structure (C language) -- Chapter 4, string (Part 1)