Share
## https://sploitus.com/exploit?id=DB6FE167-7CB9-5E26-907C-82E229E49522
# CVE-2024-25641 Exploit for Cacti 1.2.26

Exploiting CVE-2024-25641 on Cacti 1.2.26. When a user is authenticated, an arbitrary file write vulnerability allows Remote Code Execution (RCE).

---

## Overview
This script automates the process of exploiting **CVE-2024-25641** in **Cacti 1.2.26**. The vulnerability allows authenticated users with the `Import Templates` permission to achieve **Remote Code Execution (RCE)** via the `Package Import` feature.

๐Ÿ“Œ **Original Advisory:** [GitHub Security Advisory](https://github.com/Cacti/cacti/security/advisories/GHSA-7cmj-g5qc-pj88)

----
## Features
- โœ… **Fully Automated Exploitation**: Simplifies the attack process.
- โšก **Flexible Targeting**: Easily configure target URL, credentials, and payload.
- ๐Ÿ“ฆ **Dependency Management**: Ensure smooth installation via `requirements.txt`.

## Prerequisites
Ensure you have the following installed:
- ๐Ÿ **Python 3.x**
- ๐Ÿ“œ Required Python modules (install via `requirements.txt`)

## Installation
Clone the repository:
```sh
git clone https://github.com/regantemudo/CVE-2024-25641-Exploit-for-Cacti-1.2.26.git
cd CVE-2024-25641-Exploit-for-Cacti-1.2.26
```

Install dependencies:
```sh
pip install -r requirements.txt
```

## Usage
### ๐Ÿš€ Prepare Your PHP Payload
By default, the script uses `./php/reverse_shell.php` as the payload. Modify the IP address and port inside the PHP script accordingly.

### ๐Ÿ”ฅ Run the Exploit
```sh
python3 cacti_exploit.py <URL> <username> <password> [-p <payload_path>]
```

#### Arguments:
- ๐ŸŒ `URL`: The target Cacti URL.
- ๐Ÿ‘ค `username`: Login username.
- ๐Ÿ”‘ `password`: Login password.
- ๐Ÿ› ๏ธ `-p/--payload`: (Optional) Path to a custom PHP payload (default: `./php/reverse_shell.php`).

### โšก Execute the Payload
Once the script successfully uploads the PHP payload, execute it via the browser or directly through the script.

## Project Structure
```
CVE-2024-25641-Exploit-for-Cacti-1.2.26/
โ”‚โ”€โ”€ php/
|  โ”œโ”€โ”€ reverse_shell.php
โ”‚โ”€โ”€ README.md
โ”‚โ”€โ”€ cacti_exploit.py
โ”‚โ”€โ”€ requirements.txt
```

## โš ๏ธ Disclaimer
This tool is strictly for **educational and authorized penetration testing**. Unauthorized use is illegal and may lead to severe consequences. The authors hold no responsibility for any misuse or damage caused by this software.