当前位置:网站首页>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>
边栏推荐
- Binary tree related OJ problems
- [deep learning] [original] let yolov6-0.1.0 support the txt reading dataset mode of yolov5
- How does win11 change icons for applications? Win11 method of changing icons for applications
- 今日睡眠质量记录79分
- 详解SQL中Groupings Sets 语句的功能和底层实现逻辑
- BS-XX-042 基于SSM实现人事管理系统
- Seaborn draws 11 histograms
- 为季前卡牌游戏 MotoGP Ignition Champions 做好准备!
- Win11 prompt: what if the software cannot be downloaded safely? Win11 cannot download software safely
- 面对新的挑战,成为更好的自己--进击的技术er
猜你喜欢

OneForAll安装使用

Benji Bananas 会员通行证持有人第二季奖励活动更新一览

ES6深入—async 函数 与 Symbol 类型

2020-2022两周年创作纪念日

Get ready for the pre-season card game MotoGP ignition champions!

中间表是如何被消灭的?

How to install MySQL

普洛斯数据中心发布DC Brain系统,科技赋能智慧化运营管理
Intel 13th generation Raptor Lake processor information exposure: more cores, larger cache

Benji Banas membership pass holders' second quarter reward activities update list
随机推荐
[es6] add if judgment or ternary operator judgment in the template string
公司自用的国产API管理神器
PSPNet | 语义分割及场景分析
Today's sleep quality record 79 points
Dare not buy thinking
How was the middle table destroyed?
Summary of methods for finding intersection of ordered linked list sets
[echart] resize lodash to realize chart adaptation when window is zoomed
One click installation script enables rapid deployment of graylog server 4.2.10 stand-alone version
[深度学习][原创]让yolov6-0.1.0支持yolov5的txt读取数据集模式
CISP-PTE之SQL注入(二次注入的应用)
国泰君安网上开户安全吗
详解SQL中Groupings Sets 语句的功能和底层实现逻辑
[es6] 模板字符串内添加if判断或添加三元运算符判断
Research and development efficiency measurement index composition and efficiency measurement methodology
求解汉诺塔问题【修改版】
Google Earth engine (GEE) -- a brief introduction to kernel kernel functions and gray level co-occurrence matrix
[61dctf]fm
帮忙看看是什么问题可以吗?[ERROR] Could not execute SQL stateme
文件操作--I/O