ctfshow web80

<?php

/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2020-09-16 11:25:09
# @Last Modified by:   h1xa
# @Last Modified time: 2020-09-16 11:26:29
# @email: h1xa@ctfer.com
# @link: https://ctfer.com

*/


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

这里file参数过滤了php和data,那就采取两种方法

方法一

可以看出是nginx的服务器,那么我们就可以尝试日志文件包含,访问/var/log/nginx/access.log,可以发现每次UA头的内容都会写进日志,那么我们就可以考虑在UA头写马进去或者写敏感代码进去

当然得先看看里面有什么文件

可以猜测flag就在fl0g.php中

posted @ 2025-09-19 17:05  朱迪Judy  阅读(16)  评论(0)    收藏  举报