当前位置:网站首页>[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
边栏推荐
- A outsourcing boy's mid-2022 summary
- Why does I start with =1? How does this code work?
- 【PHP漏洞-弱类型】基础知识、php弱相等、报错绕过
- 商城系统搭建完成后需要设置哪些功能
- Web security - CSRF (token)
- AWS VPC
- stm32逆向入门
- 2022 P cylinder filling test content and P cylinder filling simulation test questions
- [pat (basic level) practice] - [simple simulation] 1063 calculate the spectral radius
- Preliminary cognition of C language pointer
猜你喜欢
Leetcode simple question: check whether two string arrays are equal
有道云笔记
Learning practice: comprehensive application of cycle and branch structure (I)
X-ray normal based contour rendering
金仓KFS数据双向同步场景部署
Prefix and (continuously updated)
Handling record of electric skateboard detained by traffic police
Know that Chuangyu cloud monitoring - scanv Max update: Ecology OA unauthorized server request forgery and other two vulnerabilities can be detected
When using the benchmarksql tool to test the concurrency of kingbasees, there are sub threads that are not closed in time after the main process is killed successfully
Leetcode simple question: check whether the string is an array prefix
随机推荐
Employee attendance management system based on SSM
Games101 Lesson 9 shading 3 Notes
Leetcode simple question: check whether two string arrays are equal
After job hopping at the end of the year, I interviewed more than 30 companies in two weeks and finally landed
The programmer went to bed at 12 o'clock in the middle of the night, and the leader angrily scolded: go to bed so early, you are very good at keeping fit
General undergraduate college life pit avoidance Guide
金仓数据库KingbaseES 插件kdb_exists_expand
When using the benchmarksql tool to preheat data for kingbasees, execute: select sys_ Prewarm ('ndx_oorder_2 ') error
4 years of experience to interview test development, 10 minutes to end, ask too
Introduction to message queuing (MQ)
Human resource management system based on JSP
When using the benchmarksql tool to test the concurrency of kingbasees, there are sub threads that are not closed in time after the main process is killed successfully
Symbol of array element product of leetcode simple problem
Function introduction of member points mall system
智能合约安全审计公司选型分析和审计报告资源下载---国内篇
C language self-made Games: Sanzi (tic tac toe chess) intelligent chess supplement
C primre plus Chapter 10 question 6 inverted array
7. Integrated learning
Summary of training competition (Lao Li's collection of questions)
2022 t elevator repair simulation examination question bank and t elevator repair simulation examination question bank