> Windows Syscalls
ntoskrnl.exeT1068T1014T1562.001

NtSetSystemInformation

Setter noyau générique sélectionné par SYSTEM_INFORMATION_CLASS — porte d'entrée pour SystemDebugControl, chargement de pilotes GDI, etc.

Prototype

NTSTATUS NtSetSystemInformation(
  SYSTEM_INFORMATION_CLASS SystemInformationClass,
  PVOID                    SystemInformation,
  ULONG                    SystemInformationLength
);

Arguments

NameTypeDirDescription
SystemInformationClassSYSTEM_INFORMATION_CLASSinÉnum sélectionnant l'opération, ex. SystemLoadGdiDriverInformation (26), SystemDebugControl (37), SystemRegistryQuotaInformation.
SystemInformationPVOIDinTampon d'entrée propre à la classe (ex. SYSTEM_GDI_DRIVER_INFORMATION, SYSTEM_LOAD_GDI_DRIVER_INFORMATION).
SystemInformationLengthULONGinTaille en octets du tampon SystemInformation.

IDs de syscalls par version de Windows

Version de WindowsID de syscallBuild
Win10 15070x18Ewin10-1507
Win10 16070x197win10-1607
Win10 17030x19Dwin10-1703
Win10 17090x1A0win10-1709
Win10 18030x1A2win10-1803
Win10 18090x1A3win10-1809
Win10 19030x1A4win10-1903
Win10 19090x1A4win10-1909
Win10 20040x1AAwin10-2004
Win10 20H20x1AAwin10-20h2
Win10 21H10x1AAwin10-21h1
Win10 21H20x1ACwin10-21h2
Win10 22H20x1ACwin10-22h2
Win11 21H20x1B5win11-21h2
Win11 22H20x1B9win11-22h2
Win11 23H20x1B9win11-23h2
Win11 24H20x1BCwin11-24h2
Server 20160x197winserver-2016
Server 20190x1A3winserver-2019
Server 20220x1B2winserver-2022
Server 20250x1BCwinserver-2025

Module noyau

ntoskrnl.exeNtSetSystemInformation

APIs liées

NtQuerySystemInformationNtSystemDebugControlNtLoadDriverNtUnloadDriverSetSystemFileCacheSize

Stub du syscall

4C 8B D1            mov r10, rcx
B8 BC 01 00 00      mov eax, 0x1BC
F6 04 25 08 03 FE 7F 01   test byte ptr [0x7FFE0308], 1
75 03               jne short +3
0F 05               syscall
C3                  ret
CD 2E               int 2Eh
C3                  ret

Notes non documentées

Contrairement à la plupart de ses voisins, le SSN de NtSetSystemInformation glisse à chaque release : `0x18E` en 1507, `0x1A4` en 1903/1909, `0x1AA` en 2004-21H1, `0x1AC` en 21H2/22H2, puis `0x1B5`/`0x1B9`/`0x1BC` sous Win11. Tout stub codé en dur *doit* s'accompagner d'une vérification de build ou d'une résolution dynamique. La fonction est le pendant en écriture de NtQuerySystemInformation, et les contrôles d'accès dépendent du `SYSTEM_INFORMATION_CLASS` choisi : la plupart des classes exigent SeTcbPrivilege, SeLoadDriverPrivilege ou SeDebugPrivilege.

Usage courant par les malwares

Deux abus notables. (1) **`SystemLoadGdiDriverInformation` (26)** chargeait historiquement un pilote GDI mode noyau à partir d'un chemin UNICODE_STRING fourni par l'appelant — vecteur classique de chargement de pilote non signé/exploitable avant KMCS. Windows moderne bloque la voie non signée sous HVCI/Vulnerable Driver Blocklist, mais les acteurs continuent à l'appeler dans les chaînes BYOVD où le pilote est lui-même signé. (2) **`SystemDebugControl` (37)** avec les sous-commandes `SysDbgReadVirtual` / `SysDbgWriteVirtual` permet à un appelant détenant `SeDebugPrivilege` de lire ou écrire en mémoire noyau sans charger de pilote — utilisé par certains rootkits et outils red-team pour des patchs noyau discrets quand l'EDR a déjà neutralisé la surface évidente de chargement de pilote. Quelques familles altèrent aussi `SystemRegistryQuotaInformation` pour saturer le registre et désactiver les composants Windows dépendant des quotas.

