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

Goal: 1000 CNY · Raised: 1310 CNY

100%

CVE-2024-32002 PoC — Git's recursive clones on case-insensitive filesystems that support symlinks are susceptible to Remote Code Execution

Source
Associated Vulnerability
Title:Git's recursive clones on case-insensitive filesystems that support symlinks are susceptible to Remote Code Execution (CVE-2024-32002)
Description:Git is a revision control system. Prior to versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4, repositories with submodules can be crafted in a way that exploits a bug in Git whereby it can be fooled into writing files not into the submodule's worktree but into a `.git/` directory. This allows writing a hook that will be executed while the clone operation is still running, giving the user no opportunity to inspect the code that is being executed. The problem has been patched in versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4. If symbolic link support is disabled in Git (e.g. via `git config --global core.symlinks false`), the described attack won't work. As always, it is best to avoid cloning repositories from untrusted sources.
Description
Este script demuestra cómo explotar la vulnerabilidad CVE-2024-32002 para obtener una reverse shell, proporcionando acceso remoto al sistema afectado. Úselo con precaución en entornos controlados y solo con fines educativos o de pruebas de seguridad.
Readme
# CVE-2024-32002-Reverse-Shell
Este script demuestra cómo explotar la vulnerabilidad CVE-2024-32002 para obtener una reverse shell, proporcionando acceso remoto al sistema afectado. Úselo con precaución en entornos controlados y solo con fines educativos o de pruebas de seguridad.


## Publicación del Blog
Este script esta inspirado en el blog Blog: https://amalmurali.me/posts/git-rce. aca encontraras más detalles acerca de esta vulnerabilidad

## Cómo funciona
1. Un repositorio malicioso (`git_rce`) incluye un submódulo con una ruta especialmente diseñada.
2. La ruta del submódulo utiliza una variación de mayúsculas y minúsculas que explota el sistema de archivos que no distingue entre mayúsculas y minúsculas.
3. El submódulo incluye un enlace simbólico que apunta a su directorio `.git/`, que contiene un enlace malicioso.
4. Cuando se clona el repositorio, se sigue el enlace simbólico y se ejecuta el enlace malicioso, lo que lleva a RCE.

##### NOTA:
<h1>Versiones de Git Afectadas y Parcheadas</h1>
    
<h2>Versiones afectadas por la vulnerabilidad:</h2>
    <ul>
        <li>Todas las versiones anteriores a 2.45.1</li>
        <li>Todas las versiones anteriores a 2.44.1</li>
        <li>Todas las versiones anteriores a 2.43.4</li>
        <li>Todas las versiones anteriores a 2.42.2</li>
        <li>Todas las versiones anteriores a 2.41.1</li>
        <li>Todas las versiones anteriores a 2.40.2</li>
        <li>Todas las versiones anteriores a 2.39.4</li>
    </ul>
    
<h2>Versiones parcheadas:</h2>
    <ul>
        <li>2.45.1</li>
        <li>2.44.1</li>
        <li>2.43.4</li>
        <li>2.42.2</li>
        <li>2.41.1</li>
        <li>2.40.2</li>
        <li>2.39.4</li>
    </ul>


## Ejecucion
⚠️ Advertencia: No ejecute esta PoC en sistemas que no sean de su propiedad o que no tenga permiso explícito para usarlo. Las pruebas no autorizadas podrían tener consecuencias no deseadas.
```bash
bash pocgitreveshell.sh
```
Nota: En Windows, es posible que necesites ejecutar el shell como administrador para que esto funcione.

### Como se ve al ejecutar

![image](https://github.com/JJoosh/CVE-2024-32002-Reverse-Shell/assets/122099216/1f48060d-04dd-4331-8ecd-7e15e57735b6)

##### Y Obtendras la revershell

![image](https://github.com/JJoosh/CVE-2024-32002-Reverse-Shell/assets/122099216/98ee1c05-a191-406c-9c35-b6ef2b474d90)


Esto es todo por este PoC :)



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 →