Deserialization
基本信息
PHP
<?php
class test {
public $s = "This is a test";
public function displaystring(){
echo $this->s.'<br />';
}
public function __toString()
{
echo '__toString method called';
}
public function __construct(){
echo "__construct method called";
}
public function __destruct(){
echo "__destruct method called";
}
public function __wakeup(){
echo "__wakeup method called";
}
public function __sleep(){
echo "__sleep method called";
return array("s"); #The "s" makes references to the public attribute
}
}
$o = new test();
$o->displaystring();
$ser=serialize($o);
echo $ser;
$unser=unserialize($ser);
$unser->displaystring();
/*
php > $o = new test();
__construct method called
__destruct method called
php > $o->displaystring();
This is a test<br />
php > $ser=serialize($o);
__sleep method called
php > echo $ser;
O:4:"test":1:{s:1:"s";s:14:"This is a test";}
php > $unser=unserialize($ser);
__wakeup method called
__destruct method called
php > $unser->displaystring();
This is a test<br />
*/
?>PHP反序列化 + 自动加载类
PHP - Deserialization + Autoload Classes序列化引用值
PHPGGC (ysoserial for PHP)
phar:// 元数据反序列化
phar:// deserializationPython
Pickle
Bypass Python sandboxesYaml & jsonpickle
Python Yaml Deserialization类污染(Python原型污染)
Class Pollution (Python's Prototype Pollution)NodeJS
JS魔术函数
__proto__ 和 prototype 污染
NodeJS - __proto__ & prototype Pollution__proto__ 和 prototype 污染
Cryo库
Java - HTTP
指纹
白盒测试
黑盒测试
检查是否存在漏洞
白盒测试
黑盒测试
利用
ysoserial
serialkillerbypassgadgets
marshalsec
FastJSON
实验室
为什么
预防措施
瞬态对象
避免对需要实现Serializable接口的类进行序列化
增强Java中的反序列化安全性
参考资料
JNDI 注入 & log4Shell
JNDI - Java Naming and Directory Interface & Log4ShellJMS - Java 消息服务
产品


利用
参考资料
.Net
指纹
白盒
黑盒
ysoserial.net
更多 ysoserial.net 参数
ViewState
预防措施
参考资料
Ruby
最后更新于