> Windows Syscalls
ntoskrnl.exeT1486T1491.001T1106

NtSetVolumeInformationFile

Verändert beschreibbare Volume-Eigenschaften — vorrangig das Volume-Label — für das Volume hinter einem Datei-Handle.

Prototyp

NTSTATUS NtSetVolumeInformationFile(
  HANDLE                 FileHandle,
  PIO_STATUS_BLOCK       IoStatusBlock,
  PVOID                  FsInformation,
  ULONG                  Length,
  FS_INFORMATION_CLASS   FsInformationClass
);

Argumente

NameTypeDirDescription
FileHandleHANDLEinHandle auf das Volume-Root oder eine Datei darauf; geöffnet mit FILE_WRITE_ATTRIBUTES.
IoStatusBlockPIO_STATUS_BLOCKoutErhält den Abschlussstatus der Set-Operation.
FsInformationPVOIDinVom Aufrufer bereitgestellter Eingabepuffer mit der Struktur passend zu FsInformationClass (z. B. FILE_FS_LABEL_INFORMATION).
LengthULONGinGröße des FsInformation-Puffers in Bytes.
FsInformationClassFS_INFORMATION_CLASSinZu setzende Klasse; in der Praxis fast immer FileFsLabelInformation (2) oder FileFsControlInformation (6).

Syscall-IDs pro Windows-Version

Windows-VersionSyscall-IDBuild
Win10 15070x196win10-1507
Win10 16070x19Fwin10-1607
Win10 17030x1A5win10-1703
Win10 17090x1A8win10-1709
Win10 18030x1AAwin10-1803
Win10 18090x1ABwin10-1809
Win10 19030x1ACwin10-1903
Win10 19090x1ACwin10-1909
Win10 20040x1B2win10-2004
Win10 20H20x1B2win10-20h2
Win10 21H10x1B2win10-21h1
Win10 21H20x1B4win10-21h2
Win10 22H20x1B4win10-22h2
Win11 21H20x1BDwin11-21h2
Win11 22H20x1C1win11-22h2
Win11 23H20x1C1win11-23h2
Win11 24H20x1C4win11-24h2
Server 20160x19Fwinserver-2016
Server 20190x1ABwinserver-2019
Server 20220x1BAwinserver-2022
Server 20250x1C4winserver-2025

Kernel-Modul

ntoskrnl.exeNtSetVolumeInformationFile

Verwandte APIs

SetVolumeLabelWGetVolumeInformationWNtQueryVolumeInformationFileFSCTL_SET_OBJECT_IDNtSetInformationFile

Syscall-Stub

4C 8B D1            mov r10, rcx
B8 C4 01 00 00      mov eax, 0x1C4
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

Undokumentierte Hinweise

Deutlich seltener als das `Query`-Pendant, weil die FS_INFORMATION_CLASS-Werte, die Filesystems auf dem `Set`-Pfad tatsächlich akzeptieren, begrenzt sind: `FileFsLabelInformation` (Volume umbenennen), `FileFsControlInformation` (Quoten-Policy auf NTFS) und `FileFsObjectIdInformation` (NTFS-Object-Id-Zuweisung). Die meisten anderen Klassen liefern `STATUS_INVALID_INFO_CLASS`. Das IRP läuft über `IRP_MJ_SET_VOLUME_INFORMATION` und erreicht NTFS bei `NtfsFsdSetVolumeInformation`. Das Umbenennen eines Volumes erfordert das Privileg `SE_MANAGE_VOLUME_NAME`, das interaktive Administratoren und `LocalSystem` haben — Standardbenutzer jedoch nicht — sodass der Einsatz dieses Syscalls aus einem Nicht-Admin-Kontext für sich genommen ungewöhnliche Telemetrie ist.

Häufige Malware-Nutzung

