Docsity

Windows User Mode Exploit Development Practice Exam, Exams of Technology

Toggle sidebar
bg1
EXP 301 Windows User Mode Exploit Development
Practice Exam
**Question 1.** Which x86 register is conventionally used to store the return
value of a function?
A) EBX
B) ECX
C) EDX
D) EAX
Answer: D
Explanation: In the Microsoft x86 calling convention, EAX holds the function’s
return value.
**Question 2.** In a typical function prologue on 32‑bit Windows, which
instruction sequence correctly sets up the stack frame?
A) push ebp; mov ebp, esp; sub esp, 0x??
B) mov ebp, esp; push ebp; sub esp, 0x??
C) sub esp, 0x??; push ebp; mov ebp, esp
D) push esp; mov ebp, ebx; sub esp, 0x??
Answer: A
Explanation: The standard prologue pushes the old base pointer, copies ESP to
EBP, then allocates space.
**Question 3.** What does the WinDbg command `!address` display?
A) Loaded modules list
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Windows User Mode Exploit Development Practice Exam and more Exams Technology in PDF only on Docsity!

Practice Exam

Question 1. Which x86 register is conventionally used to store the return value of a function? A) EBX B) ECX C) EDX D) EAX Answer: D Explanation: In the Microsoft x86 calling convention, EAX holds the function’s return value. Question 2. In a typical function prologue on 32‑bit Windows, which instruction sequence correctly sets up the stack frame? A) push ebp; mov ebp, esp; sub esp, 0x?? B) mov ebp, esp; push ebp; sub esp, 0x?? C) sub esp, 0x??; push ebp; mov ebp, esp D) push esp; mov ebp, ebx; sub esp, 0x?? Answer: A Explanation: The standard prologue pushes the old base pointer, copies ESP to EBP, then allocates space. Question 3. What does the WinDbg command !address display? A) Loaded modules list

Practice Exam

B) Current register values C) Detailed information about a memory region D) Source code line numbers Answer: C Explanation: !address provides a breakdown of a specified memory address, including protection and type. Question 4. Which WinDbg command sets a hardware breakpoint that triggers on execution of the target address? A) bp B) ba e C) ba w D) ba x Answer: B Explanation: ba e sets a hardware breakpoint on execution (e = execute). Question 5. In IDA Pro, what shortcut key opens the “Jump to address” dialog? A) G B) J C) Ctrl+G

Practice Exam

Explanation: Bad characters corrupt payloads because they are interpreted specially (e.g., string terminators). Question 8. In a stack buffer overflow, why is a “JMP ESP” instruction useful? A) It moves the stack pointer to the heap. B) It redirects execution to the top of the stack where shellcode resides. C) It clears the stack. D) It disables DEP. Answer: B Explanation: “JMP ESP” transfers control to the address held in ESP, which typically points to the overflowed buffer. Question 9. Which field of the Structured Exception Handler (SEH) record is overwritten first when exploiting an SEH overflow? A) Exception Handler address B) Next SEH pointer C) Exception Code D) Exception Flags Answer: B Explanation: The overflow writes the “Next SEH” pointer first, followed by the handler address.

Practice Exam

Question 10. In an SEH overwrite exploit, what is the purpose of the “pop pop ret” sequence? A) To pop two values off the stack and return to the attacker‑controlled address. B) To clear the stack of all data. C) To disable DEP. D) To leak a heap address. Answer: A Explanation: “pop pop ret” removes the overwritten Next SEH and handler, then returns to the attacker‑controlled payload. Question 11. An egghunter shellcode is primarily used to: A) Execute a system call directly. B) Search memory for a larger payload marked by a unique tag. C) Bypass DEP by calling VirtualProtect. D) Overwrite the return address on the stack. Answer: B Explanation: The egghunter repeatedly scans memory for a predefined “egg” tag and then jumps to the full payload. Question 12. Which Windows API function is most commonly called by an egghunter to test memory accessibility? A) VirtualAlloc

Practice Exam

D) Relocation Table Answer: B Explanation: The Export Address Table contains the exported function names and their RVA offsets. Question 15. Which x86 calling convention passes the first three arguments in registers? A) __stdcall B) __cdecl C) fastcall D) thiscall Answer: C Explanation: The fastcall convention uses ECX, EDX, and (on some variants) the stack for the first arguments. Question 16. DEP (Data Execution Prevention) primarily prevents which of the following? A) Reading from protected memory regions. B) Writing to read‑only sections. C) Executing code from non‑executable pages. D) Loading unsigned drivers. Answer: C

Practice Exam

Explanation: DEP marks certain pages (e.g., stack, heap) as non‑executable, blocking code execution from them. Question 17. In a ROP chain, a “gadget” is defined as: A) Any function that returns a value. B) A short instruction sequence ending in a RET instruction. C) A block of shellcode that performs a system call. D) A memory region that is executable and writable. Answer: B Explanation: Gadgets are tiny snippets of existing code ending with a RET, chained together to perform arbitrary computation. Question 18. Which Windows API is commonly invoked by a ROP chain to bypass DEP? A) CreateThread B) VirtualProtect C) HeapCreate D) SetUnhandledExceptionFilter Answer: B Explanation: VirtualProtect can change page protections to PAGE_EXECUTE_READWRITE, enabling execution of injected shellcode.

Practice Exam

