当前位置:网站首页>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 !!!
边栏推荐
- This set of steps for performance testing using JMeter includes two salary increases and one promotion
- Interval DP of Changyou dynamic programming
- Interview question 3 of software test commonly used by large factories (with answers)
- [LeetCode]572. A subtree of another tree
- Contest 2050 and Codeforces Round #718 (Div. 1 + Div. 2)
- I think I should start writing my own blog.
- 单元测试界的高富帅,Pytest框架,手把手教学,以后测试报告就这么做~
- Acwing weekly contest 57- digital operation - (thinking + decomposition of prime factor)
- Figure countdownlatch and cyclicbarrier based on AQS queue
- Yarn中RMApp、RMAppAttempt、RMContainer和RMNode状态机及其状态转移
猜你喜欢

Go from introduction to practice - error mechanism (note)

Codeforces Round #719 (Div. 3)

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

清华大学教授:软件测试已经走入一个误区——“非代码不可”

管理系统-ITclub(上)

单元测试界的高富帅,Pytest框架,手把手教学,以后测试报告就这么做~

管理系统-ITclub(中)

crontab定时任务常用命令

Windwos 8.1系统安装vmware tool插件报错的解决方法

Yolov6: the fast and accurate target detection framework is open source
随机推荐
軟件測試自動化測試之——接口測試從入門到精通,每天學習一點點
Dynamic refresh mapper
CDH集群之YARN性能调优
Fill in the blank of rich text test
Yarn performance tuning of CDH cluster
Do280openshift access control -- Security Policy and chapter experiment
北京邮电大学|用于成本和延迟敏感的虚拟网络功能放置和路由的多智能体深度强化学习
OpenSSL programming I: basic concepts
Gbase 8A method for reducing the impact on the system by controlling resource usage through concurrency during node replacement of V8 version
Selenium上传文件有多少种方式?不信你有我全!
I think I should start writing my own blog.
《7天學會Go並發編程》第7天 go語言並發編程Atomic原子實戰操作含ABA問題
How to design an elegant caching function
Codeforces Round #719 (Div. 3)
QT large file generation MD5 check code
Solve the problem that the virtual machine cannot be connected locally
\w和[A-Za-z0-9_],\d和[0-9]等价吗?
C language programming detailed version (learning note 1) I can't understand it after reading, and I can't help it.
Go from introduction to practice -- shared memory concurrency mechanism (notes)
Beijing University of Posts and Telecommunications - multi-agent deep reinforcement learning for cost and delay sensitive virtual network function placement and routing