当前位置:网站首页>Bugkuctf-web16 (backup is a good habit)
Bugkuctf-web16 (backup is a good habit)
2022-07-02 09:40:00 【hangshao0.0】
The main point of solving the problem
Use the sword 、dirmap perhaps dirsearch Wait for a scan tool , Clean the location of the backup file
Open the backup file , The code is as follows :
<?php /** * Created by PhpStorm. * User: Norse * Date: 2017/8/6 * Time: 20:22 */ include_once "flag.php"; ini_set("display_errors", 0); $str = strstr($_SERVER['REQUEST_URI'], '?'); $str = substr($str,1); $str = str_replace('key','',$str); parse_str($str); echo md5($key1); echo md5($key2); if(md5($key1) == md5($key2) && $key1 !== $key2){ echo $flag." obtain flag"; } ?>
Code meaning :
md5 After encryption ,key1==key2, At the same time, ensure the original key1!=key2
How to meet the conditions
- PHP There is a flaw in implicit conversion ,PHP When dealing with hash strings , Make use of ”!=” or ”==” To compare the hash values , It takes each of them ”0E” The initial hash is interpreted as 0, So if two different passwords go through the hash , The hash value is zero ”0E” At the beginning , that PHP Will think they are the same , All are 0
- md5 Unable to process array , Will change the array to null
How to construct conditions
QNKCDZO
and240610708
stay md5 After encryption , Meet the conditions of the first point above- structure
?kekeyy1[]=1&kekeyy2[]=2
, send NULL=NULL, But the two parameters themselves are not equal ,, Meet the condition of the second point above
Two methods of constructing parameters can be obtained flag:
/?kekeyy1=QNKCDZO&kekeyy2=240610708
/?kekeyy1[]=1&kekeyy2[]=2
Using parameter ?kekeyy Because php One in the code replace take key Replace empty , So structure ?kekeyy Bypass
边栏推荐
- MySQL multi column in operation
- JVM指令助记符
- Attributes of classfile
- CKEditor 4.10.1 上传图片提示“不正确的服务器响应” 问题解决
- Microservice practice | declarative service invocation openfeign practice
- Solutions to Chinese garbled code in CMD window
- Don't look for it. All the necessary plug-ins for Chrome browser are here
- kinect dk 获取CV::Mat格式的彩色RGB图像(openpose中使用)
- How to use pyqt5 to make a sensitive word detection tool
- 在SQL注入中,为什么union联合查询,id必须等于0
猜你喜欢
每天睡前30分钟阅读Day6_Day6_Date_Calendar_LocalDate_TimeStamp_LocalTime
定时线程池实现请求合并
图像识别-数据采集
Typora安装包分享
Microservice practice | declarative service invocation openfeign practice
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd
Web security and defense
Micro service practice | introduction and practice of zuul, a micro service gateway
How to use PHP spoole to implement millisecond scheduled tasks
From concept to method, the statistical learning method -- Chapter 3, k-nearest neighbor method
随机推荐
Number structure (C language -- code with comments) -- Chapter 2, linear table (updated version)
ZK configuration center -- configuration and use of config Toolkit
Difference between redis serialization genericjackson2jsonredisserializer and jackson2jsonredisserializer
图像识别-数据标注
How to use pyqt5 to make a sensitive word detection tool
三相并网逆变器PI控制——离网模式
Discussion on improving development quality and reducing test bug rate
Knife4j 2.X版本文件上传无选择文件控件问题解决
tinyxml2 读取和修改文件
Int to string, int to qstring
Don't look for it. All the necessary plug-ins for Chrome browser are here
Tinyxml2 reading and modifying files
每天睡觉前30分钟阅读_day4_Files
JDBC回顾
MySQL default transaction isolation level and row lock
PI control of three-phase grid connected inverter - off grid mode
TD联合Modelsim进行功能仿真
Inverter Simulink model -- processor in the loop test (PIL)
MySQL multi column in operation
Mysql 多列IN操作