GSEC practice question 14 of 35
You are reviewing a packet capture file from your network intrusion detection system. In the packet stream, you come across a long series of "no operation" (NOP) commands. In addition to the NOP commands, there appears to be a malicious payload. Of the following, which is the most appropriate preventative measure for this type of attack?
Full set: 383 questionsDomain Network Device Security
The scenario describes a NOP (no operation) sled, which is a classic component of a buffer overflow exploit. This attack occurs when a program fails to validate the size of user-supplied input, allowing an attacker to write data beyond the boundaries of an allocated memory buffer. This overwrites adjacent memory, including the instruction pointer, to redirect execution to a malicious payload. The NOP sled serves as a large target, increasing the chances of a successful jump to the payload. The most direct and effective preventative measure is to implement strict boundary checks on all program inputs, ensuring that data cannot be written past the end of a buffer, thus preventing the overflow from occurring.
A. Limits on the number of failed logins: This is a countermeasure for brute-force authentication attacks, not memory corruption vulnerabilities like buffer overflows.
C. Controls against time of check/time of use attacks: This prevents race condition vulnerabilities, where a resource's state changes between a security check and its use, which is unrelated to buffer overflows.
D. Restrictions on file permissions: This is a principle of least privilege control that can limit post-exploitation damage but does not prevent the initial buffer overflow exploit itself.
1. Dowd
M.
McDonald
J.
& Schuh
J. (2006). The Art of Software Security Assessment: Identifying and Preventing Software Vulnerabilities. Addison-Wesley.
Chapter 5
"Memory Corruption
" details buffer overflow vulnerabilities. Section 5.5
"Exploitation
" describes the use of NOP sleds to improve the reliability of exploits. The primary defense discussed throughout the chapter is proper bounds checking and input validation.
2. Zheng
X.
& MIT OpenCourseWare. (2014). 6.858 Computer Systems Security
Fall 2014. Massachusetts Institute of Technology.
In Lecture 2: "Software Vulnerabilities
" the notes explain stack buffer overflows
shellcode
and the use of NOP sleds (Slide 28). The lecture then discusses defenses
with the first and most fundamental being "Bounds checking" (Slide 36)
which prevents writing past the end of an array.
3. Software Engineering Institute
Carnegie Mellon University. (2016). CERT C Coding Standard.
Rule ARR30-C
"Do not form or use out-of-bounds pointers or array subscripts
" directly addresses the root cause of buffer overflows. The standard states
"Out-of-bounds memory accesses can lead to buffer overflows... Proper validation of all inputs and calculated values is required to prevent out-of-bounds memory access." This is the formal definition of boundary checking.
4. Boneh
D.
& Stanford University. (n.d.). CS 155: Computer and Network Security
Lecture 4: Buffer Overflows.
The lecture notes describe how buffer overflow attacks work
including the use of a "NOP sled" to make the target for the overwritten return address larger. Under the "Defenses" section
the first method listed is "Write secure code
" with the primary example being the use of bounds-checked functions like strncpy() instead of strcpy()
which is a direct implementation of boundary checking.
Keep practicing
Take the free GSEC practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GSEC practice questions
- Question 1What is the key difference between Electronic Codebook mode and other block cipher modes …
- Question 2Which of the following systems acts as a NAT device when utilizing VMware in NAT mode?
- Question 4You are doing some analysis of malware on a Unix computer in a closed test network. The I…
- Question 5You work as a Network Administrator for McNeil Inc. The company has a Linux-based network…
- Question 6Which of the following services resolves host name to IP Address?
- Question 7What does PowerShell remoting use to authenticate to another host in a domain environment?
