当前位置:网站首页>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

边栏推荐
- Matlab mathematical modeling tool
- HCIA—应用层
- 【无标题】
- Carla-ue4editor import Roadrunner map file (nanny level tutorial)
- 高中数学必修一
- St-link connection error invalid ROM table of STM32 difficult and miscellaneous diseases
- 2022 Heilongjiang's latest eight member (Safety Officer) simulated test question bank and answers
- 双向链表的实现(双向链表与单向链表的简单区别联系和实现)
- TCP/IP—传输层
- W10 is upgraded to W11 system, but the screen is black, but the mouse and desktop shortcuts can be used. How to solve it
猜你喜欢

方法递归(斐波那契数列,青蛙跳台阶,汉诺塔问题)

File upload and download performance test based on the locust framework

Data reverse attack under federated learning -- gradinversion

Carla-ue4editor import Roadrunner map file (nanny level tutorial)

Use of OpenCV 6.4 median filter

CarSim learning experience - rough translation 1
![[untitled]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled]

类和对象(类和类的实例化,this,static关键字,封装)

Carsim-问题Failed to start Solver: PATH_ID_OBJ(X) was set to Y; no corresponding value of XXXXX?

Carsim-問題Failed to start Solver: PATH_ID_OBJ(X) was set to Y; no corresponding value of XXXXX?
随机推荐
力扣每日一题刷题总结:字符串篇(持续更新)
Linked list classic interview questions (reverse the linked list, middle node, penultimate node, merge and split the linked list, and delete duplicate nodes)
sqli-labs第2关
HCIA—应用层
W10 is upgraded to W11 system, but the screen is black, but the mouse and desktop shortcuts can be used. How to solve it
Using transformer for object detection and semantic segmentation
STM32疑难杂症之ST-LINK Connection error INVALID ROM TABLE
Principes fondamentaux de la théorie musicale (brève introduction)
sqli-labs(POST类型注入)
Li Kou daily one question brushing summary: binary tree chapter (continuous update)
C language implements XML generation and parsing library (XML extension)
Fundamentals of music theory (brief introduction)
OpenCV常用方法出处链接(持续更新)
旋转链表(图解说明)
St-link connection error invalid ROM table of STM32 difficult and miscellaneous diseases
Force deduction method summary: find classes
Use of OpenCV 6.4 median filter
sqli-labs第12关
Constant pointer and pointer constant
程序猿学英语-指令式编程