Nische, aber sichtbar. Eine Handvoll Ransomware-Familien — bekanntester Fall **Petya/NotPetya** (2017, MBR-Verschlüsseler) und einige **Babuk**- / **DarkSide**-Affiliates — setzen `FileFsLabelInformation`, um den Volume-Namen mit ihrer Marke oder einem `READ_ME_*`-String zu überschreiben, sodass jeder Pre-Boot-Recovery-Bildschirm oder `dir C:\` den Lösegeld-Marker anzeigt, bevor der Benutzer die Notiz öffnet. **BlackMatter** (2021) benannte Labels in einen kurzen Hash um, der zur Ransom-ID passte. Jenseits von Ransomware ist der Aufruf von Commodity-Malware praktisch ungenutzt — es gibt hier keine offensive Primitive, nur Branding.

Erkennungs­möglichkeiten

Microsoft Defender for Endpoint zeigt Label-Änderungen über `DeviceEvents` ActionType `VolumeMounted` / `VolumeRenamed`. Sysmon deckt das *nicht* direkt ab, aber IRP-Traces des ETW-Providers `Microsoft-Windows-Kernel-File` zeigen `IRP_MJ_SET_VOLUME_INFORMATION` mit Klasse 2 (`FileFsLabelInformation`). Weil der privilegierte Pfad so schmal ist, sollte *jeder* `NtSetVolumeInformationFile(FileFsLabelInformation)` aus einem nicht vertrauenswürdigen Prozess — alles, was nicht `explorer.exe`, `cmd.exe label`, `format.com` oder ein bekanntes Backup-Produkt ist — als Ransomware-Indikator hoher Konfidenz gelten, insbesondere wenn Sekunden zuvor mit `NtQueryVolumeInformationFile` alle Laufwerksbuchstaben enumeriert wurden.

Direkte Syscall-Beispiele

asmx64 direct stub (Win11 24H2)

; Direct syscall stub for NtSetVolumeInformationFile (SSN 0x1C4 on Win11 24H2 / Server 2025)
NtSetVolumeInformationFile PROC
    mov  r10, rcx          ; syscall convention
    mov  eax, 1C4h         ; SSN — drifts; resolve dynamically for portability
    syscall
    ret
NtSetVolumeInformationFile ENDP

cPetya-style volume relabel

// Requires SE_MANAGE_VOLUME_NAME privilege. Petya/NotPetya stamped
// volume labels with their ransom marker — visible in pre-boot UI.
#include <ntstatus.h>

typedef struct _FILE_FS_LABEL_INFORMATION {
    ULONG VolumeLabelLength;        // bytes, not chars
    WCHAR VolumeLabel[1];
} FILE_FS_LABEL_INFORMATION;

WCHAR  label[] = L"READ_ME_NOW";
SIZE_T bytes   = sizeof(label) - sizeof(WCHAR);
BYTE   buf[sizeof(FILE_FS_LABEL_INFORMATION) + sizeof(label)];
FILE_FS_LABEL_INFORMATION* p = (FILE_FS_LABEL_INFORMATION*)buf;
p->VolumeLabelLength = (ULONG)bytes;
memcpy(p->VolumeLabel, label, bytes);

IO_STATUS_BLOCK iosb;
NTSTATUS st = NtSetVolumeInformationFile(
    hVolumeRoot, &iosb, p,
    (ULONG)(sizeof(FILE_FS_LABEL_INFORMATION) + bytes),
    2 /* FileFsLabelInformation */);

rustSetVolumeLabelW wrapper (windows-sys)

// Cargo: windows-sys = "0.59" (Win32_Storage_FileSystem)
use windows_sys::Win32::Storage::FileSystem::SetVolumeLabelW;
use std::ffi::OsStr;
use std::os::windows::ffi::OsStrExt;

// Internally calls NtSetVolumeInformationFile(FileFsLabelInformation).
fn relabel(root: &str, label: &str) -> bool {
    let to_wide = |s: &str| -> Vec<u16> { OsStr::new(s).encode_wide().chain(Some(0)).collect() };
    let r = to_wide(root);
    let l = to_wide(label);
    unsafe { SetVolumeLabelW(r.as_ptr(), l.as_ptr()) != 0 }
}

MITRE ATT&CK-Mappings

Last verified: 2026-05-20