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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2024-6387 PoC — Openssh: regresshion - race condition in ssh allows rce/dos

Source
Associated Vulnerability
Title:Openssh: regresshion - race condition in ssh allows rce/dos (CVE-2024-6387)
Description:A security regression (CVE-2006-5051) was discovered in OpenSSH's server (sshd). There is a race condition which can lead sshd to handle some signals in an unsafe manner. An unauthenticated, remote attacker may be able to trigger it by failing to authenticate within a set time period.
Description
A Bash script to mitigate the CVE-2024-6387 vulnerability in OpenSSH by providing an option to upgrade to a secure version or apply a temporary workaround. This repository helps secure systems against potential remote code execution risks associated with affected OpenSSH versions.
Readme
# CVE-2024-6387 OpenSSH Vulnerability Mitigation Script

## Overview

This Bash script is designed to help mitigate the CVE-2024-6387 vulnerability in OpenSSH. The vulnerability affects certain versions of OpenSSH and can potentially allow remote unauthenticated attackers to execute arbitrary code on your system. This script gives you the option to upgrade to a safe version of OpenSSH or apply a temporary fix to reduce the risk of exploitation.

### Affected Versions

- **Vulnerable Versions:**
  - OpenSSH versions earlier than 4.4p1 are vulnerable unless patched for CVE-2006-5051 and CVE-2008-4109.
  - Versions from 8.5p1 up to, but not including, 9.8p1 are vulnerable due to the reintroduction of a critical issue.

- **Safe Versions:**
  - Versions from 4.4p1 to 8.5p1 are not vulnerable due to a patch that was applied in these versions.
  - Versions 9.8p1 and later include the necessary fixes.

## Script Features

- **Version Check:** 
  - The script checks your current OpenSSH version to determine if it is vulnerable.
  
- **Upgrade Option:** 
  - If your version is vulnerable, the script prompts you to upgrade OpenSSH to the latest secure version.

- **Temporary Fix:** 
  - If you choose not to upgrade, the script applies a temporary workaround by modifying the `sshd_config` file to reduce the attack surface.

- **User Notifications:** 
  - The script concludes by advising on best practices for securing your SSH service.

## Usage

1. **Download and Save the Script:**
   - Save the script to your local machine with a name like `fix_cve_2024_6387.sh`.

2. **Make the Script Executable:**
   - Run the following command to make the script executable:
     ```bash
     chmod +x fix_cve_2024_6387.sh
     ```

3. **Run the Script with Root Privileges:**
   - Execute the script using `sudo` to ensure it has the necessary permissions:
     ```bash
     sudo ./fix_cve_2024_6387.sh
     ```

4. **Follow the Prompts:**
   - If your OpenSSH version is vulnerable, the script will prompt you to upgrade. You can choose to upgrade or apply the temporary fix.

## Important Notes

- **Backup:** It is always recommended to backup your SSH configuration files and other important data before running any scripts that modify system settings.

- **Monitoring:** After applying the fix or upgrading, monitor your SSH logs for any unusual activity and ensure that your SSH service is restricted to trusted networks.

- **Key-Based Authentication:** For enhanced security, use key-based authentication instead of password-based authentication.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contributing

If you find any issues or have suggestions for improvements, feel free to submit a pull request or open an issue.

File Snapshot

[4.0K] /data/pocs/c43e01a1b2d37f9a30001ff04c6022896e96e251 ├── [2.4K] fix_cve_2024_6387.sh ├── [1.0K] LICENSE └── [2.7K] README.md 0 directories, 3 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 →