当前位置:网站首页>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
边栏推荐
- What are the platforms for selling green label domain names? What is the green label domain name like?
- Sparse matrix storage
- CarSim problem 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)
- 链表经典面试题(反转链表,中间节点,倒数第k个节点,合并分割链表,删除重复节点)
- Jz-061-serialized binary tree
- cve_ 2019_ 0708_ bluekeep_ Rce vulnerability recurrence
- STM32 new project (refer to punctual atom)
- Global and Chinese market of medicine cabinet 2022-2028: Research Report on technology, participants, trends, market size and share
- OpenCV关于x,y坐标容易混淆的心得
猜你喜欢
Intelligent manufacturing solutions digital twin smart factory
Using transformer for object detection and semantic segmentation
DWORD ptr[]
STM32 new project (refer to punctual atom)
Web安全--核心防御机制
Introduction to parameters of CarSim pavement 3D shape file
Use the kaggle training model and download your own training model
Simply test the two different data transmission methods of content length and chunked
什么是SQL注入
旋转链表(图解说明)
随机推荐
Carla-ue4editor import Roadrunner map file (nanny level tutorial)
Makefile基本原理
Introduction to anti interception technology of wechat domain name
路由基础—动态路由
MySQL optimization
Summary of one question per day: stack and queue (continuously updated)
Programming ape learning English - imperative programming
On November 24, we celebrate the "full moon"
My VIM profile
Generate database documents with one click, which can be called swagger in the database industry
web安全--逻辑越权
Development of digital collection trading website development of metauniverse digital collection
双向链表的实现(双向链表与单向链表的简单区别联系和实现)
Wang extracurricular words
Matlab数学建模工具
install.img制作方式
Matlab mathematical modeling tool
Longest isometric subsequence
Global and Chinese markets for conventional rubber track 2022-2028: Research Report on technology, participants, trends, market size and share
Introduction to parameters of CarSim pavement 3D shape file