当前位置:网站首页>【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
边栏推荐
- [set theory] set operation (Union | intersection | disjoint | relative complement | symmetric difference | absolute complement | generalized union | generalized intersection | set operation priority)
- vulnhub HA: Natraj
- 使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
- 金仓KFS数据双向同步场景部署
- Redis persistence principle
- 220214c language learning diary
- [software testing-6] & Test Management
- 2022 t elevator repair simulation examination question bank and t elevator repair simulation examination question bank
- Priv-app permission异常
- Classes in TS
猜你喜欢

C language series - Section 3 - functions

Bugku CTF daily question baby_ flag. txt

金仓KFS数据双向同步场景部署
![[Thesis Writing] how to write the overall design of JSP tourism network](/img/02/841e8870c2ef871c182b9bb8252a83.jpg)
[Thesis Writing] how to write the overall design of JSP tourism network
![[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

消息队列(MQ)介绍

2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical

vulnhub HA: Natraj
![[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

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
随机推荐
Which code editor is easy to use? Code editing software recommendation
使用BENCHMARKSQL工具对kingbasees并发测试时kill掉主进程成功后存在子线程未及时关闭
Xrandr modifier la résolution et le taux de rafraîchissement
解决bp中文乱码
商城系统搭建完成后需要设置哪些功能
What functions need to be set after the mall system is built
Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended
[dynamic programming] subsequence problem
FISCO bcos zero knowledge proof Fiat Shamir instance source code
FFMpeg example
Games101 Lesson 9 shading 3 Notes
C Primer Plus Chapter 10, question 14 3 × 5 array
redis 持久化原理
JVM原理简介
AWS VPC
Learning practice: comprehensive application of cycle and branch structure (I)
Factor stock selection scoring model
Summary of training competition (Lao Li's collection of questions)
[BMZCTF-pwn] 20-secret_ file
xrandr修改分辨率與刷新率