[极客大挑战 2019]PHP

Posted F1ght!!

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[极客大挑战 2019]PHP相关的知识,希望对你有一定的参考价值。

在这里插入图片描述
界面是这样,说到文件备份,可以使用工具dirsearch对其网站目录进行扫描:
在这里插入图片描述
dirsearch是用python写成的目录暴力扫描工具,扫描方式如下:
在这里插入图片描述

\\...\\...\\dirsearch.py -u [网址] -e [网站语言]

扫到一个绿色的压缩包文件:
在这里插入图片描述
在网址一栏输入/www.zip,提取文件:
在这里插入图片描述
class.php,代码如下:

<?php
include 'flag.php';


error_reporting(0);


class Name{
    private $username = 'nonono';
    private $password = 'yesyes';

    public function __construct($username,$password){
        $this->username = $username;
        $this->password = $password;
    }

    function __wakeup(){
        $this->username = 'guest';
    }

    function __destruct(){
        if ($this->password != 100) {
            echo "</br>NO!!!hacker!!!</br>";
            echo "You name is: ";
            echo $this->username;echo "</br>";
            echo "You password is: ";
            echo $this->password;echo "</br>";
            die();
        }
        if ($this->username === 'admin') {
            global $flag;
            echo $flag;
        }else{
            echo "</br>hello my friend~~</br>sorry i can't give you the flag!";
            die();

            
        }
    }
}
?>

flag.php:(代码如下)

<?php
$flag = 'Syc{dog_dog_dog_dog}';
?>

index.php里面就是网站的备份,对解题无意义。

以上是关于[极客大挑战 2019]PHP的主要内容,如果未能解决你的问题,请参考以下文章

BUUOJ [极客大挑战 2019]Secret File

[极客大挑战 2019]PHP

[HCTF 2018]WarmUp&[极客大挑战 2019]Knife&[极客大挑战 2019]Secret File&[极客大挑战 2019]BuyFlag

buu-[极客大挑战 2019]Secret File

极客大挑战2019PHP题目详解

[极客大挑战 2019]Secret File