Courseiva

PEN-200 Buffer Overflow Fundamentals Practice Question

Exhibit

Refer to the exhibit: [ 0x00401000 - 0x00401050 ] Bad Characters: \x00, \x0a, \x0d. Shellcode Offset: 140 bytes. Target Jump: JMP ESP (0x62501205).

Based on the exhibit, what is the primary risk if your shellcode contains the byte \x0d?

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

✓

The application terminates the input string early

The exhibit lists \x0d as a bad character, which often acts as a carriage return in various network protocols or string-handling functions. If shellcode contains this byte, the application may truncate the input buffer prematurely, preventing the full payload from reaching the stack. This truncation causes the exploit to fail, as the shellcode becomes malformed or incomplete before the CPU can execute it during the return sequence.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The memory address becomes non-executable

    Why it's wrong here

    Bad characters do not alter the Data Execution Prevention (DEP) settings or memory permissions of the stack. DEP is a hardware-enforced policy. The presence of a bad character affects input processing, not the binary's underlying architectural protection mechanisms which govern memory page access rights like read, write, or execute.

  • ✓

    The application terminates the input string early

    Why this is correct

    Many string-handling functions, like strcpy or those used in network socket communication, interpret \x0d as a carriage return, signaling the end of an input stream. If the shellcode contains this byte, the program stops copying input to the buffer, leaving the exploit payload incomplete and effectively preventing successful execution.

  • ✗

    The JMP ESP instruction fails to trigger

    Why it's wrong here

    The JMP ESP instruction is located in a static memory address and is independent of the shellcode content. While bad characters in the payload cause issues, they do not prevent the CPU from correctly executing the jump instruction itself. The jump occurs regardless of what lies at the target address.

  • ✗

    The CPU enters an infinite loop state

    Why it's wrong here

    Shellcode containing bad characters does not inherently force the CPU into an infinite loop. An infinite loop typically results from malformed shellcode logic or jumping to an invalid memory region. A bad character merely corrupts the input buffer, usually resulting in a segmentation fault or a simple crash.

About these practice questions

One of 285 original PEN-200 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.