当前位置:网站首页>【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
边栏推荐
- Joint search set: the number of points in connected blocks (the number of points in a set)
- stm32逆向入门
- How to use kotlin to improve productivity: kotlin tips
- [set theory] binary relationship (binary relationship notation | binary relationship from a to B | number of binary relationships | example of binary relationship)
- Basic types of data in TS
- [Chongqing Guangdong education] reference materials for design and a better life of Zhongyuan Institute of science and technology
- [software testing-6] & Test Management
- Which code editor is easy to use? Code editing software recommendation
- When using the benchmarksql tool to preheat data for kingbasees, execute: select sys_ Prewarm ('ndx_oorder_2 ') error
- Use the benchmarksql tool to perform a data prompt on kingbases. The jdbc driver cannot be found
猜你喜欢
![[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN](/img/7e/50fa6f65b5a4f0bb60909f57daff56.png)
[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN

Design and implementation of JSP logistics center storage information management system

GFS distributed file system (it's nice to meet it alone)

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

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

7. Integrated learning

Fcpx template: sweet memory electronic photo album photo display animation beautiful memory

使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found

Internationalization and localization, dark mode and dark mode in compose

Know that Chuangyu cloud monitoring - scanv Max update: Ecology OA unauthorized server request forgery and other two vulnerabilities can be detected
随机推荐
Ffmpeg mix
Xrandr modifier la résolution et le taux de rafraîchissement
2022-02-13 (347. Top k high frequency elements)
Mount NFS in kubesphere
GFS distributed file system (it's nice to meet it alone)
C language series - Section 3 - functions
Employee attendance management system based on SSM
跨境电商多商户系统怎么选
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
[software testing-6] & Test Management
Web - Information Collection
What functions need to be set after the mall system is built
Ffmpeg tanscoding transcoding
会员积分商城系统的功能介绍
sd卡数据损坏怎么回事,sd卡数据损坏怎么恢复
Dive Into Deep Learning——2.1数据操作&&练习
Php+mysql registration landing page development complete code
Joint search set: the number of points in connected blocks (the number of points in a set)
Introduction of pointer variables in function parameters
因子选股-打分模型