Opportunités de détection

Les appels à `NtSetSystemInformation` sont peu fréquents hors OS — les heuristiques volumétriques fonctionnent. La meilleure source est l'ETW `ImageLoad` Microsoft-Windows-Kernel-General couplé au callback noyau PsSetLoadImageNotifyRoutine, qui se déclenche dès qu'un pilote noyau est chargé via la classe 26 — Defender Application Control et la Microsoft Vulnerable Driver Blocklist le consomment pour bloquer les pilotes connus comme `gdrv.sys`, `RTCore64.sys`, `dbutil_2_3.sys`. Auditer `Audit Privilege Use` (Event ID 4673) pour SeLoadDriverPrivilege et SeDebugPrivilege, et guetter les appelants inattendus (autre que System, services.exe) invoquant NtSetSystemInformation. Les syscalls directs ne peuvent pas supprimer la notification de chargement de pilote, quoi qu'il fasse en user-mode.

Exemples de syscalls directs

cBYOVD: load a signed-but-vulnerable driver via class 26

// SystemLoadGdiDriverInformation == 26
typedef struct _SYSTEM_GDI_DRIVER_INFORMATION {
    UNICODE_STRING DriverName;
    PVOID ImageAddress;
    PVOID SectionPointer;
    PVOID EntryPoint;
    PIMAGE_EXPORT_DIRECTORY ExportSectionPointer;
    ULONG ImageLength;
} SYSTEM_GDI_DRIVER_INFORMATION, *PSYSTEM_GDI_DRIVER_INFORMATION;

SYSTEM_GDI_DRIVER_INFORMATION info = {0};
RtlInitUnicodeString(&info.DriverName,
    L"\\??\\C:\\ProgramData\\vuln.sys");

// Caller must hold SeLoadDriverPrivilege (enabled, not just present).
NTSTATUS s = NtSetSystemInformation(
    26 /* SystemLoadGdiDriverInformation */,
    &info,
    sizeof(info));

asmDirect stub for Win11 24H2 (SSN 0x1BC)

; Build-pinned to Win11 24H2 / Server 2025. Use dynamic resolution
; (Hell's Gate / Halo's Gate / Tartarus' Gate) for portable stubs —
; this SSN moves on every feature update.
NtSetSystemInformation_24H2 PROC
    mov  r10, rcx
    mov  eax, 1BCh
    syscall
    ret
NtSetSystemInformation_24H2 ENDP

cKernel write via SystemDebugControl (privileged)

// SystemDebugControl == 37 (Set-variant accepts SysDbgWriteVirtual etc.)
typedef enum _SYSDBG_COMMAND {
    SysDbgReadVirtual  = 8,
    SysDbgWriteVirtual = 9,
} SYSDBG_COMMAND;

typedef struct _SYSDBG_VIRTUAL {
    PVOID Address;
    PVOID Buffer;
    ULONG Request;
} SYSDBG_VIRTUAL, *PSYSDBG_VIRTUAL;

// Enable SeDebugPrivilege first.
SYSDBG_VIRTUAL v = {
    .Address = (PVOID)0xfffff80000000000ULL, // kernel target
    .Buffer  = patchBytes,
    .Request = patchLen,
};
NtSystemDebugControl(SysDbgWriteVirtual, &v, sizeof(v), NULL, 0, NULL);
// (Note: ntoskrnl exposes both NtSystemDebugControl and SystemDebugControl
//  via NtSetSystemInformation; modern builds prefer the dedicated syscall.)

Mappings MITRE ATT&CK

Last verified: 2026-05-20