php.net/manual/zh/funct 0x02 联想file_get_contents 绕过知识 file_get_contents 绕过方式: 使用php://input伪协议绕过 将要GET的参数?xxx=php://input 用post方法传入想要file_get_contents()函数返回的值 用data://伪协议绕过将url改为:?xxx=data://text/plain;base64,想要file_get_contents()函数返回...
解题关键是在第三个if语句中,我们可以用php://input输入流来绕过file_get_contents函数,达到执行file1变量的目的,用php://filter伪协议来读取源代码,用来拿到flag。 php://input可以读取没有处理过的POST数据。 php://filter伪协议规则: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 php://filter/过滤...
php://input php://input代表可以访问请求的原始数据,简单来说POST请求的情况下,php://input可以获取到post的数据。 使用条件:include( )、include_once( )、file_get_contents( ) 比较特殊的一点,enctype=”multipart/form-data”的时候 php://input 是无效的。 用法举例: 使用file_get_contents函数的伪协议...
file=data://text/plain;base64,PD9waHAgcGhwaW5mbygpOz8%2b 实例(https://buuoj.cn/challenges#[ZJCTF%202019]NiZhuanSiWei) 打开网址,给了源码 <?php$text=$_GET["text"];$file=$_GET["file"];$password=$_GET["password"];if(isset($text)&&(file_get_contents($text,'r')==="welcome to ...
检测请求方式,除了get和post之外拦截下来并写日志。 */if($_SERVER['REQUEST_METHOD'] !='POST'&&$_SERVER['REQUEST_METHOD'] !='GET') {write_attack_log("method"); }$url=$_SERVER['REQUEST_URI'];//获取uri来进行检测$data=file_get_contents('php://input');//获取post的data,无论是否是muti...
解题关键是在第三个if语句中,我们可以用php://input输入流来绕过file_get_contents函数,达到执行file1变量的目的,用php://filter伪协议来读取源代码,用来拿到flag。 php://input可以读取没有处理过的POST数据。 php://filter伪协议规则: php://filter/过滤器|过滤器/resource=待过滤的数据流 ...
--challenge3.txt-->";require __DIR__.'/lib.php';if(!$_GET['id']){header('Location: challenge3.php?id=1');exit();}$id=$_GET['id'];$a=$_GET['a'];$b=$_GET['b'];if(stripos($a,'.')){echo'Hahahahahaha';return;}$data=@file_get_contents($a,'r');if($data=="...
1 index.php?file=php://input 2 POST: 3 <? phpinfo(); ?> php://filter 可以读取本地文件 index.php?file=php://filter/read=convert.base64-encode/resource=index.php 指定末尾文件,可以读到base64编码后的文件内容,ctf中常有题目可读文件源码。
['PHP_SELF'];//访问者要访问的文件名 $parameter = $_SERVER["QUERY_STRING"];//访问者要请求的参数 $method = $_SERVER['REQUEST_METHOD'];//请求方法 $time = date('Y-m-d H:i:s',time());//访问时间 $post = file_get_contents("php://input",'r');//接收POST数据 $others = '.....
file_get_contents常用来读文件,但是也可以用伪协议来控制读的内容,这里就是使用data://text/plain,test。指定数据的 MIME 类型位text,然后内容是test,这个时候我们就控制了读取的内容,只需要传参ac位test即可拿到flag。 0 goodsnack29天前 post ac=1&fn=php://input raw里填1,对应ac的值 ...