【Web安全】php://filter 的浅略底层分析

新建一个 php 文件:a.php

<?php
$a = "a.txt";
include("php://filter/resource=" . $a);

在同一目录下新建一个文件:a.txt(内容为 <?php phpinfo();?> 的 base64 编码)

PD9waHAgcGhwaW5mbygpOz8+

在对应文件的相关函数下个断点:
在这里插入图片描述

资料

贴一下关键代码:

php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *path, const char *mode, int options,
                                     zend_string **opened_path, php_stream_context *context STREAMS_DC) /* {
   
   {
   
   { */
{
   
   
    ...
    if (!strncasecmp(path, "php://", 6)) {
   
   
    }
    if (!strncasecmp(path, "temp", 4)) {
   
        
    }
    if (!strcasecmp(path, "memory")) {
   
   
    }
    if (!strcasecmp(path, "output")) {
   
   
    }
    if (!
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值