前言
又是一年国赛,今年的国赛赛题质量大不如上一年,可能是上一年太菜了吧XD
今年的web题目很友好,作为在校期间最后一场比赛,玩的很开心。
Vegetable
打开题目是空白界面,查看源码发现是一张图片,保存本地,010editor打开发现有source.php

访问source.php发现源码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| <?php class emmm { public static function checkFile(&$page) { $whitelist = ["source"=>"source.php","hint"=>"hint.php"]; if (! isset($page) || !is_string($page)) { echo "you can't see it"; return false; }
if (in_array($page, $whitelist)) { return true; }
$_page = mb_substr( $page, 0, mb_strpos($page . '?', '?') ); if (in_array($_page, $whitelist)) { return true; }
$_page = urldecode($page); $_page = mb_substr( $_page, 0, mb_strpos($_page . '?', '?') ); if (in_array($_page, $whitelist)) { return true; } echo "you can't see it"; return false; } }
if (! empty($_REQUEST['file']) && is_string($_REQUEST['file']) && emmm::checkFile($_REQUEST['file']) ) { include $_REQUEST['file']; exit; } else { echo "<div style=\"text-align:center;\"><br><img src=hint.png /></div>"; } ?>
|
看到有一个hint.php,访问得到提示:可以在vegetableflag得到flag
观察:
1 2 3 4 5
| $_page = mb_substr( $page, 0, mb_strpos($page . '?', '?') );
|
第一个问号之前的参数时候为source.php或者hint.php
heckFile函数的$_page取file参数的第一个问号前的字段,从而检查文件名是否在白名单内,构造file参数。
payload:index.php?file=source.php?/../../../../vegetableflag

后来才知道是HCTF2018的签到题 链接:https://blog.csdn.net/qq_40730518/article/details/84036753
DABAOJIAN
彩票系统…中彩票…类似的题之前已经出现好多次了,一般有三种思路:
1.json传参(2018QCTF出现)
2.整数溢出(2018护网杯)
3.重复注册
尝试发现,json传参构造即可

中彩,钱够了即可去买大宝剑2333

购买大宝剑得到后台路径

密码五位数,不知道,验证码用burp抓包绕过(验证码不变即可),爆破密码

爆出密码09938,登录即可得到flag

Upload_2_shell
00截断绕过exif_imagetype的检测
先上传.htaccess,用php伪协议绕过<?
的检测

上传base64编码过的shell

Getshell,读flag
