当前位置:网站首页>Summary of PHP pseudo protocol of cisp-pte
Summary of PHP pseudo protocol of cisp-pte
2022-07-05 16:42:00 【Colorful @ star】
PHP Pseudo protocol summary
0x00 php://input
// All tests are allow_url_fopen=On,allow_url_include=On!!!
php://input It's a read-only stream that can access the requested raw data . POST In the case of a request , Best use php://input Instead of $HTTP_RAW_POST_DATA, Because it doesn't depend on specific php.ini Instructions . and , In this case $HTTP_RAW_POST_DATA The default is not filled , Than activate always_populate_raw_post_data Potentially requires less memory . enctype=”multipart/form-data” When php://input It's invalid .
——php.net
Simply put, get post data .
Test code :
The file contains variable command execution :
Test code :
<?php$d = file_get_contents(‘php://input’);
//echo d ; @ e v a l ( d; @eval( d;@eval(d)
?>
<?php @include($_GET[“file”]); ?>
Write a sentence :
0x01 php://filter
php://filter It's a meta wrapper , Designed for when data flow is open Screening filtration application . This is for the all-in-one (all-in-one) The file function of is very useful , similar readfile()、 file() and file_get_contents(), There is no chance to apply other filters before the data stream content is read .
——php.net
Simply put, we often use it base64 code , Such as
php://filter/read=convert.base64-encode/resource=file:///c:/windows/win.ini”
A variety of filters can be used ( character string / transformation / Compress / encryption )
It is often used to read files / Source code :
0x02 zip://,bzip2://,zlib://
zlib: Similar function of gzopen(), however Its data flow can also be fread() And other file system functions . since PHP 4.3.0 The latter is not recommended to be used , Because it will be with others “:” Character file names are confused ; Please use compress.zlib:// As a substitute .
compress.zlib://、 compress.bzip2:// and gzopen()、bzopen() They are equal. . And it can be used when fopencookie Used in the system .
ZIP Expand registered zip: wrapper . since PHP 7.2.0 and libzip 1.2.0+ rise , Encryption archiving begins to support passwords , Allow passwords to be used in data streams . Byte stream context (stream contexts) Use in ‘password’ Option set password .
optional
- zlib://file.gz
- bzip2://file.bz2
- zip://archive.zip#dir/file.txt
——php.net
Simply put, it is to directly access the files in the compressed package .
1. zip://
take phpinfo.txt Compressed into zip, In practice, the suffix can be changed to jpg Bypass upload restrictions .
Pay attention to the absolute path +url code #
2. zlib://
Change suffix to jpg Yes , Relative path is also acceptable .
3. bzip2://
In the same way in zlib://
0x03 data://
data://text/plain;base64,
No addition // Yes .
Can also be used to read php File source code :
data:text/plain,<?php system(‘cat /var/www/phprotocol1.php’)?>
Or command execution :
data:text/plain,<?php system(‘whoami’)?>
0x04 Conclusion
ctf We often use php Fake protocol , It may have miraculous effects in actual combat .
0x05 Reference material
https://www.waitalone.cn/php-file-include.html
www.freebuf.com/column/148886.html
http://php.net/manual/zh/wrappers.php
</article>
边栏推荐
- 【 brosser le titre 】 chemise culturelle de l'usine d'oies
- The memory of a Zhang
- Cartoon: what is the eight queens problem?
- 二叉树相关OJ题
- Cartoon: what is service fusing?
- Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
- Google Earth engine (GEE) -- a brief introduction to kernel kernel functions and gray level co-occurrence matrix
- Is it safe for Guotai Junan to open an account online
- Google Earth Engine(GEE)——Kernel核函数简单介绍以及灰度共生矩阵
- You should have your own persistence
猜你喜欢
Reduce the cost by 40%! Container practice of redis multi tenant cluster
Seaborn绘制11个柱状图
Android 隐私沙盒开发者预览版 3: 隐私安全和个性化体验全都要
【深度学习】深度学习如何影响运筹学?
DeSci:去中心化科学是Web3.0的新趋势?
迁移/home分区
清晰还原31年前现场,火山引擎超清修复Beyond经典演唱会
Benji Bananas 会员通行证持有人第二季奖励活动更新一览
【 brosser le titre 】 chemise culturelle de l'usine d'oies
Data Lake (XIV): spark and iceberg integrated query operation
随机推荐
Do sqlserver have any requirements for database performance when doing CDC
怎样在电脑上设置路由器的WiFi密码
Data Lake (XIV): spark and iceberg integrated query operation
[deep learning] [original] let yolov6-0.1.0 support the txt reading dataset mode of yolov5
Spring Festival Limited "forget trouble in the year of the ox" gift bag waiting for you to pick it up~
[js] skill simplification if empty judgment
[js] 技巧 简化if 判空
ES6 deep - ES6 class class
《21天精通TypeScript-3》-安装搭建TypeScript开发环境.md
Practice independent and controllable 3.0 and truly create the open source business of the Chinese people
Sentinel-流量防卫兵
2020-2022两周年创作纪念日
面对新的挑战,成为更好的自己--进击的技术er
How does win11 change icons for applications? Win11 method of changing icons for applications
How to use FRP intranet penetration +teamviewer to quickly connect to the intranet host at home when mobile office
Benji Bananas 会员通行证持有人第二季奖励活动更新一览
程序员如何提升自己的格局?
Jarvis OJ Webshell分析
sqlserver 做cdc 要对数据库性能有什么要求么
Clear restore the scene 31 years ago, volcanic engine ultra clear repair beyond classic concert