PEN-200 Buffer Overflow Fundamentals Practice Question
Why are static memory addresses for 'JMP ESP' preferred over dynamic stack addresses?
⚠ Common exam trap
Test-takers frequently hardcode dynamic stack memory addresses into their exploits, leading to immediate crashes because stack locations shift across different program executions.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Static addresses remain constant across different executions.
Stack addresses change during every execution of a program due to factors like system environment variables and memory allocation. If you use a hardcoded stack address in your exploit, it will likely be invalid the next time the program runs. A static JMP ESP address, found in a loaded DLL or the binary itself, remains constant, providing a reliable and stable redirect for your shellcode execution every time.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Static addresses are faster to access by the CPU.
Why it's wrong here
There is no speed difference between accessing a static memory address or a dynamic one. The CPU instruction fetch process is identical regardless of the target address's origin. The preference for static addresses is strictly for reliability and consistency in the exploit, not for performance or hardware-level execution speed advantages.
- ✗
Static addresses are less likely to contain bad characters.
Why it's wrong here
Memory addresses can contain any byte value, including bad characters. The presence of bad characters in an address has nothing to do with whether the address is static or dynamic. The search for a usable JMP ESP address must always involve verifying that the address itself doesn't contain any bad characters.
- ✓
Static addresses remain constant across different executions.
Why this is correct
Static addresses in the code segment or imported DLLs do not change between program runs. This consistency makes them ideal for redirecting control flow. Because they are always in the same place, you can be confident that the jump instruction will exist at that location every time the exploit is launched.
- ✗
Static addresses are protected by DEP and ASLR.
Why it's wrong here
Static addresses are not inherently protected by DEP or ASLR. In fact, if a module is compiled without ASLR, it becomes an easy target for finding static gadgets. DEP protection would actually prevent executing instructions at such an address if it were located in the stack or heap, making it less useful.
About these practice questions
This PEN-200 question is part of Courseiva's 285-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official OffSec exam blueprint
This PEN-200 practice question is part of Courseiva's free OffSec certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PEN-200 exam.