Geniorio01 / CVE-2024-21508-mysql2-RCE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› οΈ CVE-2024-21508 Exploit

🌟 Description

mysql2 is a mostly API compatible with mysqljs and supports majority of features.

Affected versions of this package are vulnerable to Remote Code Execution (RCE) via the readCodeFor function due to improper validation of the supportBigNumbers and bigNumberStrings values.

βš™οΈ Installation

To set up the exploitation tool, follow these steps:

  1. Download the repository:
Download
  1. Navigate to the tool's directory:
cd CVE-2024-21508
  1. Install the required Python packages:
pip install -r requirements.txt

πŸš€ Usage

To use the tool, run the script from the command line as follows:

python exploit.py [options]

Options

  • -u, --url: Specify the target URL or IP address.

  • -f, --file: Specify a file containing a list of URLs to scan.

  • -t, --threads: Set the number of threads for concurrent scanning.

  • -o, --output: Define an output file to save the scan results.

When a single URL is provided with the -u option and the target is vulnerable, the script will attempt to open an interactive shell.

Example

$ python3 exploit.py -u http://127.0.0.1
[+] Command executed successfully.
[!] http://127.0.0.1 is vulnerable to CVE-2024-21508: uid=0(root) gid=0(root)
[+] Opening interactive shell...
$ id
[+] Command executed successfully.
uid=0(root) gid=0(root)

πŸ“Š Mass Scanning

For mass scanning, use the -f option with a file containing URLs. The tool will scan each URL and print concise results, indicating whether each target is vulnerable.

python exploit.py -f urls.txt

πŸ—’οΈ Affected Versions

The vulnerability affects the following versions of MySQL2:

  • mysql2 to version 3.9.4 or LOWER.

These systems are considered to be end-of-life (EOL), meaning they are no longer supported or receiving updates from the manufacturer. It is strongly recommended that these systems are no longer used.

πŸ›‘οΈ Disclaimer

Use this tool responsibly and ethically. Always obtain proper authorization before testing any system for vulnerabilities.

πŸ‘ Acknowledgments

Special thanks to the researcher @netsecfish for their work in identifying this vulnerability.

About