当前位置:网站首页>sqlilabs less-32~less-33
sqlilabs less-32~less-33
2022-07-29 02:56:00 【It's always late at night.】
sqlilabs less-32~less-33
)
less-32
Early judgment

I give id Assign values and then nothing .
See a code in the source code , The comment will show , But this thing should not be annotated , Subsequent experiments need to use .

Although there is a big problem in the environment, I think of wide byte injection when I see that line of code .
Wide byte Injection
Although we can't do experiments, we can still do illusory experiments , Let's talk about the principle first .
because GBK Two byte encoding is required , and ascii Just one byte , So called GBK This type is called wide byte . If two ascii Bytes are connected to a pile , It will be mistaken for a wide byte character .
This experiment
Because the code mysql_query("SET NAMES gbk");, It can lead to MYSQL Part of the code is changed to gbk

I want to see others php What is the code , yes UTF-8( stay UTF-8 Chinese characters account for 3 To 4 Bytes ).
php Will be generated through this code sql Sentence to MYSQL,MYSQL When receiving the request, the content of the request will be changed from character_set_client Convert to character_set_connection.

Then take it. character_set_connection Convert to internal operation character set , Use character_set The value of converts the internal operation character set character_set_results, Then press character_set_results Code output .

Where is the injection point , stay character_set_client, because MYSQL received php The coding sql After using character_set_client Code again .
Take an example to understand , Because in order to avoid users entering some unnecessary data , Add a backslash to the vulgar characters “\“ Transference , For example, when entering English single quotation marks " ’ " Will be escaped as " \ ’ ".
Suppose we enter English single quotation marks , Then it is filtered and escaped as a backslash plus English single quotation marks , It will lead to injection failure . If we enter greater than 127 Of ascii Character plus a character , Columns such as %df’.
%df‘ %df‘ ’ Will be escaped as \',\ ascii Code is %5c
%df%5c’ Because the first of the two bytes ascii Code greater than 127 It will be regarded as Chinese characters together with the next byte .
-
Yun ’ after MYSQL Of GBK After coding, it becomes like this
Escaped symbols “\” By “%df” With it, it becomes “ Yun ”, It bypasses the escape .
So this experiment should be -1%df%27union%20select%201,user(),3--+
less-33
my less-33 The title is less-32, No accident or with less-32 The same as , No feedback .

Look at the source code to find addslashes


and less-32 Empathy , Inject with wide bytes .
边栏推荐
猜你喜欢

冰冰学习笔记:运算符重载---日期类的实现

PHP lucky draw system with background source code

区区区间---线段树lazy标记板子题

MongoDB索引 (3)

STP protocol (spanning tree protocol)

Wechat applet - Advanced chapter Lin UI component library source code analysis button component (II)

PHP process communication series (I) named pipes

C language: hollow square pattern

Analyzing the subjective consciousness of emotional resonance between robots and human beings

6-21 vulnerability exploitation MySQL weak password cracking
随机推荐
会议OA项目之我的审批功能
并发模式之生产者消费者模式
Jinshan cloud returns to Hong Kong for listing: Hong Kong stock rush of Chinese to B cloud manufacturers
SQL查询数据之多表(关联)查询
DHCP protocol detailed analysis
MySQL - count(字段)、count(主键)、count(1)、count(*)的区别
区区区间---线段树lazy标记板子题
盘点国内外项目协同管理软件:SaaS和定制化成趋势
Mysql复合查询(重要)
6-21 vulnerability exploitation MySQL weak password cracking
STP协议(生成树协议)
seed 随机种子
关于时间复杂度的一些新认识
[opencv] use OpenCV to call mobile camera
Summary of classic problems in Flink production environment
vim常用命令
HTB-Blue
11.书写规则-伪目标
Analysis of OWT server source code (III) -- video module analysis of mixer in
Asemi rectifier bridge s25vb100, s25vb100 parameters, s25vb100 application