Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2024-39943 PoC — rejetto HFS 安全漏洞

Source
Associated Vulnerability
Title: rejetto HFS 安全漏洞 (CVE-2024-39943)
Description:rejetto HFS (aka HTTP File Server) 3 before 0.52.10 on Linux, UNIX, and macOS allows OS command execution by remote authenticated users (if they have Upload permissions). This occurs because a shell is used to execute df (i.e., with execSync instead of spawnSync in child_process in Node.js).
Readme
# CVE-2024-39943 Exploit



## 0x01 漏洞描述

Rejetto HFS(又名HTTP文件服务器)在Linux、UNIX和macOS上的版本低于0.52.10存在一个漏洞,允许远程认证用户执行操作系统命令(如果他们拥有上传权限)。这是因为使用shell来执行df命令,具体是在Node.js的child_process中使用execSync而不是spawnSync来执行命令。

## 0x02 影响范围

```
Rejetto HTTP File Server 3 在Linux、UNIX和macOS上的版本低于0.52.10存在一个漏洞
```

## 0x03 前置条件

要想利用此漏洞至少要满足三个条件:

1. 目标版本符合漏洞存在版本
2. 需要具有认证用户的cookie
3. 该认证用户具有上传权限

## 0x04 漏洞利用

攻击机设置监听端口

```
nc -lvvp 9999
```
![image](https://github.com/A-little-dragon/CVE-2024-39943-Exploit/assets/87412828/5002b552-9e25-4f5e-aa19-fb1d9d2b9839)

获取登陆后的cookie

> 注意:cookie需要登陆后才能获取

![image](https://github.com/A-little-dragon/CVE-2024-39943-Exploit/assets/87412828/15f9d7f3-1817-4035-9625-9a051e10c584)

执行脚本

```
python3 CVE-2024-39943.py
```
![image](https://github.com/A-little-dragon/CVE-2024-39943-Exploit/assets/87412828/e1a56521-3756-4315-83c0-0b4bb94fc3ed)

![image](https://github.com/A-little-dragon/CVE-2024-39943-Exploit/assets/87412828/11d69725-c725-44f6-ad99-6b3e5fb679a2)

攻击过程展示:

https://github.com/A-little-dragon/CVE-2024-39943-Exploit/assets/87412828/448f493b-79aa-4b57-b5ce-c11bc83d73f5

## 0x05 感谢

感谢[@truonghuuphuc](https://github.com/truonghuuphuc)对我提供的帮助!

**issues地址:** https://github.com/truonghuuphuc/CVE-2024-39943-Poc/issues/1

## 0x05 免责声明

本项目仅用于学习研究使用,严禁用于非法渗透!否则,产生一切后果均自行承担!
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →