📝
Home
Pentesting
  • 📝Home
  • ⚒️PENTESTING
    • Foundational
      • Gaining Access
      • Session Hijacking
      • Buffer Overflows
        • Finding the Offset
        • Spiking
        • Fuzzing
      • Attack Basics
        • Brute Force Attacks
        • Credential Stuffing and Password Spraying
        • Netcat Shell Stabilization
        • Reverse Shells vs Bind Shells
        • Staged vs Non-Staged Payloads
      • Footprinting
    • Reconnaissance
      • Discovering Email Addresses
      • Hunting Subdomains
    • Scanning and Enumeration
      • Banner Grabbing
      • Enumerating HTTP and HTTPS
      • Enumerating SMB
      • Enumerating SSH
      • NetBIOS Enumeration
      • SNMP Enumeration
      • Sniffing
    • Privilege Escalation
      • 🐧Linux Privilege Escalation
      • 🪟Windows Privilege Escalation
        • Initial Enumeration
    • Defense Evasion
      • Hiding Files and Covering Tracks
      • Network Evasion
    • Attacking Services
      • Attacking Kerberos
      • Attacking VPNs
      • Denial of Service
      • Exploiting FTP
      • Exploiting NFS
      • Exploiting SMTP
      • Exploiting Telnet
    • Attacking Active Directory
      • Initial Attack Vectors
        • Gaining Shell Access
        • LLMNR Poisoning
        • SMB Relay
        • Passback Attacks
        • IPv6 Attacks
      • Post-Compromise Enumeration
        • Bloodhound
        • ldapdomaindump
        • PowerView
        • PlumHound
      • Post-Compromise Attacks
        • GPP Attacks
        • Print Nightmare
        • Token Impersonation using Incognito
        • URL File Attack
        • Pass Attacks
        • Kerberoasting
        • LNK File Attacks
        • Mimikatz
      • Post-Domain Compromise Attacks
        • Dumping the NTDS.dit
        • Golden Ticket Attacks
      • Post Exploitation
    • Toolkit
      • Burp Suite
        • Intruder
      • Hping
        • Crafting TCP and UDP Packets
      • Metasploit
        • Meterpreter
        • Shell Handler
        • Gather Information
        • Gaining Root
    • Web Application Hacking
      • Attack Methodology
      • Attacking Web Applications
      • Authentication Bypass
      • Cross-Site Scripting
      • Cross-Site Request Forgery
      • File Inclusion
      • Server-Side Request Forgery
      • Injection
        • Command Injection
        • LDAP Injection
        • SQL Injection
  • 👽MALWARE ANALYSIS
    • Malware Analysis Primer
    • Malware Types
      • Rootkits
      • Viruses
      • WannaCry
    • Analyzing Malicious Windows Programs
    • Static Analysis
      • Basic Static Techniques
      • Advanced Static Analysis
    • Reverse Engineering
      • Crash Course in x86 Disassembly
      • Recognizing Code in Assembly Language
    • Dynamic Analysis
    • Detecting Malware
      • Evasion Techniques
      • Detecting Mimikatz
      • Hunting Malware
      • Hunting Metasploit
      • Hunting Persistence
  • 🏹THREAT HUNTING
    • Foundational
      • ATT&CK Framework
      • CIA Triad
    • APTs
  • 🐍PROGRAMMING & SCRIPTING
    • Foundational
      • Computer Memory
    • C Programming
    • Assembly Language
      • Assembly File Structure
      • Debugging with gdb
    • Bash
    • Python
      • Foundational
        • Booleans and Operators
        • Comprehensions
        • Conditionals
        • Dictionaries
        • Exceptions and Error Handling
        • Functions
        • Lambdas
        • Lists
        • Loops
        • Modules
        • Numbers
        • Reading and Writing Files
        • Sets
        • Sockets
        • String Formatting
        • Tuples
        • User Input
        • Variables
      • Extending Python
        • Virtual Environments
        • Sys Module
        • Requests
        • pwntools
    • Regular Expressions
    • SQL
  • 🕵️DIGITAL FORENSICS
    • Anti-Forensic Techniques
    • 🪟Windows Security Internals
      • Windows Security Internals
        • Kernel
          • Security Reference Monitor (SRM)
          • Object Manager
            • System Calls
            • NTSTATUS Codes
            • Object Handles
            • Query and Set Information System Calls
          • The I/O Manager & The Process and Thread Manager
          • The Memory Manager
          • The Configuration Manager
  • 💼GRC (CISSP Notes)
    • Security Assessment and Testing
    • Security Governance Principles
    • Security Policies Standards and Procedures
    • Preventing and Responding to Incidents
    • Organizational Roles and Responsibilities
    • Organizational Processes
  • 📦Networking
    • Foundational
      • DHCP
      • DNS Basics
      • HTTP Protocol
      • IPSec
      • IPv6 Fundamentals
    • Wireless Technologies
      • 802.11
      • Bluetooth
      • Wireless Authentication
      • Wireless Encryption
