当前位置:网站首页>【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
边栏推荐
- [pat (basic level) practice] - [simple simulation] 1063 calculate the spectral radius
- 解决bp中文乱码
- 4 years of experience to interview test development, 10 minutes to end, ask too
- Library management system based on SSM
- MC Layer Target
- What's wrong with SD card data damage? How to recover SD card data damage
- Joint search set: the number of points in connected blocks (the number of points in a set)
- X-ray normal based contour rendering
- [literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
- 540. Single element in ordered array
猜你喜欢

Design and implementation of JSP logistics center storage information management system

Smart contract security audit company selection analysis and audit report resources download - domestic article

会员积分商城系统的功能介绍

Dismantle a 100000 yuan BYD "Yuan". Come and see what components are in it.

Which Bluetooth headset is good about 400? Four Bluetooth headsets with strong noise reduction are recommended

Php+mysql registration landing page development complete code

Busycal latest Chinese version

The programmer went to bed at 12 o'clock in the middle of the night, and the leader angrily scolded: go to bed so early, you are very good at keeping fit

Introduction of pointer variables in function parameters

4 years of experience to interview test development, 10 minutes to end, ask too
随机推荐
使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
Fcpx template: sweet memory electronic photo album photo display animation beautiful memory
Some information about the developer environment in Chengdu
FFMpeg example
Wine travel Jianghu War: Ctrip is strong, meituan is strong, and Tiktok is fighting
Kingbasees plug-in KDB of Jincang database_ database_ link
[BMZCTF-pwn] 20-secret_ file
FFMpeg filter
AWS VPC
Design and implementation of JSP logistics center storage information management system
[set theory] ordered pair (ordered pair | ordered triple | ordered n ancestor)
Solve BP Chinese garbled code
Kingbasees plug-in KDB of Jincang database_ exists_ expand
Dive Into Deep Learning——2.1数据操作&&练习
Crazy scientist
会员积分商城系统的功能介绍
JS multidimensional array to one-dimensional array
重绘和回流
Matplotlib -- save graph
How to choose cross-border e-commerce multi merchant system