当前位置:网站首页>【PHP漏洞-弱类型】基础知识、php弱相等、报错绕过
【PHP漏洞-弱类型】基础知识、php弱相等、报错绕过
2022-07-03 04:33:00 【黑色地带(崛起)】
目录
一、基础知识
1.1、全等(===)和相等(==)
比较两个值是否相等可以用“==”和“===”
顾名思义
“===”全等就是格式形式都相等(强等于)
“==”相等就会进行类型转换(弱等于)
1.2、相等的值
'' == 0 == false
'123' == 123
'abc' == 0
'123a' == 123
'0x01' == 1
'0e123456789' == '0e987654321'
[false] == [0] == [NULL] == ['']
NULL == false == 0
true == 1
二、弱类型示例
2.1、弱相等
示例:
if($_GET['a']!=$_GET['b'] && md5($_GET['a'])==md5($_GET['b'])){
echo $flag;
}思路:
要使得a和b的值不等,但md5值相等----->flag
通过MD5碰撞来实现
2.2、强相等
示例:
if($_GET['a']!=$_GET['b'] && md5($_GET['a'])===md5($_GET['b'])){
echo $flag;
}思路:
通过利用PHP函数在错误处理上的特性
提交a[]=1&b[]=2,当我们令MD5函数的参数为一个数组的时候,函数会报错并返回NULL值。
虽然函数的参数是两个不同的数组,但函数的返回值是相同的NULL,成功绕过。
返回值中容易判断错误的函数还有很多返回值是0,而0==false是成立的,也能达到绕过的目的
2.3、函数比较大小绕过
示例:
if(is_numeric($b)){
exit();
}
if($b>10000){
echo $flag;
}思路:
参数b---->大于10000---->获取flag
给b赋值10001a,类型转换后,大于10000
边栏推荐
- Reptile exercise 03
- 会员积分商城系统的功能介绍
- [BMZCTF-pwn] 20-secret_ file
- MySQL field userid comma separated save by userid query
- [Chongqing Guangdong education] reference materials for design and a better life of Zhongyuan Institute of science and technology
- [free completion] development of course guidance platform (source code +lunwen)
- Two points -leetcode-540 A single element in an ordered array
- Triangular rasterization
- 金仓数据库KingbaseES 插件kdb_database_link
- Which Bluetooth headset is good about 400? Four Bluetooth headsets with strong noise reduction are recommended
猜你喜欢
![[pat (basic level) practice] - [simple simulation] 1063 calculate the spectral radius](/img/01/c118725f74e39742df021b5dbcc33b.jpg)
[pat (basic level) practice] - [simple simulation] 1063 calculate the spectral radius

Arthas watch grabs a field / attribute of the input parameter

智能合约安全审计公司选型分析和审计报告资源下载---国内篇

Pyqt control part (II)

vulnhub HA: Natraj

Two drawing interfaces - 1 Matlab style interface

使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found
![[free completion] development of course guidance platform (source code +lunwen)](/img/14/7c1c822bda050a805fa7fc25b802a4.jpg)
[free completion] development of course guidance platform (source code +lunwen)

Contents of welder (primary) examination and welder (primary) examination in 2022

Auman Galaxy new year of the tiger appreciation meeting was held in Beijing - won the double certification of "intelligent safety" and "efficient performance" of China Automotive Research Institute
随机推荐
Design and implementation of JSP logistics center storage information management system
[BMZCTF-pwn] 20-secret_ file
Integration of Android high-frequency interview questions (including reference answers)
Reptile exercise 02
xrandr修改分辨率與刷新率
Xrandr modify resolution and refresh rate
X-ray normal based contour rendering
PostgreSQL database high availability Patroni source code learning - etcd class
使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
[set theory] binary relationship (definition field | value field | inverse operation | inverse synthesis operation | restriction | image | single root | single value | nature of synthesis operation)
Data Lake three swordsmen -- comparative analysis of delta, Hudi and iceberg
Ffmpeg mix
A outsourcing boy's mid-2022 summary
Truncated sentences of leetcode simple questions
Library management system based on SSM
data2vec! New milestone of unified mode
[BMZCTF-pwn] 18-RCTF-2017-Recho
7. Integrated learning
C language series - Section 3 - functions
Joint search set: the number of points in connected blocks (the number of points in a set)