B) Writes the number of characters printed so far to a supplied address. C) Reads a string from the stack. D) Causes a segmentation fault. Answer: B Explanation: %n stores the current output length into the memory address pointed to by the corresponding argument. Question 22. Which WinDbg command displays the list of loaded modules with their base addresses? A) lm B) ls C) dm D) bl Answer: A Explanation: lm (list modules) shows each module’s name, base address, and size. Question 23. When analyzing a binary in IDA, which view allows you to see the control‑flow graph of a function? A) Hex View B) Graph View C) Text View

Practice Exam

D) Output Window Answer: B Explanation: Graph View visualizes basic blocks and jumps, making control flow easier to understand. Question 24. In a typical Windows heap layout, which region stores the actual user‑allocated data? A) Heap Header B) Heap Segments (User Data) C) Allocation Bitmap D) Guard Pages Answer: B Explanation: The heap segments contain the memory returned to the program after allocation. Question 25. Which of the following is a legitimate reason to use a “NOP sled” in an exploit? A) To bypass DEP. B) To increase the size of the payload. C) To provide a larger landing zone for an imprecise jump. D) To hide the shellcode from antivirus. Answer: C

Practice Exam

Question 28. Which of the following is NOT a typical step when creating a custom shellcode payload? A) Ensuring the code is NULL‑free if needed. B) Embedding the shellcode inside a DLL. C) Making the code position‑independent. D) Resolving API addresses at runtime. Answer: B Explanation: Embedding shellcode inside a DLL is not a step of creating raw shellcode; it’s a delivery method, not a payload creation technique. Question 29. When using the s (search) command in WinDbg, what does the -b switch specify? A) Search for a byte pattern. B) Search backward from the current address. C) Search for a Unicode string. D) Search for a block of memory. Answer: B Explanation: -b tells WinDbg to search backward. Question 30. Which of the following is the correct syntax to set a breakpoint at the start of WinExec in WinDbg? A) bp WinExec

Practice Exam

B) bp kernel32!WinExec C) bp @WinExec D) bp "WinExec" Answer: B Explanation: kernel32!WinExec specifies the symbol with its module, allowing WinDbg to resolve the address. Question 31. In the Windows SEH chain, what does the “Next SEH” pointer reference? A) The address of the next exception handler record. B) The address of the exception registration function. C) The saved EIP value. D) The base of the stack. Answer: A Explanation: “Next SEH” links to the previous SEH record, forming a linked list. Question 32. Which of the following instructions can be used as a “pop‑pop‑ret” gadget? A) pop eax; pop ebx; ret B) pop ebp; pop ebx; ret C) pop ecx; pop edx; ret

Practice Exam

Explanation: The field width (e.g., %10x) determines how many characters are output, affecting the value written by %n. Question 35. Which of the following is a reliable source of non‑ASLR gadgets on a typical Windows 7 32‑bit system? A) kernel32.dll (compiled with /DYNAMICBASE) B) ntdll.dll (non‑relocated) C) user32.dll (ASLR enabled) D) msvcrt.dll (ASLR enabled) Answer: B Explanation: ntdll.dll is often compiled without ASLR on older Windows versions, providing stable gadget addresses. Question 36. When using the e (enter) command in WinDbg, what does e esp L? do? A) Displays the value at ESP. B) Writes a DWORD value at ESP. C) Enters a string at ESP. D) Edits memory at ESP using the default size. Answer: D Explanation: e without a size defaults to DWORD (4‑byte) write; L? is a placeholder for the value you supply.

Practice Exam

Question 37. Which of the following is the correct way to display the current value of the EIP register in WinDbg? A) r eip B)? @eip C) d eip D) .eip Answer: B Explanation: ? @eip evaluates and prints the value of the EIP register. Question 38. In IDA Pro, what does the “x” shortcut do? A) Execute the current function. B) Cross‑reference the selected item. C) Export the current view. D) Exit the program. Answer: B Explanation: Pressing “x” opens the cross‑reference window for the selected symbol or address. Question 39. Which of the following statements about the Windows Heap’s “Free List” is true?

Practice Exam

C) EAX = address, ECX = size, EDX = new protection, EBX = old protection D) EAX = address, EBX = size, ECX = new protection, EDX = old protection Answer: D Explanation: The VirtualProtect prototype is BOOL VirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect); so the stack must contain address, size, new protection, and a pointer for old protection. Question 42. Which of the following WinDbg commands will display the current call stack? A) k B) s C) r D) l Answer: A Explanation: k (stack trace) prints the call stack frames. Question 43. In a buffer overflow exploit, why is it important to avoid the byte 0x0A when targeting a network service that reads lines? A) It is interpreted as a null terminator. B) It may be filtered by the service as a line‑feed. C) It causes a divide‑by‑zero exception. D) It disables DEP.

Practice Exam

Answer: B Explanation: Many line‑oriented services treat 0x0A (LF) as the end of input, truncating the payload. Question 44. Which of the following is a common technique to bypass DEP without using ROP? A) Heap spraying with executable pages. B) Using a return‑to‑libc attack. C) Overwriting the IAT. D) Using a “call esi” gadget. Answer: A Explanation: Heap spraying can place shellcode in memory regions that are marked executable (e.g., via VirtualAlloc), allowing execution without ROP. Question 45. What does the !heap - p - a 0x0012F000 command in WinDbg display? A) The heap allocation list for the address 0x0012F000. B) The process’s module list. C) The registers at the time of crash. D) The source code of the allocation routine. Answer: A