<?php
/**
 * Created by PhpStorm.
 * User: jinzhao
 * Date: 2019/10/6
 * Time: 8:04 PM
 */

highlight_file(__FILE__);

class BUU {
   public $correct = "";
   public $input = "";

   /*__destruct() :对象的所有引用都被删除或者当对象被显式销毁时执行
         uniqid() :函数基于以微秒计的当前时间,生成一个唯一的 ID。
   */
   public function __destruct() {
       try {
           $this->correct = base64_encode(uniqid());
           if($this->correct === $this->input) {
               echo file_get_contents("/flag");
           }
       } catch (Exception $e) {
       }
   }
}

if($_GET['pleaseget'] === '1') {
    if($_POST['pleasepost'] === '2') {
        if(md5($_POST['md51']) == md5($_POST['md52']) && $_POST['md51'] != $_POST['md52']) {
            unserialize($_POST['obj']);
        }
    }
}

__destruct() :对象的所有引用都被删除或者当对象被显式销毁时执行。

uniqid() :函数基于以微秒计的当前时间,生成一个唯一的 ID。

序列化构造方法:注意传引用

BUUCTF | CODE REVIEW 1 (反序列化,md5绕过)

 

 MD5绕过一:数组

BUUCTF | CODE REVIEW 1 (反序列化,md5绕过)

 

MD5绕过二:弱类型

 BUUCTF | CODE REVIEW 1 (反序列化,md5绕过)

 

相关文章:

  • 2021-09-04
  • 2021-07-05
  • 2022-12-23
  • 2021-11-08
  • 2022-01-16
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-02-27
相关资源
相似解决方案