当前位置:网站首页>[PHP vulnerability weak type] basic knowledge, PHP weak equality, error reporting and bypassing
[PHP vulnerability weak type] basic knowledge, PHP weak equality, error reporting and bypassing
2022-07-03 04:38:00 【Black zone (rise)】
Catalog
1.1、 Congruence (===) Be equal to (==)
2.3、 The function compares sizes to bypass
One 、 Basic knowledge of
1.1、 Congruence (===) Be equal to (==)
To compare whether two values are equal, you can use “==” and “===”
seeing the name of a thing one thinks of its function
“===” Congruence means that all forms are equal ( Strong is equal to )
“==” If it is equal, it will undergo type conversion ( Weak is equal to )
1.2、 Equal value
'' == 0 == false
'123' == 123
'abc' == 0
'123a' == 123
'0x01' == 1
'0e123456789' == '0e987654321'
[false] == [0] == [NULL] == ['']
NULL == false == 0
true == 1
Two 、 Weak type example
2.1、 Weak equality
Example :
if($_GET['a']!=$_GET['b'] && md5($_GET['a'])==md5($_GET['b'])){
echo $flag;
}Ideas :
To make a and b The value of is not equal to , but md5 The values are equal ----->flag
adopt MD5 Collision to achieve
2.2、 Strong equality
Example :
if($_GET['a']!=$_GET['b'] && md5($_GET['a'])===md5($_GET['b'])){
echo $flag;
}Ideas :
By using PHP The characteristics of function in error handling
Submit a[]=1&b[]=2, When we make MD5 When the parameter of the function is an array , The function will report an error and return NULL value .
Although the parameters of the function are two different arrays , But the return value of the function is the same NULL, Successfully bypassed .
Among the return values, it is easy to judge the wrong functions, and many return values are 0, and 0==false Is established , It can also achieve the purpose of bypassing
2.3、 The function compares sizes to bypass
Example :
if(is_numeric($b)){
exit();
}
if($b>10000){
echo $flag;
}Ideas :
Parameters b----> Greater than 10000----> obtain flag
to b assignment 10001a, After type conversion , Greater than 10000
边栏推荐
- Joint search set: the number of points in connected blocks (the number of points in a set)
- STM32 reverse entry
- 怎么用Kotlin去提高生产力:Kotlin Tips
- Php+mysql registration landing page development complete code
- I've been in software testing for 8 years and worked as a test leader for 3 years. I can also be a programmer if I'm not a professional
- [PCL self study: filtering] introduction and use of various filters in PCL (continuously updated)
- Why does I start with =1? How does this code work?
- The usage of micro service project swagger aggregation document shows all micro service addresses in the form of swagger grouping
- 联发科技2023届提前批IC笔试(题目)
- P35-P41 fourth_ context
猜你喜欢

MC Layer Target

Arthas watch grabs a field / attribute of the input parameter

Design and implementation of JSP logistics center storage information management system

Youdao cloud notes

Learning practice: comprehensive application of cycle and branch structure (I)

Leetcode simple question: check whether the array is sorted and rotated

Triangular rasterization

vulnhub HA: Natraj

2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical
![[free completion] development of course guidance platform (source code +lunwen)](/img/14/7c1c822bda050a805fa7fc25b802a4.jpg)
[free completion] development of course guidance platform (source code +lunwen)
随机推荐
FFMpeg filter
AWS VPC
X-ray normal based contour rendering
《牛客刷verilog》Part II Verilog进阶挑战
BMZCTF simple_ pop
Priv app permission exception
Factor stock selection scoring model
Hj35 serpentine matrix
Priv-app permission异常
Why should programmers learn microservice architecture if they want to enter a large factory?
Day 51 - tree problem
使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
[pat (basic level) practice] - [simple simulation] 1063 calculate the spectral radius
JS multidimensional array to one-dimensional array
关于开学的准备与专业认知
I've seen a piece of code in the past. I don't know what I'm doing. I can review it when I have time
FuncS sh file not found when using the benchmarksql tool to test kingbases
The simple problem of leetcode: dismantling bombs
Ffmpeg mix
How to use kotlin to improve productivity: kotlin tips