Powered by GitBook
On this page
  1. DIGITAL FORENSICS
  2. Windows Security Internals
  3. Windows Security Internals
  4. Kernel
  5. Object Manager

System Calls

  • System calls perform some operation on a specific type of kernel object exposed by the object manager

    • Example: NtCreateMutant system call creates Mutant object, which is a mutual exclusion primitive used for locking and thread synchronization

  • System call names follow a common pattern and start with either Nt or Zw

  • The rest of the name relates to the kernel object type the system call operates on

    • Create - creates a new object. Maps to New-Nt <Type> PowerShell commands

    • Open - opens an existing object. Maps to Get-Nt <Type> PowerShell commands

    • QueryInformation - queries object information and properties

    • SetInformation - sets object information and properties

C-language prototype for NtCreateMutant
// 
NTSTATUS NtCreateMutant(
    HANDLE* FileHandle,
    //represents the operations the caller wants to be able to perform on the Mutant using the handle
    ACCESS_MARK DesiredAccess, 
    // Defines the attributes for the object to open or create
    OBJECT_ATTRIBUTES* ObjectAttributes,
    // Represents if the created Mutant is owned by the caller or not
    BOOLEAN InitialOwner
);
The OBJECT_ATTRIBUTES structure
struct OBJECT_ATTRIBUTES {
    // Represents the length of the structure
    ULONG           Length;
    // RootDirectory and ObjectName indicate how the system call should look up the resource being accessed
    HANDLE          RootDirectory; // Handle to an opened kernel object to use as the base for looking up the object
    UNICODE_STRING* ObjectName; // A pointer to a UNICODE_STRING structure
    ULONG           Attributes;
    PVOID           SecurityDescriptor;
    PVOID           SecurityQualityOfService;
}
The UNICODE_STRING structure
struct UNICODE_STRING {
    // Lengths are stored in USHORT - unsigned 16 bit integers
    // Represents the total valid length of the string pointed to by Buffer in bytes
    USHORT Length;
    // Represents the max length of the string pointer to by Buffer in bytes
    USHORT MaximumLength;
    // A pointer to an array of 16-bit Unicode charactes used to reference the string data
    WCHAR* Buffer;
}

Object Attribute Flags and Descriptions

PowerShell name
Description

Inherit

Marks the handle as inheritable

Permanent

Marks the handle as permanent

Exclusive

Marks the handle as exclusive if creating a new object. Only the same process can open a handle to the object

CaseInsesitive

Looks up the object name in a case-insensitive manner

OpenIf

If using a Create call, opens a handle to an existing object if available

OpenLink

Opens the object if it's a link to another object; otherwise, follows the link. This is used only by the configuration manager

KernelHandle

Opens the handle as a kernel handle when used in kernel mode. This prevents user-mode applications from accessing the handle directly.

ForceAccessCheck

When used in kernel mode, ensures all access checks are performed, even if calling the Zw version of the system call

IgnoreImpersonatedDeviceMap

Disables the device map when impersonating

DontReparse

Indicates not to follow any path that contains a symbolic link

PreviousObject ManagerNextNTSTATUS Codes

Last updated 10 months ago

🕵️
🪟