> Windows Syscalls
ntoskrnl.exeT1055T1055.012T1055.013

NtCreateSection

Erzeugt ein Section-Objekt, gestützt durch eine Datei oder das System-Pagefile, für Shared-Memory-Mapping.

Prototyp

NTSTATUS NtCreateSection(
  PHANDLE            SectionHandle,
  ACCESS_MASK        DesiredAccess,
  POBJECT_ATTRIBUTES ObjectAttributes,
  PLARGE_INTEGER     MaximumSize,
  ULONG              SectionPageProtection,
  ULONG              AllocationAttributes,
  HANDLE             FileHandle
);

Argumente

NameTypeDirDescription
SectionHandlePHANDLEoutErhält das Handle auf das neue Section-Objekt.
DesiredAccessACCESS_MASKinRechte für das Section-Handle, z. B. SECTION_MAP_READ | SECTION_MAP_WRITE | SECTION_MAP_EXECUTE.
ObjectAttributesPOBJECT_ATTRIBUTESinOptional. Setzt Objektname (für benannte Sections) und Sicherheitsattribute. NULL für anonym.
MaximumSizePLARGE_INTEGERinMaximalgröße der Section. Pflicht für pagefile-basierte, optional bei file-basierten.
SectionPageProtectionULONGinInitialer Seitenschutz, z. B. PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE_READWRITE.
AllocationAttributesULONGinSEC_COMMIT, SEC_RESERVE, SEC_IMAGE, SEC_LARGE_PAGES usw. SEC_IMAGE parst FileHandle als PE.
FileHandleHANDLEinHandle auf die Backing-Datei oder NULL für eine pagefile-basierte (anonyme) Section.

Syscall-IDs pro Windows-Version

Windows-VersionSyscall-IDBuild
Win10 15070x4Awin10-1507
Win10 16070x4Awin10-1607
Win10 17030x4Awin10-1703
Win10 17090x4Awin10-1709
Win10 18030x4Awin10-1803
Win10 18090x4Awin10-1809
Win10 19030x4Awin10-1903
Win10 19090x4Awin10-1909
Win10 20040x4Awin10-2004
Win10 20H20x4Awin10-20h2
Win10 21H10x4Awin10-21h1
Win10 21H20x4Awin10-21h2
Win10 22H20x4Awin10-22h2
Win11 21H20x4Awin11-21h2
Win11 22H20x4Awin11-22h2
Win11 23H20x4Awin11-23h2
Win11 24H20x4Awin11-24h2
Server 20160x4Awinserver-2016
Server 20190x4Awinserver-2019
Server 20220x4Awinserver-2022
Server 20250x4Awinserver-2025

Kernel-Modul

ntoskrnl.exeNtCreateSection

Verwandte APIs

CreateFileMappingWCreateFileMappingANtOpenSectionNtMapViewOfSectionNtUnmapViewOfSectionNtExtendSectionZwCreateSection

Syscall-Stub

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

Erzeugt ein `_SECTION`-Objekt — die Kernel-Primitive hinter jedem File-Mapping, jedem geladenen Image und jeder Shared-Memory-Region in Windows. SSN `0x4A` ist über alle Win10/11-Builds stabil. `SEC_IMAGE` ist das mächtigste Flag: Der Kernel parst FileHandle als PE (validiert Header, wendet Relocations an, baut Subsections gemäß `IMAGE_SECTION_HEADER` auf) und die resultierende View *ist* aus Kernel-Sicht ein geladenes Modul — sie erscheint in `PsLoadedModuleList`-äquivalenten Strukturen und erzeugt `Image Load`-Events. Anonyme (`FileHandle = NULL`) pagefile-basierte Sections sind schlicht geteiltes RAM.

Häufige Malware-Nutzung

Der Setup-Schritt jeder Section-basierten Injection-Technik. Anonyme + `PAGE_EXECUTE_READWRITE`-Sections speisen Process Doppelgänging, Transacted Hollowing, Atom Bombing und die ursprüngliche `MapViewOfSection`-Injection. `SEC_IMAGE`-Sections über sauberen signierten DLLs speisen Module-Stomping-Loader und `KnownDlls`-Poisoning. Process Ghosting (von Gabriel Landau) erzeugt eine Delete-Pending-Datei, baut eine `SEC_IMAGE`-Section darüber und löscht die Datei dann, bevor die Section ausgehängt wird — zurück bleibt ein ausführbares Image im Speicher ohne Disk-Artefakt für den AV.

Erkennungs­möglichkeiten

`NtCreateSection` selbst ist zu häufig (jedes `LoadLibrary` und `CreateFileMapping` trifft es), um direkt zu alarmieren. Die Signale entstehen weiter unten: ETW Threat Intelligence emittiert Events, wenn eine Section ausführbar in einen Remote-Prozess gemappt wird; PE-Sieve und Moneta markieren `MappedImage`-Regionen, deren Backing-Datei gelöscht oder ersetzt wurde; Minifilter-Treiber beobachten `IRP_MJ_CREATE` mit `FILE_DELETE_ON_CLOSE` gefolgt von einer Section-Erzeugung als Process-Ghosting-Muster. `SEC_IMAGE`-Sections über Nicht-Microsoft-Dateien in PPL-Zielen sind hochverdächtig. Beachten Sie zudem, dass `SEC_NO_CHANGE` + `SEC_IMAGE` mitunter genutzt wird, um eine Region nach dem Mappen gegen `NtProtectVirtualMemory`-Änderungen resistent zu machen.

Direkte Syscall-Beispiele

asmx64 direct stub

; Direct syscall stub for NtCreateSection (SSN 0x4A, stable across all Win10/11)
NtCreateSection PROC
    mov  r10, rcx          ; syscall convention
    mov  eax, 4Ah          ; SSN
    syscall
    ret
NtCreateSection ENDP

cAnonymous RWX section for injection

// Pagefile-backed RWX section, used as the carrier for cross-process shellcode.
HANDLE        hSection = NULL;
LARGE_INTEGER size     = { .QuadPart = 0x10000 };
NTSTATUS st = NtCreateSection(&hSection, SECTION_ALL_ACCESS, NULL, &size,
                              PAGE_EXECUTE_READWRITE, SEC_COMMIT, NULL);
if (!NT_SUCCESS(st)) return st;
// hSection can now be mapped RW locally and RX remotely (see NtMapViewOfSection).

cHell's Gate dynamic lookup

// Resolve SSN at runtime so the indirect-syscall trampoline doesn't need a build switch.
typedef NTSTATUS (NTAPI *pNtCreateSection)(PHANDLE, ACCESS_MASK,
                                           POBJECT_ATTRIBUTES, PLARGE_INTEGER,
                                           ULONG, ULONG, HANDLE);

DWORD ssn = GetSyscallNumber(GetProcAddress(GetModuleHandleA("ntdll.dll"),
                                            "NtCreateSection"));
set_ssn(ssn);
indirect_syscall_invoke(/* &hSection, ... */);

MITRE ATT&CK-Mappings

Last verified: 2026-05-20