当前位置:网站首页>文件下载漏洞&文件读取漏洞&文件删除漏洞
文件下载漏洞&文件读取漏洞&文件删除漏洞
2022-06-22 12:27:00 【无聊的知识】
文件下载

文件下载漏洞呢
什么是文件下载漏洞
首先这个文件下载漏洞呢,其实是网站这个平台提供了下载文件的功能,那么网站平台上对于这个网站的下载没有限制过滤,那么一些不分分子就会利用他的这个缺点去下载一些敏感文件一些重要性文件
文件下载两种格式
直连下载【没有漏洞】
www.baidu.com/1.zip
解析性下载【可能存在漏洞】
www.baidu.com?file=1.zip
解释
直连下载:
连接的是
1.zip-------------www.baidu.com/1.zip
连接的是
2.zip-------------www.baidu.com/2.zip
解析下载:
/1.zip
/
/
www.baidu.com?file= ——————2.zip
\
\
\3.zip
www.baidu.com?file= 这就好比一个你要什么给什么的机器人
我要1.zip
www.baidu.com?file=1.zip
我要2.zip
www.baidu.com?file=2.zip
我要3.zip
www.baidu.com?file=3.zip
你向他请求什么他就会帮你去找什么,就是这个意思
如果他没有1.zip 那么他就会返回空给你
漏洞成因:
存在读取文件的函数
读取文件的路径用户可控且未校验或校验不严格
输出了文件内容
漏洞危害:
下载服务器任意文件,如脚本代码、服务及系统配置文件等,进一步利用获取的信息进行更大的危害。
可用得到的代码进一步代码审计,得到更多可利用漏洞
案例
http://67.202.70.133/files/readfile.php?file=…/configurtion.php
http://67.202.70.133/
文件读取漏洞
文件读取函数
- fopen
- file_get_contents
- fread
- fgets
- fgetss
- file
- fpassthru
- parse_ini_file
- readfile
<?php
$filename = $_GET['file'];
if(isset($filename)) {
readfile($filename);
}
文件删除漏洞
<?php
header("Content-Type:text/html;charset=utf-8");
$filename = $_GET['file'];
if(file_exists($filename)){
unlink($filename);
echo "<script>alert('删除成功')</script>";
}else{
echo "<script>alert('删除失败')</script>";
}
边栏推荐
- Lao Wang said that the sixth issue of the series: PHP programmers should build their own self-confidence
- windows系统安装多个mysql版本(不用卸载原版本),新旧版本兼容。
- [MySQL] the difference between where and having
- 企业官网如何提高客户转化率
- 基于can总线的A2L文件解析(1)
- PostGIS through St_ Dwithin retrieves elements within a certain distance
- Go language notes
- docker安装postgresql
- Fast establishment of tensorflow2 model optimization environment
- Precautions for upgrading php8 of diyun CMS
猜你喜欢

On the routing tree of gin

redis修改密码,及启动、查看等操作

MySQL 5.7 + Navicat download and installation tutorial (with installation package)

SequoiaDB分布式数据库2022.5月刊

Recommend a virtual machine software for fast cluster building of M1 chip computers

JAXB元素详解

JAXB element details

leetcode 85. 最大矩形

leetcode 968.监控二叉树

老王说系列第六期:PHP程序员要建立自己的自信心
随机推荐
Precautions for wechat official account development
leetcode 1130. 叶值的最小代价生成树
别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
leetcode 968.监控二叉树
0007 reverse integer
假如,程序员面试的时候说真话
342. Power of Four
企业官网如何提高客户转化率
On the routing tree of gin
巨杉数据库受邀出席鲲鹏开发者年度盛会2022,共建国产化数字底座
SiCf batch activation service node
MySQL_ Query of data processing
BSS应用程序云原生部署的8大挑战
universaldependencies依存关系标签解释
SAP-ABAP-BAPI_ GOODSMVT_ How to assign values when creating a material voucher Bapi
260. Single Number III
智龄语音+php
【Qt】Qt获取标准系统路径
338. Counting Bits
8 challenges of BSS application cloud native deployment