Question

For this lab you will need to develop a Buffer overload exploit. Create a program with...

  1. For this lab you will need to develop a Buffer overload exploit.
    1. Create a program with a stack based buffer.
    2. Copy shellcode to overlay the return address in the stack
    3. Pass control to your shellcode
    4. Your shellcode should activate a shell /bin/sh on linux.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Exploit the Buffer-Overflow Vulnerability
To fully exploit a stack buffer-overflow vulnerability, we need to solve several challenging problems.
• Injecting the malicious code: We need to be able to inject the malicious code into the memory of the
target process. This can be done if we can control the contents of the buffer in the targeted program.
• Jumping to the malicious code: With the malicious code already in the memory, if the targeted
program can jump to the starting point of the malicious code, the attacker will be in control.
• Writing malicious code: Writing a malicious code is not trivial. We will show how a special type of
malicious code, shellcode, can be written.

The vulnerable program stack.c
/* stack.c */
/* This program has a stack based buffer overflow vulnerability. */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int foo(char *str)
{
char buffer[100];
/* The following statement has a buffer overflow problem */
strcpy(buffer, str);
return 1;
}
int main(int argc, char **argv)
{
char str[400];
FILE *badfile;
badfile = fopen("badfile", "r");
fread(str, sizeof(char), 300, badfile);
foo(str);
printf("Returned Properly\n");
return 1;
}
The above program reads 300 bytes of data from a file called "badfile", and then copies
the data to a buffer of size 100. Clearly, there is a buffer overflow problem. This time, the
contents copied to the buffer come from a user-provided file, i.e., users can control what is
copied to the buffer.

In order to execute our raw exploit codes directly in the stack or other parts of the memory, which deal with binary, we need assembly codes that represent a raw set of machine instructions of the target machines. A shellcode is an assembly language program which executes a shell, such as the '/bin/sh' forUnix/Linuxshell, or the command.com shell on DOS and MicrosoftWindows

Add a comment
Know the answer?
Add Answer to:
For this lab you will need to develop a Buffer overload exploit. Create a program with...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For this lab, you need to develop a C++ program that prompts the user for a...

    For this lab, you need to develop a C++ program that prompts the user for a number of integers, and then plays with that array, along with a pointer to that array and a copy of that array. The following could be a sample run of your program.

  • In the lab, you need to create a solution of 1.00 M acetate buffer at pH...

    In the lab, you need to create a solution of 1.00 M acetate buffer at pH 5.7 (using the sodium salt of the conjugate base, Nabr). show the calculations to prepare 1.0 L of this buffer solution.

  • Need help about C PROGRAMMING,, pls use only C LANGUAGE.., yea so im doing this exercise...

    Need help about C PROGRAMMING,, pls use only C LANGUAGE.., yea so im doing this exercise as a practice for c programming, could someone do this as well so i could compare if my code makes makes sense and to see and help correct the errors im getting right now.. Any helpful help would be appreciated.. Pointers &Pointer arithmetic Memory allocation and freeing Main topics: Exercise This lab is designed to give you practice working with pointers and memory allocation...

  • REQUIREMENTS: Problem Description: Create a Dynamic 2D Array Class. This class should overload the Call Operator...

    REQUIREMENTS: Problem Description: Create a Dynamic 2D Array Class. This class should overload the Call Operator () for the following behaviors: Return (modifiable) Lvalue element for a non-const object Return (read-only) Rvalue element for a const object Return a copy of the data values for row Return a copy of all the data as a 1D vector Create a TestScores Class which uses a Dynamic 2D Array object as an internal data structure. This class should have the following behaviors:...

  • In C++ Task 3: Use the stack and queue to simulate receiving and transforming data We are creating a system that will co...

    In C++ Task 3: Use the stack and queue to simulate receiving and transforming data We are creating a system that will convert strings sent over a serial bus one character at a time. The conversion will be from big to little endian or from little to big endian. To simplify this, each character will be considered a word. Little endian will have the lowest address first. Big endian will have the biggest address first. For example (for this lab),...

  • CE – Return and Overload in C++ You are going to create a rudimentary calculator. The...

    CE – Return and Overload in C++ You are going to create a rudimentary calculator. The program should call a function to display a menu of three options: 1 – Integer Math 2 – Double Math 3 – Exit Program The program must test that the user enters in a valid menu option. If they do not, the program must display an error message and allow the user to reenter the selection. Once valid, the function must return the option...

  • Hello need assistance with Java program: You are asked to create a program that will be...

    Hello need assistance with Java program: You are asked to create a program that will be used to create quizzes and test users based on these quizzes. 1.    Prompt a secret word and proceed if it matches a secret code. 2.    Your program should have two modules: quiz creation mode and test mode. User will be prompted in the beginning to choose from these two modes. For example: “Welcome to the quiz master: please enter 1 if you want to...

  • Your company needs you to create a program that estimates the amount of various supplies you need...

    Your company needs you to create a program that estimates the amount of various supplies you need for a month based on past sales performance. This way the warehouse can be better prepared for your monthly stock requests. When your program runs, it will first ask you how many clients you have active for the month. Based on the number you provide, it will then perform calculations to estimate how many units of each product you need for the month....

  • i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due...

    i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due Sunday, 19 May 2019, 11:59 PM Due Friday, 24 May 2019, 11:59 PM Part B: Minimum Submission Requirements Ensure that your Lab4 folder contains the following files (note the capitalization convention): o Diagram.pdf o Lab4. asm O README.txt Commit and push your repository Lab Objective In this lab, you will develop a more detailed understanding of how...

  • 1. In this lab, you will create a simple encryption function that will require a sentence...

    1. In this lab, you will create a simple encryption function that will require a sentence and a key (both strings) as a parameter and return an encrypted version of the string. The encryption algorithm will use the exclusive OR operator (commonly abbreviated as XOR). The general structure of the encryption is that every position in the sentence is XOR'd with the accompanying position of the key. If the sentence is longer than the key, you repeat the key. For...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT