
- •Acknowledgments
- •About the Author
- •Contents at a Glance
- •Contents
- •Table of Exercises
- •Introduction
- •Assessment Test
- •Answers to Assessment Test
- •Defining Ethical Hacking
- •How to Be Ethical
- •Keeping It Legal
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Reconnaissance
- •Information-Gathering Methodology
- •Social Engineering
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Scanning
- •Enumeration
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •The Simplest Way to Get a Password
- •Types of Passwords
- •Cracking a Password
- •Understanding Keyloggers and Other Spyware Technologies
- •Escalating Privileges
- •Understanding Rootkits
- •Hiding Files
- •Understanding Steganography Technologies
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Trojans and Backdoors
- •Viruses and Worms
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •How a Sniffer Works
- •Sniffing Countermeasures
- •Bypassing the Limitations of Switches
- •Wireshark Filters
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Denial of Service
- •Session Hijacking
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •How Web Servers Work
- •Types of Web Server Vulnerabilities
- •Web Application Vulnerabilities
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •SQL Injection
- •Buffer Overflows
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Wi-Fi and Ethernet
- •Authentication and Cracking Techniques
- •Using Wireless Sniffers to Locate SSIDs
- •MAC Filters and MAC Spoofing
- •Rogue Access Points
- •Wireless Hacking Techniques
- •Securing Wireless Networks
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Components of Physical Security
- •Understanding Physical Security
- •Physical Site Security Countermeasures
- •What to Do After a Security Breach Occurs
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Linux Basics
- •Compiling a Linux Kernel
- •GCC Compilation Commands
- •Installing Linux Kernel Modules
- •Linux Hardening Methods
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Types of IDSs and Evasion Techniques
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Generating Public and Private Keys
- •Cryptography Algorithms
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Defining Security Assessments
- •Penetration Testing
- •Pen Test Deliverables
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Glossary
- •Index

Review Questions |
233 |
Review Questions
1.Entering Password::blah’ or 1=1- into a web form in order to get a password is an example of what type of attack?
A.Buffer overflow
B.Heap-based overflow
C.Stack-based overflow
D.SQL injection
2.Replacing NOP instructions with other code in a buffer overflow mutation serves what purpose?
A.Bypassing an IDS
B.Overwriting the return pointer
C.Advancing the return pointer
D.Bypassing a firewall
3.Which of the following is used to store dynamically allocated variables?
A.Heap overflow
B.Stack overflow
C.Heap
D.Stack
4.What is the first step in a SQL injection attack?
A.Enter arbitrary commands at a user prompt.
B.Locate a user input field on a web page.
C.Locate the return pointer.
D.Enter a series of NOP instructions.
5.What command is used to retrieve information from a SQL database?
A.INSERT
B.GET
C.SET
D.SELECT
6.Which of the following is a countermeasure for buffer overflows?
A.Not using single quotes
B.Securing all login pages with SSL
C.Bounds checking
D.User validation

234 Chapter 9 n Attacking Applications: SQL Injection and Buffer Overflows
7.What does NOP stand for?
A.No Operation
B.Network Operation Protocol
C.No Once Prompt
D.Network Operation
8.What information does a hacker need to launch a buffer overflow attack?
A.A hacker needs to be familiar with the memory address space and techniques of buffer overflows in order to launch a buffer overflow attack.
B.A hacker needs to understand the differences between heaps and stacks.
C.A hacker must be able to identify a target vulnerable to a buffer overflow attack.
D.A hacker must be able to perform a port scan looking for vulnerable memory stacks.
9.Why are many programs vulnerable to SQL injection and buffer overflow attacks?
A.The programs are written quickly and use poor programming techniques.
B.These are inherent flaws in any program.
C.The users have not applied the correct service packs.
D.The programmers are using the wrong programming language.
10.Which command would a hacker enter in a web form field to obtain a directory listing?
A.Blah’;exec master..xp_cmdshell “dir *.*”--
B.Blah’;exec_cmdshell “dir c:\*.* /s >c:\directory.txt”--
C.Blah’;exec master..xp_cmdshell “dir c:\*.* /s >c:\directory.txt”--
D.Blah’;exec cmdshell “dir c:\*.* “--
11.What are two types of buffer overflow attacks?
A.Heap and stack
B.Heap and overflow
C.Stack and memory allocation
D.Injection and heap
12.Variables that are gathered from a user input field in a web application for later execution
by the web application are known as |
. |
|
A. |
Delayed execution |
|
B. |
Dynamic strings |
|
C. |
Static variables |
|
D. |
Automatic functions |
|

Review Questions |
235 |
13.What is one purpose of SQL injection attacks?
A.To create heap-based buffer overflows
B.To create stack-based buffer overflows
C.To perform NOP execution
D.To identify vulnerable parameters
14.Which application will help identify whether a website is vulnerable to SQL injection attacks?
A.BlackWidow
B.Metasploit
C.Scrawlr
D.SQL Block
15. A countermeasure to buffer overflows is to use the |
programming language |
because it is not susceptible to buffer overflow attacks. |
|
A.Java
B.Netscape
C.Oracle
D.ASP
16.You are a programmer analyzing the code of an application running on your organization’s servers. There are an excessive number of fgets () commands. These are C++ functions that do not perform bounds checking. What kind of attack is this program susceptible to?
A.Buffer overflow
B.Denial of service
C.SQL injection
D.Password cracking
17.Which of the following are countermeasures to SQL injection attacks? (Choose two.)
A.Rejecting known bad input
B.Sanitizing and validating input field
C.Performing user validation
D.Ensuring all user input is a variable
18.An ethical hacker is performing a penetration test on a web application. The hacker finds a user input field on a web form and enters a single quotation mark. The website responds with a server error. What does the error indicate?
A.The web application is susceptible to SQL injection attacks.
B.The web application is not susceptible to SQL injection attacks.
C.The server is experiencing a denial of service.
D.The web application has crashed.

236 Chapter 9 n Attacking Applications: SQL Injection and Buffer Overflows
19.SQL statements that vary from execution to execution are known as ______________
strings.
A.Variable
B.Dynamic
C.Application-based
D.Static
20.When is a No Operation (NOP) instruction added to a string?
A.After the malicious code is executed
B.Before the malicious code is executed
C.At exactly the same time the malicious code is executed
D.During the time the malicious code is executed