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

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2012-1823 PoC — PHP ‘php-cgi’ 参数信息泄漏漏洞

Source
Associated Vulnerability
Title: PHP ‘php-cgi’ 参数信息泄漏漏洞 (CVE-2012-1823)
Description:sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not properly handle query strings that lack an = (equals sign) character, which allows remote attackers to execute arbitrary code by placing command-line options in the query string, related to lack of skipping a certain php_getopt for the 'd' case.
Description
Prova de conceito de php cgi argument injection 
Readme
# CVE-2012-1823 Exploit

![bandicam 2024-08-13 22-08-19-565](https://github.com/user-attachments/assets/326aebee-1c87-46d2-a6ed-77c89b128be8)


Este repositório contém um exploit em PHP para a vulnerabilidade [CVE-2012-1823](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-1823). A vulnerabilidade permite a execução remota de código em servidores PHP mal configurados.

## Descrição

O script PHP fornece um método simples para explorar a vulnerabilidade CVE-2012-1823 em um servidor alvo. A ferramenta usa a funcionalidade `allow_url_include` e `auto_prepend_file` para executar um comando arbitrário no servidor alvo.

## Funcionalidades

- Envio de um payload PHP para um servidor vulnerável.
- Execução de comandos remotos no servidor alvo.
- Exibição da resposta do servidor após a execução do comando.

## Requisitos

- PHP (versão >= 5.3)
- `curl` instalado no sistema

## Instalação

1. Clone o repositório:

    ```bash
    git clone https://github.com/0xFatality/CVE-2012-1823.git
    cd CVE-2012-1823
    ```

2. Certifique-se de que você tem as permissões apropriadas para executar o script:

    ```bash
    chmod +x exploit.php
    ```

## Uso

1. Execute o script PHP:

    ```bash
    php exploit.php
    ```

2. Insira o URL do servidor alvo (RHOST) e o comando que deseja executar quando solicitado:

    ```plaintext
    [*] Informe o RHOST (ex: http://10.128.20.2): http://example.com
    [*] Informe o COMANDO (ex: whoami): whoami
    ```

3. O script enviará o payload para o servidor e exibirá a resposta.

## Exemplo

```bash
[*] Informe o RHOST (ex: http://10.128.20.2): http://example.com
[*] Informe o COMANDO (ex: whoami): whoami
[*] Enviando payload...
[*] Resposta do servidor:
www-data
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 →