Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
CompTIA Security+ · CompTIA
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
A buffer overflow occurs when a program writes more data into a buffer (a temporary storage area in memory) than it can hold, causing excess data to overflow into adjacent memory locations. Attackers exploit this by: Overwriting critical registers (e.g., the instruction pointer, EIP/RIP) Redirecting execution flow to malicious code (e.g., shellcode or ROP chains) Why Not the Others? A. VM Escape → Involves breaking out of a virtual machine, not memory corruption. B. SQL Injection → Targets databases via malicious queries, not CPU registers. D. Race Condition → Relies on timing issues, not memory overwrites.
The scenario specifically mentions overwriting a register with a malicious address, which is a hallmark of a buffer overflow attack. This technique is commonly used to redirect the program to execute malicious instructions, making buffer overflow the most relevant vulnerability here. In a buffer overflow attack, the attacker might overwrite a register or a return address on the stack with a malicious address, redirecting the program's control flow to execute arbitrary code.
• C. Buffer overflow