









































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










































Question 1. Which CPU ring level is used for user-mode applications in Windows? A) Ring 0 B) Ring 1 C) Ring 2 D) Ring 3 Answer: D Explanation: Windows runs user-mode code at Ring 3, the least privileged level, while kernel code runs at Ring 0. Question 2. What mechanism does Windows use to transition from Ring 3 to Ring 0 when a system call is made? A) Interrupt Descriptor Table (IDT) B) Global Descriptor Table (GDT) C) System Service Dispatch Table (SSDT) via sysenter/syscall D) Direct Memory Access (DMA) Answer: C Explanation: The sysenter/syscall instructions invoke the SSDT, which switches the CPU to Ring 0 and dispatches the requested service. Question 3. In the EPROCESS structure, which member holds the pointer to the primary token of a process? A) ActiveProcessLinks B) Token C) ObjectTable D) SectionObject Answer: B Explanation: The Token field contains a pointer to the process’s security token, which determines its privileges. Question 4. The ETHREAD structure contains a field named Tcb. What does Tcb stand for?
A) Thread Control Block B) Trusted Code Base C) Transaction Control Buffer D) Temporary Cache Buffer Answer: A Explanation: Tcb is the Thread Control Block, holding per-thread kernel data such as the kernel stack and scheduling information. Question 5. Which kernel structure represents the current processor’s state and is located at the base of the KPRCB? A) ProcessorBlock B) CurrentThread C) IdleThread D) KernelStack Answer: B Explanation: CurrentThread in the KPRCB points to the thread currently executing on that processor. Question 6. In a 64-bit Windows page table entry (PTE), which bit indicates that the page is present in physical memory? A) Bit 0 (P) B) Bit 1 (R/W) C) Bit 2 (U/S) D) Bit 7 (NX) Answer: A Explanation: Bit 0 of a PTE is the Present (P) flag, signaling that the page is resident. Question 7. What is the primary purpose of the Non-Paged Pool in the Windows kernel? A) Store pageable user data B) Hold kernel objects that must remain resident
Answer: C Explanation: IRP_MJ_CREATE is sent when a user-mode application opens a handle to a kernel device object. Question 11. In a KMDF driver, which callback is invoked when the driver is loaded? A) EvtDriverDeviceAdd B) DriverEntry C) EvtDriverUnload D) EvtDevicePrepareHardware Answer: B Explanation: DriverEntry is the standard entry point for both WDM and KMDF drivers, called when the driver is loaded. Question 12. Which of the following is the correct prototype for an IOCTL handler in a WDM driver? A) NTSTATUS DriverIoControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) B) NTSTATUS MyDeviceIoControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) C) NTSTATUS MyDeviceIoControl(PDEVICE_OBJECT DeviceObject, PIRP Irp, ULONG IoControlCode, PVOID InputBuffer, ULONG InputBufferLength) D) NTSTATUS MyDeviceIoControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) Answer: D Explanation: The standard IOCTL dispatch routine receives only the DeviceObject and Irp; the IOCTL code and buffers are extracted from the IRP’s stack location. Question 13. Which IRQL must a driver be at when accessing non-paged pool memory? A) PASSIVE_LEVEL B) APC_LEVEL C) DISPATCH_LEVEL D) Any IRQL, because the memory never pages out
Answer: D Explanation: Non-paged pool is always resident, so it can be accessed at any IRQL, including DISPATCH_LEVEL and above. Question 14. What is the primary risk of exposing an undocumented IOCTL in a driver? A) Increased driver load time B) Kernel panic due to stack overflow C) Attackers can fuzz the IOCTL to discover arbitrary memory writes D) User-mode applications will fail to load the driver Answer: C Explanation: Undocumented IOCTLs often lack validation, making them attractive for fuzzing and exploitation, such as Write-What-Where bugs. Question 15. In a Write-What-Where vulnerability, which two components are typically controlled by the attacker? A) The source address and the destination address B) The value to write and the kernel address to write it to C) The size of the write and the process ID D) The IRQL and the pool tag Answer: B Explanation: “Write-What-Where” means the attacker can specify both the data (what) and the target kernel address (where). Question 16. Which pool tag is commonly used by the Windows kernel to identify allocations for the Object Manager? A) Obja B) Pool C) Objc D) Objt Answer: A
Question 20. In token stealing, which process’s token is typically duplicated to obtain SYSTEM privileges? A) The current user’s token B) The token of the csrss.exe process C) The token of the System process (PID 4) D) The token of the winlogon.exe process Answer: C Explanation: The System process (PID 4) runs with the highest kernel privilege; copying its token grants SYSTEM rights. Question 21. Which kernel gadget is most useful for pivoting the stack in a ROP chain? A) pop rax ; ret B) mov cr4, rax ; ret C) xchg rcx, rdx ; ret D) jmp rax Answer: A Explanation: pop rax ; ret allows the attacker to control the stack pointer and load arbitrary values for subsequent gadgets. Question 22. In a pool spraying attack, what is the primary goal of allocating many objects of the same size? A) Exhaust kernel memory to cause a denial-of-service B) Force the allocator to place a controlled object at a predictable address C) Leak kernel pointers via the allocation bitmap D) Increase the chance of a double-free bug occurring Answer: B Explanation: By flooding the pool with objects of identical size, the attacker can influence where later vulnerable allocations land, achieving predictability.
Question 23. Modifying the PreviousMode field of a KTHREAD structure from KernelMode to UserMode is an example of which attack type? A) Code injection B) Data-only attack C) Return-oriented programming R) Heap spraying Answer: B Explanation: Changing a data field to bypass security checks without executing shellcode is a data-only attack. Question 24. Which technique can be used to bypass KASLR when a kernel address leak is not directly available? A) Reading the NT!_KUSER_SHARED_DATA structure B) Using ZwQuerySystemInformation with SystemModuleInformation C) Exploiting a stack buffer overflow to read the PTE of a known driver D) Leveraging a bug that discloses the address of a loaded driver via an IOCTL Answer: D Explanation: An information-leak IOCTL that returns a kernel pointer (e.g., a function address) can be used to compute the KASLR base. Question 25. What does PatchGuard (Kernel Patch Protection) primarily monitor? A) Modifications to the SSDT B) Changes to the IDT entries C) Unauthorized writes to read-only kernel code sections D) Allocation of non-paged pool memory Answer: C Explanation: PatchGuard periodically scans for modifications to kernel code pages that should be read-only, detecting rootkits that patch the kernel.
A) Allocate a new kernel object B. Free a previously allocated object C) Convert a user-mode handle to a kernel-mode object pointer D) Register a new device interface Answer: C Explanation: ObReferenceObjectByHandle validates a user handle and returns a referenced pointer to the underlying kernel object. Question 30. Which flag in the KTRAP_FRAME indicates that the exception originated from user mode? A) PreviousMode B) ExceptionCode C) EFlags bit 17 (VM) D) Cs segment selector value Answer: D Explanation: The Cs selector value (0x1B for user mode, 0x08 for kernel) indicates the privilege level of the faulting code. Question 31. When a driver registers a device interface using IoRegisterDeviceInterface, which GUID is used to uniquely identify the interface? A) Device class GUID B) Interface class GUID supplied by the driver C) System-wide GUID for all drivers D) The driver’s binary hash Answer: B Explanation: The driver supplies an interface class GUID that uniquely identifies the device interface exposed to user mode. Question 32. Which of the following is a typical symptom of a kernel pool exhaustion attack? A) Blue screen with POOL_CORRUPTION bugcheck code
B) System becomes unresponsive due to lack of non-paged pool C) User-mode application receives STATUS_INSUFFICIENT_RESOURCES D) All of the above Answer: D Explanation: Exhausting the pool can cause kernel crashes, system hangs, and user-mode failures. Question 33. What does the MmIsAddressValid routine check? A) Whether an address is in the user address space B) Whether a virtual address is mapped to a physical page and accessible at the current IRQL C) Whether the address belongs to the kernel’s non-paged pool D) Whether the address is aligned on a 64-byte boundary Answer: B Explanation: MmIsAddressValid verifies that the supplied virtual address is currently mapped and can be safely accessed at the current IRQL. Question 34. Which of the following is a correct way to safely copy data from user mode to kernel mode? A) RtlCopyMemory B) memcpy C) ProbeForRead followed by RtlCopyMemory D) KeCopyFromUser Answer: C Explanation: ProbeForRead validates the user buffer before copying; RtlCopyMemory then performs the copy. Question 35. In a WDM driver, which routine is called when the driver receives an IRP_MJ_DEVICE_CONTROL request? A) DriverEntry B) EvtDeviceIoControl
D) pop rdx ; ret → mov cr0, rdx ; ret → ret Answer: C Explanation: To disable SMEP, set bit 20 in CR4. Load a controlled value into rax, OR with 0x100000, then write back to CR4. Question 39. Which Windows kernel function can be used to obtain the base address of a loaded driver given its name? A) MmGetSystemRoutineAddress B) PsLookupProcessByProcessId C) ObReferenceObjectByName D) ZwQuerySystemInformation with SystemModuleInformation Answer: D Explanation: ZwQuerySystemInformation with the SystemModuleInformation class returns a list of loaded modules and their base addresses. Question 40. What does the IoAllocateMdl routine create? A) A memory descriptor list describing a user buffer for DMA B) A kernel object representing a device interface C) A pool allocation for driver internal data D) An IRP structure for asynchronous I/O Answer: A Explanation: IoAllocateMdl allocates an MDL (Memory Descriptor List) that describes a user-mode buffer for DMA or other kernel operations. Question 41. In kernel exploitation, what is the purpose of “heap feng-shui”? A) To encrypt heap allocations B) To arrange heap layout so that a vulnerable allocation lands next to attacker-controlled data C) To compress heap memory for faster allocation D) To monitor heap usage in real time Answer: B
Explanation: Heap feng-shui manipulates the allocator to produce a predictable layout, facilitating exploitation of heap-based bugs. Question 42. Which of the following is a valid reason for a driver to call KeBugCheckEx? A) To report a non-critical warning to the user B) To intentionally trigger a blue screen when a fatal kernel inconsistency is detected C) To reset the system after a successful update D) To log an event in the Windows Event Log Answer: B Explanation: KeBugCheckEx forces a bug check (blue screen) when the kernel encounters a critical, unrecoverable error. Question 43. Which field in the KTHREAD structure indicates whether the thread was created in user mode? A) PreviousMode B) BasePriority C) ThreadLock D) ApcState Answer: A Explanation: PreviousMode records the mode (UserMode or KernelMode) that the thread was executing in when it entered the kernel. Question 44. The IoCreateDevice routine requires a driver to specify which of the following? A) Device name, device type, and exclusive access flag B) IOCTL code, buffer size, and security descriptor C) Driver unload routine only D) Processor affinity mask Answer: A
Question 48. What does the IoGetDeviceObjectPointer routine return? A) A pointer to the driver’s unload routine B) A pointer to the device object and a reference to the file object for a given device name C) The address of the driver’s entry point D) The size of the device’s input buffer Answer: B Explanation: IoGetDeviceObjectPointer obtains a referenced pointer to a device object and the associated file object for a symbolic link. Question 49. Which of the following is the most reliable way to detect a patched SSDT entry? A) Compare the address in the SSDT with the address returned by MmGetSystemRoutineAddress for the same function name B) Scan the SSDT for non-aligned pointers C) Check if the SSDT entry points to a user-mode address D) Verify that the SSDT entry is within the range of the driver’s image Answer: A Explanation: The legitimate address of a system routine can be obtained via MmGetSystemRoutineAddress; a mismatch indicates a hook. Question 50. In the context of kernel protections, what does CFG stand for? A) Code Flow Guard B) Control Flow Guard C) Cryptographic Function Guard D) Call Function Guard Answer: B Explanation: CFG is Control Flow Guard, a mitigation that validates indirect call targets.
Question 51. Which of the following is a technique used to bypass CFG in kernel code? A) Overwrite the CFG bitmap in kernel memory B) Use a valid indirect call target that is already marked as allowed C) Disable CFG via a registry key at boot time D) Load a driver signed with a special certificate that disables CFG Answer: B Explanation: CFG only blocks indirect calls to addresses not marked as valid; using a legitimate, CFG-approved target bypasses the check. Question 52. Which of the following registers holds the address of the current thread’s KTHREAD structure? A) GS (on x64) B) FS (on x86) C) CR3 D) RSP Answer: A Explanation: On x64, the GS segment base points to the KPCR, which contains a pointer to the current KTHREAD. Question 53. What is the primary purpose of the ObDereferenceObject routine? A) Increment the reference count of a kernel object B) Deallocate a kernel object regardless of references C) Decrement the reference count, potentially freeing the object when it reaches zero D) Convert a kernel object back to a user-mode handle Answer: C Explanation: ObDereferenceObject reduces the reference count; when it reaches zero, the object is destroyed.
A) DriverEntry B) DriverUnload (or EvtDriverUnload) C) IoCreateDevice D) IoDeleteDevice Answer: B Explanation: The DriverUnload callback is invoked when the driver is being removed, allowing it to free resources. Question 58. Which of the following is a valid reason for a kernel driver to use KeInitializeEvent? A) To create a synchronization object that can be waited on by other threads B) To allocate non-paged pool memory C) To register a device interface D) To map a physical address to virtual memory Answer: A Explanation: KeInitializeEvent sets up an event object for thread synchronization. Question 59. Which of the following fields in the IO_STACK_LOCATION structure identifies the IOCTL code being processed? A) MajorFunction B) MinorFunction C) Parameters.DeviceIoControl.IoControlCode D) FileObject Answer: C Explanation: The IoControlCode field holds the specific IOCTL identifier for IRP_MJ_DEVICE_CONTROL requests. Question 60. What does the KeQuerySystemTime routine return? A) The current system time as a 64-bit LARGE_INTEGER in 100-nanosecond intervals since January 1, 1601 B) The CPU timestamp counter (TSC) value
C) The current kernel tick count D) The current user-mode time slice length Answer: A Explanation: KeQuerySystemTime fills a LARGE_INTEGER with the system time expressed in 100-ns units since the Windows epoch. Question 61. Which of the following is the correct way to obtain a pointer to the current thread’s KTHREAD? A) KeGetCurrentThread() B) PsGetCurrentThread() C) KeGetCurrentThread() (returns PKTHREAD) D) PsGetCurrentThread() (returns PETHREAD) Answer: C Explanation: KeGetCurrentThread() returns a pointer to the current KTHREAD. PsGetCurrentThread returns a PETHREAD. Question 62. In a kernel-mode driver, which routine is used to map a physical address to a virtual address in non-paged pool? A) MmMapIoSpace B) KeMapPhysicalMemory C) MmAllocateMappingAddress D) IoMapMemory Answer: A Explanation: MmMapIoSpace maps a physical address range into the system address space, typically for device registers. Question 63. Which of the following is a typical use of the KeAcquireSpinLock routine? A) To protect shared data structures accessed at DISPATCH_LEVEL or higher B) To wait for an event object C) To allocate non-paged pool memory