> Windows Syscalls
ntoskrnl.exeT1055T1055.012T1055.013

NtCreateSection

Creates a section object backed by a file or the system pagefile for shared memory mapping.

Prototype

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

Arguments

NameTypeDirDescription
SectionHandlePHANDLEoutReceives the handle to the new section object.
DesiredAccessACCESS_MASKinRights for the section handle, e.g. SECTION_MAP_READ | SECTION_MAP_WRITE | SECTION_MAP_EXECUTE.
ObjectAttributesPOBJECT_ATTRIBUTESinOptional. Sets the object name (for named sections) and security attributes. NULL for anonymous.
MaximumSizePLARGE_INTEGERinMaximum size of the section. Required for pagefile-backed, optional for file-backed.
SectionPageProtectionULONGinInitial page protection, e.g. PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE_READWRITE.
AllocationAttributesULONGinSEC_COMMIT, SEC_RESERVE, SEC_IMAGE, SEC_LARGE_PAGES, etc. SEC_IMAGE parses FileHandle as a PE.
FileHandleHANDLEinHandle to the backing file, or NULL for a pagefile-backed (anonymous) section.

Syscall IDs by 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 module

ntoskrnl.exeNtCreateSection

Related 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

Undocumented notes

Creates a `_SECTION` object — the kernel primitive behind every file mapping, every loaded image, and every shared memory region in Windows. SSN `0x4A` has been stable across all Win10/11 builds. `SEC_IMAGE` is the most powerful flag: the kernel parses the FileHandle as a PE (validates headers, applies relocations, sets up subsections per `IMAGE_SECTION_HEADER`) and the resulting view *is* a loaded module from the kernel's perspective — it will appear in `PsLoadedModuleList`-equivalent process structures and produce `Image Load` events. Anonymous (`FileHandle = NULL`) sections backed by the pagefile are simply shared RAM.

Common malware usage

The setup step for every section-based injection technique. Anonymous + `PAGE_EXECUTE_READWRITE` sections feed Process Doppelgänging, Transacted Hollowing, Atom Bombing, and the original `MapViewOfSection` injection. `SEC_IMAGE` sections opened from a clean signed DLL feed module-stomping loaders and `KnownDlls` poisoning. Process Ghosting (created by Gabriel Landau) creates a delete-pending file, builds a `SEC_IMAGE` section over it, then deletes the file before the section is unmapped — leaving an executable image in memory with no on-disk artifact for AV to scan.

BumbleBeeCobalt StrikeFIN7 CarbanakSliverLazarus toolingIcedID

Detection opportunities

`NtCreateSection` itself is too common (every `LoadLibrary` and `CreateFileMapping` hits it) to alert on directly. The signals come downstream: ETW Threat Intelligence emits events when a section is mapped executable into a remote process; PE-Sieve and Moneta flag `MappedImage` regions whose backing file has been deleted or replaced; minifilter drivers observe `IRP_MJ_CREATE` with `FILE_DELETE_ON_CLOSE` followed by a section creation as a Process-Ghosting pattern. Sections created with `SEC_IMAGE` over non-Microsoft files in PPL targets are extremely suspicious. Note also that `SEC_NO_CHANGE` + `SEC_IMAGE` is sometimes used to make a region resist `NtProtectVirtualMemory` modifications post-mapping.

Direct syscall examples

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