当前位置:网站首页>File upload Labs
File upload Labs
2022-07-02 08:27:00 【Defeat of Fujiwara Qianhua】
List of articles
Preface
upload-labs It's a use php language-written , Specifically collect penetration tests and CTF Various upload vulnerabilities encountered in the shooting range . It aims to help you have a comprehensive understanding of the upload vulnerability . At present, a total of 20 Turn off , Each level contains different upload methods
One 、 What is the file upload vulnerability ?
Web In the application , File uploading is a common functional requirement , For example, users upload member avatars
If the uploaded files are not verified and filtered , Attackers can upload malicious scripts , To achieve the purpose of an attack .
Two 、 Common upload detection rules
- client JS testing
- Server file extension detection ( Black and white list )
- Server side MIME Type detection (HTTP First line content-type Field )
- Server directory path detection ( testing path Sensitive keywords in parameters )
- Server file content detection ( Check file content )
3、 ... and 、 Bypass
The target contains vulnerability type classification

How to determine the type of upload vulnerability

Four 、 The first 1 Turn off
- Upload a 1.php file , Page echo

- Even if you can't pass the above “ Echo... Soon ” To judge , You can also try grabbing , You can't catch it , Check the source code of the page and you will find
function checkFile() {
var file = document.getElementsByName('upload_file')[0].value;
if (file == null || file == "") {
alert(" Please select the file to upload !");
return false;
}
// Define the types of files allowed to be uploaded
var allow_ext = ".jpg|.png|.gif";
// Extract the type of uploaded file
var ext_name = file.substring(file.lastIndexOf("."));
// Determine whether the type of uploaded file is allowed to be uploaded
if (allow_ext.indexOf(ext_name + "|") == -1) {
var errMsg = " The file is not allowed to upload , Please upload " + allow_ext + " Files of type , The current file type is :" + ext_name;
alert(errMsg);
return false;
}
}
- Just disable the script , You can bypass the detection
5、 ... and 、 The first 2 Turn off
- Upload an illegal file , The echo

- Can catch packets , The description is backend authentication . Ahead of 1.php Renamed 1.png Upload successful . There are many ways of back-end verification , Without source code , Only by experience black box test .

Revised MIME type , namely conten-type, Upload successful , And successfully resolved

边栏推荐
- OpenCV3 6.3 用滤波器进行缩减像素采样
- Generate database documents with one click, which can be called swagger in the database industry
- Don't know mock test yet? An article to familiarize you with mock
- Jumping | Blue Bridge Cup
- Rotating linked list (illustration)
- How to wrap qstring strings
- c语言将字符串中的空格替换成%20
- 路由基础—动态路由
- Global and Chinese market of tillage finishing machines 2022-2028: Research Report on technology, participants, trends, market size and share
- Sparse matrix storage
猜你喜欢

sqli-labs(POST类型注入)

乐理基础(简述)

cve_ 2019_ 0708_ bluekeep_ Rce vulnerability recurrence

Carsim 学习心得-粗略翻译1

HCIA—應用層

Use of opencv3 6.2 low pass filter

Method recursion (Fibonacci sequence, frog jumping steps, tower of Hanoi problem)

STM32-新建工程(参考正点原子)

C language implements XML generation and parsing library (XML extension)

File upload and download performance test based on the locust framework
随机推荐
STL quick reference manual
力扣每日一题刷题总结:链表篇(持续更新)
Jz-061-serialized binary tree
力扣方法总结:滑动窗口
高中数学必修一
Use the kaggle training model and download your own training model
Using transformer for object detection and semantic segmentation
Use Matplotlib to draw a preliminary chart
力扣每日一题刷题总结:栈与队列篇(持续更新)
Comparison between setTimeout and requestanimationframe (page refresh)
Deep understanding of JVM
Summary of one question per day: stack and queue (continuously updated)
Carsim-实时仿真的动画同步问题
How to apply for a secondary domain name?
Carsim 学习心得-粗略翻译1
Backup, recovery and repair of XFS file system
web安全--逻辑越权
Force deduction method summary: double pointer
File upload and download performance test based on the locust framework
Array and string processing, common status codes, differences between PHP and JS (JS)