当前位置:网站首页>Infiltration learning - problems encountered during SQL injection - explanation of sort=left (version(), 1) - understanding of order by followed by string
Infiltration learning - problems encountered during SQL injection - explanation of sort=left (version(), 1) - understanding of order by followed by string
2022-06-27 22:28:00 【dfzy$_$】
Problem scenario :
This is mainly to explain some problems encountered in my shooting range , That is to say sqllibs Of Less46 Off use sort=left(version(),1) The reason why it can still be echoed normally , And right order by Followed by a string varchar Character types can also be interpreted normally .
Cause analysis :
Yes left This function is in order by After the explanation :
First , Here is the main explanation left(version(),1) Here means to take from the left version() First digit of value , in other words version()=5.7.26 Words , that left This will be equal to 5.
And here's the thing to note , The resulting value here , When placed in order by Then there is a string type ( namely varchar type ), That is to say, it is equivalent to order by “5” In this form . therefore , Whether it's mid left still right All that comes out is “ String of numeric content ”, Sorting it still uses character rules , Will not get the result we want .
Yes order by Understanding of the following string :
Suppose we take order by "5" To execute , that mysql Will literally mean “ By number 5 Sort ”, Instead of sorting by the fifth column in the table (order by 5 It means sorting by the fifth column ).
If you are sorting by character rules , This is not going to happen MySQL( Unless some versions are improved ) Generate the correct sort in , Except by chance . If nothing else is done ( Such as addition, deletion and modification ) Words , This will be sorted according to the sort table in the disk ( That is, the order in which data is read from the disk . This should be determined by the default read mode of the file system or disk ).
That is, no matter what you type in the string , Sorting is basically the default .
Input "5":
Input "less38"
Input 1
Input left(version(),1):
As can be seen from the above , No matter what string you enter , The sorting is the same , because order by Sorting by character set is invalid ,mysql At this point, the disk order table will be sorted by default .
Conclusion
That's what I understand , If there is any mistake, please point it out !!!
边栏推荐
- Luogu p5706 redistributing fertilizer and house water
- 管理系统-ITclub(中)
- \w和[A-Za-z0-9_],\d和[0-9]等价吗?
- 百万年薪独家专访,开发人员不修复bug怎么办?
- 记一次List对象遍历及float类型判断大小
- Gbase 8A OLAP analysis function cume_ Example of dist
- Gbase 8A OLAP analysis function cume_ Example of dist
- Record a list object traversal and determine the size of the float type
- Management system itclub (Part 2)
- Hash table - sum of arrays
猜你喜欢

7 jours d'apprentissage de la programmation simultanée go 7 jours de programmation simultanée go Language Atomic Atomic Atomic actual Operation contains ABA Problems

Codeforces Round #723 (Div. 2)

Luogu p5706 redistributing fertilizer and house water
![[MySQL] database function clearance Tutorial Part 2 (window function topic)](/img/03/2b37e63d0d482d5020b7421ac974cb.jpg)
[MySQL] database function clearance Tutorial Part 2 (window function topic)

Day 7 of "learning to go concurrent programming in 7 days" go language concurrent programming atomic atomic actual operation includes ABA problem

读写分离-Mysql的主从复制

Codeforces Round #717 (Div. 2)

Codeforces Round #719 (Div. 3)

Test birds with an annual salary of 50w+ are using this: JMeter script development -- extension function

Système de gestion - itclub (II)
随机推荐
AQS SOS AQS with me
QT large file generation MD5 check code
Contest 2050 and Codeforces Round #718 (Div. 1 + Div. 2)
The create database of gbase 8A takes a long time to query and is suspected to be stuck
Professor of Tsinghua University: software testing has gone into a misunderstanding - "code is necessary"
對話喬心昱:用戶是魏牌的產品經理,零焦慮定義豪華
Summary of Web testing and app testing by bat testing experts
正则表达式
YOLOv6:又快又准的目标检测框架开源啦
爬虫笔记(2)- 解析
Codeforces Round #717 (Div. 2)
《7天学会Go并发编程》第六天 go语言Sync.cond的应用和实现 go实现多线程联合执行
深度学习又有新坑了!悉尼大学提出全新跨模态任务,用文本指导图像进行抠图
宏任务、微任务理解
Yarn performance tuning of CDH cluster
【Redis】零基础十分钟学会Redis
Codeforces Round #716 (Div. 2)
Macro task and micro task understanding
使用Jmeter进行性能测试的这套步骤,涨薪2次,升职一次
How to design an elegant caching function