<?php
highlight_file(__FILE__);
$key1 = 0;
$key2 = 0;
$a = $_GET['a'];
$b = $_GET['b'];
if(isset($a) && intval($a) > 6000000 && strlen($a) <= 3){
if(isset($b) && '8b184b' === substr(md5($b),-6,6)){
$key1 = 1;
}else{
die("Emmm...再想想");
}
}else{
die("Emmm...");
}
$c=(array)json_decode(@$_GET['c']);
if(is_array($c) && !is_numeric(@$c["m"]) && $c["m"] > 2022){
if(is_array(@$c["n"]) && count($c["n"]) == 2 && is_array($c["n"][0])){
$d = array_search("DGGJ", $c["n"]);
$d === false?die("no..."):NULL;
foreach($c["n"] as $key=>$val){
$val==="DGGJ"?die("no......"):NULL;
}
$key2 = 1;
}else{
die("no hack");
}
}else{
die("no");
}
if($key1 && $key2){
include "Hgfks.php";
echo "You're right"."\n";
echo $flag;
}
?>
前两个都考烂了,这里只说第三个绕过array_search。文档array_search()
也就是说,默认的第三个flase参数导致了弱类型比较漏洞。当我们的$c["n"]=0的时候(或者null),会将前面要查找的字符串自动转化为0然后进行比较。
因此payload如下:
?a=9e9&b=53724&c={"m":"3333c","n":[[],0]}
标签:search,no,die,&&,easyphp,array,绕过 From: https://www.cnblogs.com/meng-han/p/16767352.html