天山固网杯2025-职工组-web3-add_file

天山固网杯2025-职工组-web3-add_file

题目名称:add_file
题目内容:怎么添加文件呢?
【Flag完整格式一般为:DASCTF{******},只需要提交{}内的内容。若Flag为其它格式,则会在题目描述中单独说明。】
题目分值:125.0

打开题目,提示:

添加money
当前money:

用100000money来购买提示哦

点击一次【添加money】,Burp抓包,发现只能加10块钱:

POST /update.php HTTP/1.1
Host: 139.155.126.78:20347
Content-Length: 6
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.6422.60 Safari/537.36
Content-type: application/x-www-form-urlencoded
Accept: */*
Origin: http://139.155.126.78:20347
Referer: http://139.155.126.78:20347/
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Connection: keep-alive

add=10

抓包后改包,直接让它添加100000块钱,得到base64字符串:

aGlqa2FzYmRramcucGhw
⇒ hijkasbdkjg.php

访问得到源码:

<?php
error_reporting(0);
highlight_file(__FILE__);
$AA = $_GET['AA'];
$SZ = $_GET;
if (isset($SZ['AA'])) {
    unset($SZ['AA']);
   }
   
   call_user_func($AA, $SZ);
   echo '当前文件路径:' . __FILE__;
   echo "<br>";
   echo '当前目录文件数目: ' . (count(glob(__DIR__ . '/*')));

  if(count(glob(__DIR__.'/*'))>8){
    include('flag.php');
  }
?>

后面的就不会做了。 本地尝试了创建文件、文件夹、call_user_func_array,都没有成功。 有没有师傅浇浇?

posted @ 2025-08-16 18:53  potjoe  阅读(105)  评论(1)    收藏  举报