zoukankan      html  css  js  c++  java
  • 文件包含

    文件包含:在C语言中文件包含是指一个源文件可以将另一个源文件的全部内容包含进来。该命令的作用是在预编译时,将指定源文件的内容复制到当前文件中。文件包含是C语言预处理命令三个内容之一。

    进去后发现http://4.chinalover.sinaapp.com/web7/index.php?file=show.php

    php://filter是一种元封装器, 设计用于数据流打开时的筛选过滤应用。
    - include “test.php” php文件包含,在执行流中插入写在其他文件中的有用的代码。读取的时候也是数据流形式,因此可以使用php://filter进行过滤,返回值为0,1。
    - readfile(“test.php”)是将文件以数据流的形式读取过来,并不会执行,但会在前台浏览器上进行解析。返回值是字节数多少。

    • file_get_contents(“test.php”)返回值为文本内容

    此题运用的就是关于数据流过滤的文件包含,我们一般在进行文件包含的时候都这么写include “test.php”获得的就是test.php直接解析出来。但如果运用readfile(“test.php”)就不进行解析,导致无法在浏览器前台进行显示。

    开来要用base64解码了

    <html>
        <title>asdf</title>
       
    <?php
     error_reporting(0);
     if(!$_GET[file]){echo '<a href="./index.php?file=show.php">click me? no</a>';}
     $file=$_GET['file'];
     if(strstr($file,"../")||stristr($file, "tp")||stristr($file,"input")||stristr($file,"data")){
      echo "Oh no!";
      exit();
     }
     include($file);
    //flag:nctf{edulcni_elif_lacol_si_siht}

    ?>
    </html>

  • 相关阅读:
    生产者与消费者
    .net 重新注册
    linux 网络之 bond 网卡模式
    Rancher
    kubernetes 集群
    centos7 网卡命名
    Redis 主从模式
    Redis 集群
    Redis
    TwemProxy Redis架构
  • 原文地址:https://www.cnblogs.com/maodun/p/6915714.html
Copyright © 2011-2022 走看看