当前位置:网站首页>【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
- 商城系统搭建完成后需要设置哪些功能
- 使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
- [set theory] binary relationship (special relationship type | empty relationship | identity relationship | global relationship | divisive relationship | size relationship)
- 金仓KFS数据双向同步场景部署
- 2022 registration of G2 utility boiler stoker examination and G2 utility boiler stoker reexamination examination
- Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended
- xrandr修改分辨率與刷新率
- FFMpeg filter
- RSRS index timing and large and small disc rotation
猜你喜欢
MC Layer Target
Dismantle a 100000 yuan BYD "Yuan". Come and see what components are in it.
How to retrieve the password for opening word files
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
Basic use of continuous integration server Jenkins
使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found
[free completion] development of course guidance platform (source code +lunwen)
Leetcode simple question: the key with the longest key duration
Data Lake three swordsmen -- comparative analysis of delta, Hudi and iceberg
Preliminary cognition of C language pointer
随机推荐
2022 registration of G2 utility boiler stoker examination and G2 utility boiler stoker reexamination examination
金仓数据库KingbaseES 插件kdb_exists_expand
How to choose cross-border e-commerce multi merchant system
商城系统搭建完成后需要设置哪些功能
[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
How to use kotlin to improve productivity: kotlin tips
2022 P cylinder filling test content and P cylinder filling simulation test questions
因子选股-打分模型
How to retrieve the password for opening word files
Square root of X
BMZCTF simple_ pop
Truncated sentences of leetcode simple questions
FFMpeg example
MC Layer Target
redis 持久化原理
Busycal latest Chinese version
xrandr修改分辨率與刷新率
Contents of welder (primary) examination and welder (primary) examination in 2022
Smart contract security audit company selection analysis and audit report resources download - domestic article
Dive Into Deep Learning——2.1数据操作&&练习