CTF_Web_WriteUp
南邮CTF web write up, 题目是按分数从少到多顺序排列,后续有新的体会会更新
签到题


签到二
右键查看代码:

可以看到输入框里面对最大长度做了限制,改一下maxlength,输入口令得到flag:

md5 collision
解释题目: md5碰撞 emmm... 好的看代码,已经给了一个字符串了,那就...


将a的值代入得到flag:

单身二十年

点击之后,如下:

怎么办呢?burpsuite抓个包?当然可以。
有不用安装软件就能抓包的吗?当然也有,浏览器是无敌的。
让我们打开“开发者工具”——“network”——勾选“Preserve log”,再重新回到web8,点击”到这里找key“

点击,查看response。

竟然没有,但是没关系,浏览器是无敌的。让我们来强行查看网页源码

tips:view-source://website/target.php
这题不是WEB

存图,用VS Code打开,启动hexdump

层层递进
打开,是一个电商网站,查看源码发现有很多文件,打开看看

层层打开,最后是一个404文件,打开如下,注释出现flag(竖着看)

文件包含
没错,这就是传说中的LFI (php文件包含漏洞)
伪协议读取文件,拿到以下字符串

base64在线解密

COOKIE
题目提示:0==not
那么我们就猜想 1==true, cookie里面也许有0,把它改成1就可以。右键查看源码
果然 cookie如下

尝试将login改成1,刷新拿到flag

单身一百年也没用
打开网址 点击“到这里找key” 网页跳转了

查看原网页的源码,跟单身二十年一样的套路

那就让我们继续骚操作,跟着我一起view-source://。。。/index.php

还是跳转了???斯国以

没事上面不是还有另外一种方法吗?让我们打开google浏览器的检查,勾选Preserve log 刷新,拿到了

查看一下相应的结果

不要放弃,再看看头,头里面也许有信息呢

在相应的消息头里面出现了flag,Crtl+C Crtl+V 提交
php decode

PHPStorm跑起来(在线网页也可以

将eval改成echo,拿到flag

bypass again
提示php弱类型,源码如下:
if (isset($_GET['a']) and isset($_GET['b'])) {
if ($_GET['a'] != $_GET['b'])
if (md5($_GET['a']) == md5($_GET['b']))
die('Flag: '.$flag);
else
print 'Wrong.';
}
构造md5数组如下,拿到flag:

MYSQL
打开网址,提示robot.txt

划重点 sql.php 当id=1024,显示no!try again

尝试打开sql.php

再试试别的id



尝试一下浮点数

/x00
打开,页面如下:

查找strpos用法


可知当变量nctf里面的字符串包含biubiubiu,能拿到flag。
尝试 nctf[] = biubiubiu

SQL注入1
常规操作 检查源码

打开如下,分析代码可知只有当user是admin时才能拿到flag

将user改为admin提交

重新看代码,变量sql有选择password,把password注释掉, 构造如下

拿到flag

SQL注入2
查看source里面的内容

分析代码,找到注入点,首先username和密码都不能为空,strcasecmp用法:
strcasecmp——比较两个字符串(不区分大小写)
<?php echo strcasecmp("shanghai","SHANGHAI"); ?>
找到显示flag条件

尝试union查询,username:username' union select md5(1)# password:1
拿到flag

