当前位置:网站首页>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 !!!
边栏推荐
- 扁平数组和JSON树的转换
- 管理系统-ITclub(下)
- 从学生到工程师的蜕变之路
- Remote invocation of microservices
- Exclusive interview with millions of annual salary. What should developers do if they don't fix bugs?
- [LeetCode]100. Same tree
- Go from introduction to actual combat - task cancellation (note)
- 【Redis】零基础十分钟学会Redis
- Go from introduction to practice - error mechanism (note)
- xpath
猜你喜欢

读写分离-Mysql的主从复制
扁平数组和JSON树的转换

Experience sharing of meituan 20K Software Test Engineers

C language programming detailed version (learning note 1) I can't understand it after reading, and I can't help it.

Management system itclub (Part 2)

Yolov6: the fast and accurate target detection framework is open source

【Redis】零基础十分钟学会Redis

對話喬心昱:用戶是魏牌的產品經理,零焦慮定義豪華

This set of steps for performance testing using JMeter includes two salary increases and one promotion
Conversion between flat array and JSON tree
随机推荐
How to do function test well? Are you sure you don't want to know?
MONTHS_BETWEEN函数使用
Gbase 8A OLAP analysis function cume_ Example of dist
MySQL greater than less than or equal to symbol representation
Go from introduction to actual combat - execute only once (note)
美团20k软件测试工程师的经验分享
Go from introduction to practice -- definition and implementation of behavior (notes)
Dynamic refresh mapper
Matlab finds the position of a row or column in the matrix
登录凭证(cookie+session和Token令牌)
大厂常用软件测试面试题三(附答案)
OpenSSL Programming II: building CA
Codeforces Round #723 (Div. 2)
[LeetCode]513. Find the value in the lower left corner of the tree
Crontab scheduled task common commands
Luogu p5706 redistributing fertilizer and house water
使用sqlite3语句后出现省略号 ... 的解决方法
Système de gestion - itclub (II)
Interval DP of Changyou dynamic programming
Gbase 8A OLAP analysis function cume_ Example of dist