当前位置:网站首页>The file containing the file operation vulnerability (6)
The file containing the file operation vulnerability (6)
2022-06-24 23:44:00 【Key_ Words】
The first part : File contains
1. The file contains basic concepts
Developers want more flexible code , Therefore, the included files are usually set as variables , Used to make dynamic calls . It is this flexibility , As a result, the client can call a malicious file , Create a file containing vulnerability . File includes local and remote .
Typical features
The value of the variable is a page :
?page=a.php
?home=b.html
?file=content…
2. The file contains the prerequisites for exploit
(1)web Application and adoption include And other files contain functions , And the file path that needs to be included is transmitted through the user
Import by number ;
(2) The user can control the parameters of the included file , The included files can be accessed by the current page ;
Common functions that cause files to contain :
PHP:include()、include_once()、require()、require_once() etc. ;
1.php The file contains code that can directly execute the included file , The included file format is not subject to any restrictions
stay php Four file containing functions are provided in :
(1) Require: A fatal error occurs when the included file cannot be found (E_COMPILE_ERROR), And stop the script ;
(2) Include: When the included file cannot be found, only one will be generated (E_warinng), The script will continue to execute ;
(3) Require_once: And include Similar will generate warnings , The difference is if the file code has been included , Then there will be no more
Times included ;
3. The file contains access to webshell Conditions :
(1) The attacker needs to know the physical path where the file is stored ;
(2) Have executable permissions on the directory where the uploaded file is located ;
(3) There is a file containing vulnerability ;
One . It contains
1. unlimited
Peer access :http://127.0.0.1/include.php?filename=1.txt
Cross level access :http://127.0.0.1/include.php?filename=../../../www.txt
2. Limited
Bypassing ideas :
One 、%00 truncation ( Conditions :magic_quotes_gpc = off ,php edition <5.3.4>)
for example :1.txt%00
principle : Put the back of .html To truncate
Two 、 Length truncation :( Conditions :windows, The dot needs to be longer than 256,linux Longer than 4096)
for example :
1.txt/./././././././././././././././././././././././././././././././././././././././././././././././././././././././.
/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.
3、 ... and 、 Point around
1.txt................................................................................................................
principle :( Other symbols can also ) Just over 256 individual , Then limit the following html You can't join ,
And the system will automatically delete the following symbols .
The second part : Remote contains
Bypass method
http://127.0.0.1/include.php?filename=1.txt%20
http://127.0.0.1/include.php?filename=1.txt%23
http://127.0.0.1/include.php?filename=1.txt?
wait ... ...
Common sensitive paths :
1 Windows
C:\boot.ini // Check the system version
C:\windows\system32\inetsrv\MetaBase.xml //IIS The configuration file
C:\windows\repair\sam // Storage windows Password for initial installation of the system
C:\Program Files\mysql\my.ini //mysql To configure
C:\Program Files\mysql\data\mysql\user.MYD //Mysql root
C:\windows\php.ini //php Configuration information
C:\windows\my.ini //mysql The configuration file
2 UNIX/Linux
/etc/passwd
/usr/local/app/apache2/conf/httpd.conf //apache2 Default profile
/usr/local/app/apache2/conf/extra/httpd-vhosts.conf // Virtual website settings
/usr/local/app/php5/lib/php.ini //PHP Related configuration
/etc/httpd/conf/httpd.conf //apache
/etc/php5/apache2/php.ini //ubuntu The default path of the system
Part of the article reprints , Link to the original text :https://blog.csdn.net/qq_39431542/article/details/88628225
边栏推荐
- go 语言指针,值引用和指针引用
- Classic interview questions and answers for embedded engineers
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用summary函数获取模型汇总统计信息、解读模型系数交互作用及其显著性
- Window system installation Nacos
- Binary lookup array subscript
- 抖音實戰~項目關聯UniCloud
- R语言dplyr包group_by函数和summarise_at函数计算dataframe计算不同分组的计数个数和均值(Summarise Data by Categorical Variable)
- 六大行数据治理现状盘点:治理架构、数据标准与数据中台(2022.04)
- js监听页面或元素scroll事件,滚动到底部或顶部
- R语言dplyr包select函数将dataframe数据中的指定数据列移动到dataframe数据列中的第一列(首列)
猜你喜欢

抖音實戰~項目關聯UniCloud

都2022年了,你还不了解什么是性能测试?
What you must know about time series database!

Yyds dry goods inventory tells us 16 common usage scenarios of redis at one go

Annual salary of millions, 7 years of testing experience: stay at a fairly good track, accumulate slowly, wait for the wind to come

Using ADC to control brushless motor source program STM32 library function

STM32CubeIDE SWV功能使用方法

7-6 laying oil well pipeline

First person singular reading notes

Understanding openstack network
随机推荐
Enterprise data leakage prevention solution sharing
Using external Libpcap library on ARM platform
MySQL semi sync replication
Scala IO serialization and deserialization
安装IBM CPLEX学术版 academic edition | conda 安装 CPLEX
Hyperledger Fabric 2. X dynamic update smart contract
Leetcode topic [array] -39- combined sum
throttle-debounce. JS: a small anti shake throttling function library
(Smooth)ScrollToPosition doesn't work properly with RecyclerView
企业数据防泄露解决方案分享
Volcano成Spark默认batch调度器
Scala IO reads data from URLs and other data sources
Yyds dry goods inventory tells us 16 common usage scenarios of redis at one go
7-3 maximum sub segment and
2021-2022 China's financial digitalization "new" insight Industry Research Report
Latest development of jetpack compose
抖音实战~实现App端视频上传与发布
R语言使用MatchIt包进行倾向性匹配分析、使用match.data函数构建匹配后的样本集合、通过双样本t检验分析(双独立样本t检验)来判断倾向性评分匹配后样本中的所有协变量的平衡情况
Yyds dry goods counting uses xshell to implement agent function
Number of bytes corresponding to common data types