The learning objective of this lab is twofold. The first part (Terms) is designed to focus our attention on terms and concepts that we may not know, or only have partial familiarity

1 Overview
The learning objective of this lab is twofold. The first part (Terms) is designed to focus our attention
on terms and concepts that we may not know, or only have partial familiarity. The second part
(Laboratory) is designed to give you first-hand experience with buffer-overflow vulnerabilities that
may appear in code. Buffer overflow is defined as the condition in which a program attempts
to write data beyond the boundaries of pre-allocated fixed length buffers. This vulnerability can
be used by a malicious user to alter the flow control of the program, leading to the execution of
malicious code. This lab focuses on:
• Identification and remediation of a buffer overflow vulnerability in code
2 Terms
2.1 Tasks
Complete the assigned readings from the Buffer Overflows Module.
Question A
While you read the assigned reading for the Module, list the terms that you have either never
heard before or you may have heard but don’t really know what they mean. There is no
minimum or maximum.
Question B
Explain in your own words. (e.g. what they are, what they do) the following terms1
:
1. root
2. root privilege
3. sudo
4. kernel
5. executable
6. setuid program (or process)
7. shell (e.g. /bin/sh or /bin/bash)
8. shellcode
9. stdio.h (in C programs)
10. #include <sdtlib.h> (in C programs)
11. compilation
12. chown
13. return-to-libc attack
You are welcome to find and study the terms from whatever credible sources you want and cite
them, but you need to explain the terms in your own words. Did I mention the answers need to be
in your own words?
1Tip: The typical mistake that will get you a zero with this question is doing internet searches, or using the
textbook and copy-pasting definitions and explanations. Please be careful, the objective is to see what you understand
and how you explain the term, not how well you can copy-paste or use Google!
2
Question C
In your answers, indicate your level of engagement (e.g. don’t know what it is, know what it is but
never used, used once, used extensively, installed, and configured)
1. Have you ever used or installed a software hypervisor like VirtualBox or VMWare?
2. Have you ever used or installed Linux (if so, what distribution)?
3 Laboratory
3.1 Description
In this lab, you are given a program with a potential buffer-overflow vulnerability and tasked with
analyzing, identifying and correcting the vulnerability. A crude description of the occurrence of a
buffer overflow is when too much data is either accidentally or maliciously attempted to be stored
in an object, causing adverse effects to the program. In this context, “too much data” is relative
to the size and capacity of the “object storing the data”. The “object storing the data” can be
anything, ranging from a data structure (e.g. array) in modern programming languages to lower
level structures like registers when programming in assembly. When this happens, there is an
adverse affect that may manifest as a program crash or as a transition of the program to a state
that offers an adversary an exploitable vulnerability.
3.2 Tasks
1. Select ONE of the provided code segments.
2. Compile2 and run the code.
Questions
1. Program Analysis:
(a) (5 pts) Describe the expected behavior of the program by reading the code.
(b) (5 pts) Describe the input you used to cause a buffer overflow when you ran the code.
(c) (5 pts) How did the buffer overflow manifest? Provide the exact error you received as
evidence.
2. (20 pts) Identify and describe the buffer overflow problem in the code.
3. (20 pts) Describe how you would prevent the buffer overflow from occurring in the code.
4. (40 pts) Correct the program to eliminate the buffer overflow problem from occurring. In the
provided code, make sure you add comments to indicate what is being changed.
5. (5 pts) Describe the behavior of the corrected program.
2Compile and run on your own computer or on a lab/classroom/departmental computer. Avoid using a web-based
platform for compiling code like: Jdoodle, OnlineGDB, Online-Python, etc. Many of these platforms have built-in
security mechanisms that block the execution or obscure messages in cases of buffer overflows because they may
consider them as attacks to the website.
3
4 Code
The code we will be working with is a very simple program. The pseudocode is listed below while
executable code segments in C++, Java and Python are provided in subsequent pages.
1 i n t e g e r t e s t s [ 1 0 ] ;
2 i n t e g e r t e s t ;
3 i n t e g e r count ;
4
5 Di s pl a y ’ ’ Enter number o f el em e n t s : ’ ’
6 Inpu t count
7
8 f o r ( i n t e g e r i = 0 ; i < count ; i = i + 1 )
9 b e gi n
10 Di s pl a y ’ ’ Enter a number : ’ ’ ;
11 Inpu t t e s t ;
12 t e s t s [ i ]= t e s t ;
13 end
Select only ONE of the code segments (C++, Java or Python) to answer the
questions.
NOTE: Be careful when you copy-paste code, it may introduce unwanted characters or spacing
that can cause the compiler or interpreter to generate errors. You are encouraged to type-in the
one small code segment you plan to work with.

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!