nerdexam
CompTIA

PT0-003 · Question #307

A penetration tester is investigating a buffer overflow on the binary. The tester wants to myfile send a payload to help identify the exact offset to inject the memory address to take control of the…

The correct answer is D. ./pattern_create.rb 1000 > test.txt; ./myfile < test.txt. A cyclic pattern lets you determine the precise overwrite position by examining which unique pattern bytes end up in the instruction pointer/register at crash time, then calculating the exact offset needed to place the return address reliably.

Submitted by saadiq_pk· Mar 6, 2026Attacks and Exploits

Question

A penetration tester is investigating a buffer overflow on the binary. The tester wants to myfile send a payload to help identify the exact offset to inject the memory address to take control of the buffer. Which of the following would allow the penetration tester to quickly identify the offset?

Options

  • A./myfile < $(printf 'A%.0s' {1.1000}
  • Becho 'A' |head -n 1000 |tr -d '\n' | ./myfile
  • Cpython -c 'print("A"*1000)' > test.txt; cat test.txt >./myfile
  • D./pattern_create.rb 1000 > test.txt; ./myfile < test.txt

How the community answered

(29 responses)
  • A
    7% (2)
  • B
    7% (2)
  • C
    24% (7)
  • D
    62% (18)

Explanation

A cyclic pattern lets you determine the precise overwrite position by examining which unique pattern bytes end up in the instruction pointer/register at crash time, then calculating the exact offset needed to place the return address reliably.

Topics

#buffer overflow#exploit development#pattern_create#memory exploitation

Community Discussion

No community discussion yet for this question.

Full PT0-003 Practice