当前位置:网站首页>【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
边栏推荐
- [fxcg] inflation differences will still lead to the differentiation of monetary policies in various countries
- Basic use of continuous integration server Jenkins
- [set theory] set identities (idempotent law | exchange law | combination law | distribution rate | De Morgan law | absorption rate | zero law | identity | exclusion law | contradiction law | complemen
- The simple problem of leetcode: dismantling bombs
- 会员积分商城系统的功能介绍
- 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
- P35-P41 fourth_ context
- Contents of welder (primary) examination and welder (primary) examination in 2022
- Solve BP Chinese garbled code
- Ffmpeg tanscoding transcoding
猜你喜欢
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
C language series - Section 3 - functions
data2vec! New milestone of unified mode
2022 Shandong Province safety officer C certificate examination content and Shandong Province safety officer C certificate examination questions and analysis
Integration of Android high-frequency interview questions (including reference answers)
X-ray normal based contour rendering
Web - Information Collection
使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
消息队列(MQ)介绍
After reviewing MySQL for a month, I was stunned when the interviewer of Alibaba asked me
随机推荐
PostgreSQL database high availability Patroni source code learning - etcd class
怎么用Kotlin去提高生产力:Kotlin Tips
[pat (basic level) practice] - [simple simulation] 1063 calculate the spectral radius
Games101 Lesson 9 shading 3 Notes
GFS分布式文件系统(光是遇见已经很美好了)
智能合约安全审计公司选型分析和审计报告资源下载---国内篇
使用BENCHMARKSQL工具对kingbasees并发测试时kill掉主进程成功后存在子线程未及时关闭
多板块轮动策略编写技巧----策略编写学习教材
[set theory] binary relationship (special relationship type | empty relationship | identity relationship | global relationship | divisive relationship | size relationship)
2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills
Introduction of pointer variables in function parameters
Data Lake three swordsmen -- comparative analysis of delta, Hudi and iceberg
2022-02-14 (394. String decoding)
Prefix and (continuously updated)
Some information about the developer environment in Chengdu
金仓数据库KingbaseES 插件kdb_exists_expand
[software testing-6] & Test Management
IPhone x forgot the boot password
Web - Information Collection
[Thesis Writing] how to write the overall design of JSP tourism network