弱类型
哈希绕过
变量覆盖
弱类型语言
===在进行比较时,会先判断两种字符串的类型是否相等。==会在比较之前会将字符串转化为相同类型再比较。
例如1==ture 结果是ture
但是1===ture 结果是false
![](https://img-blog.csdnimg.cn/img_convert/4dce06fcc1c84254025f1f179d5a441e.png)
*注意最后一个
最后一个是科学计数法的形式,0乘以任何数都是0,所以两者相等。
![](https://img-blog.csdnimg.cn/img_convert/5a5d610a73b8556054d38f7dbc489516.png)
题目训练:
![](https://img-blog.csdnimg.cn/img_convert/0059cf25012578a25c94e9d4cfc60de0.png)
解题过程:
首先看到json_decode,不认识,百度一下。
![](https://img-blog.csdnimg.cn/img_convert/99fe8875dc3e08c2a469a12c44272d0c.png)
了解题目要求之后,开始做题。发现题目当中
![](https://img-blog.csdnimg.cn/img_convert/44beb31cfc81f3ebb9e2944a24951ccf.png)
看到是弱相等,使用hackbar post提交一个数据,推测key的内容是admin(字符串),结果如下图。
![](https://img-blog.csdnimg.cn/img_convert/c0e46e5f67dba741d4b29bd3fcf35665.png)
显示fail,显然错误。开头不为0,输入数字,拿到flag。
![](https://img-blog.csdnimg.cn/img_convert/007bbc89d3f74d2c799eae20a75fbd46.png)
哈希绕过
Md5绕过
登陆的哈希验证
例如:
![](https://img-blog.csdnimg.cn/img_convert/c0ea5ad1042836089735d4e30b41e358.png)
弱相等就用0e开头的MD5
![](https://img-blog.csdnimg.cn/img_convert/d1f043a862e7be184d5e1b30e0eddcab.png)
将a和b换成它们明文,它们哈希值相等。
贴一篇0e开头MD5值小结
https://blog.csdn.net/Fly_hps/article/details/104702138
如果题目中是强相等(===),可以采用数组方法。
![](https://img-blog.csdnimg.cn/img_convert/37be054308293e1299d14e29bebc91aa.png)
哈希绕过第三层,全是字符串且要求强相等。需要进行MD5碰撞。
![](https://img-blog.csdnimg.cn/img_convert/69e212ad434324816689b7030f71e902.png)
![](https://img-blog.csdnimg.cn/img_convert/408c7a18ff42a8631e9324868b012bdd.png)
变量覆盖
用传参的值替换掉原有变量的值。
需要利用Extract()函数
![](https://img-blog.csdnimg.cn/img_convert/7f03f36092c958fe1a9557c7484e42ba.png)
简单来说,将原来变量的值替换掉。
或者用到Parse_str函数
![](https://img-blog.csdnimg.cn/img_convert/5a9c0361dae28eda35887a24ffaec8b8.png)
例题分析
![](https://img-blog.csdnimg.cn/img_convert/83d7646813d6ca4ab0b4ebc65eb7ea31.png)
首先看到MD5,而且是弱相等。
![](https://img-blog.csdnimg.cn/img_convert/319fbe429060b372a35f59dae772fe62.png)
发现QNKCDZO的MD5值是纯数字科学计数法,0e830400451993494058024219903391
![](https://img-blog.csdnimg.cn/img_convert/c477110734f76222ef33db60127aca30.png)
要传一个字符串,和QNKCDZO不相等,但是MD5和它相等,结合前面,找一个即可。
上传参数即可。
![](https://img-blog.csdnimg.cn/img_convert/6f6f5317272e46ac92bbe43dd02b868c.png)
感悟:需要加强对php语言的学习。
*本篇文章参考bilibili视频:BV1oM41117WG
*图片来源:https://www.bilibili.com/video/BV1oM41117WG/?spm_id_from=333.337.search-card.all.click
https://www.sojson.com/encrypt_md5.html (MD5在线转换)
*如有侵权请联系删除。