当前位置:网站首页>[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
边栏推荐
- stm32逆向入门
- FISCO bcos zero knowledge proof Fiat Shamir instance source code
- FFMpeg filter
- [set theory] binary relationship (special relationship type | empty relationship | identity relationship | global relationship | divisive relationship | size relationship)
- 2022 registration of G2 utility boiler stoker examination and G2 utility boiler stoker reexamination examination
- [fxcg] inflation differences will still lead to the differentiation of monetary policies in various countries
- 怎么用Kotlin去提高生产力:Kotlin Tips
- JVM原理简介
- Day 51 - tree problem
- 2022 new examination questions for the main principals of hazardous chemical business units and examination skills for the main principals of hazardous chemical business units
猜你喜欢
Know that Chuangyu cloud monitoring - scanv Max update: Ecology OA unauthorized server request forgery and other two vulnerabilities can be detected
《牛客刷verilog》Part II Verilog进阶挑战
MC Layer Target
Solve BP Chinese garbled code
关于开学的准备与专业认知
arthas watch 抓取入参的某个字段/属性
Number of 1 in binary (simple difficulty)
Introduction to message queuing (MQ)
使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found
Triangular rasterization
随机推荐
[software testing-6] & Test Management
2022 t elevator repair simulation examination question bank and t elevator repair simulation examination question bank
X-ray normal based contour rendering
Asp access teaching management system design finished product
vulnhub HA: Natraj
Hj35 serpentine matrix
[fxcg] market analysis today
Priv-app permission异常
[fairseq] error: typeerror:_ broadcast_ coalesced(): incompatible function arguments
使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
Leetcode simple question: check whether two string arrays are equal
Design and implementation of JSP logistics center storage information management system
2022 chemical automation control instrument examination summary and chemical automation control instrument certificate examination
Priv app permission exception
Summary of training competition (Lao Li's collection of questions)
2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
金仓数据库KingbaseES 插件kdb_date_function
Sdl2 + OpenGL glsl practice (Continued)
Small sample target detection network with attention RPN and multi relationship detector (provide source code, data and download)
2.14 summary