Write two programs for either MS Windows or Linux

Assignment Help Programming Languages
Reference no: EM132267160

Assignment - Smashing The Stack For Fun And Profit

Part 1 - Telnet Server

For the first part of this assignment you will write two programs for either MS Windows or Linux. One program will be a telnet server that listens on a port specified on the command line (make the default port 100). The telnet server should support some form of authentication, you may decide how to incorporate it though. When the server receives a command from an authenticated user, it should run the command and return the results to the user across the network. The server must be implemented in pure C. Your second program will be a client program to test the functionality of the telnet server. The client should read a string from the command line, connect to the telnet server, send the string, and print any output received from the server. The client can be written in any language.

Part 2 - Buffer Overflow 1

For the second part of this assignment you will consciously introduce a buffer overflow vulnerability into your telnet server code (if one does not already exist). A strcpy operation between the input and command execution buffers is an ideal location to introduce the overflow vulnerability.

Once you have introduced the vulnerability into your server, you must use the client program to crash the server by sending a buffer so large that it causes a segmentation fault. This is, in essence, a denial of service attack.

Part 3 - Buffer Overflow 2

For the third part of your assignment you will introduce an uncalled function into your server. This function can do anything you like as long as it is easy to prove that the function is called. An example function might write a line of text to a log file. The function should not be called by any regular operation of yourserver. We might imagine that it is a deprecated function that has just not been removed from the code yet.

You will use the client program to cause a buffer overflow in your server and force the execution of the uncalled function. This is similar to the serial.c example from class.

Part 4 - Buffer Overflow 3

For the fourth part of this assignment you will craft your own custom shellcode and execute it off the stack of your vulnerable server, via the client program. Your shellcode can do anything you like as long as you don't use any of the example shellcode from class, like calling exit() or spawning a shell. You must however, be able to prove that your shellcode has executed by examining the server. Perhaps your shellcode will create a file, write some text, delete a file or similar. If your shellcode is smaller than your server's buffer, you must implement a NOP slide before the shellcode payload.

Part 5 - Buffer Overflow 4

For the fifth part of this assignment you will enable the non-executable stack protection feature in your server by removing the "-z execstack" line from your compiler commands. This should prevent any shellcode from executing off of the server's stack, like in part 4 above. You will then circumvent this protection mechanism by using a "return to libc" attack to spawn a reverse shell that will be sent back to the client, or by performing some action that would allow an attacker to connect to a shell on the server. This must be performed remotely, i.e. you cannot simply spawn a shell using our in-class shellcode. You must return an open connection to the client or otherwise start a listening service, for example via netcat.

Part 6 - Fixes

For the final part of the assignment you must fix your buffer overflow vulnerability in your server code by replacing the vulnerable non-bounds-checking function with a more secure version. You will then demonstrate that the fix works by trying some of your earlier buffer overflow attacks.

Part 7 - Evaluation

Requirement

Not Complete

Fully Completed (Must be able to demonstrate)

Part 1

0

1

Part 2

0

1

Part 3

0

1.5

Part 4

0

1.5

Part 5

0

1.5

Part 6

0

1

Total

 

7.5

Part 8 - Deliverables

Your submission must include all of your source code for the client & server, both the vulnerable version and the fixed version. You must also include all of your shellcode and exploit code involved in the various buffer overflows. Finally, you must supply screenshots or other proof that your exploits work as required and that the subsequent code fixes make the vulnerability unexploitable. Package all of the code, screenshots and other proof in a zip and uploaded to the appropriate dropbox in SLATE.

Part 9 - Challenge

For an added challenge try encrypting the connection between client and server (highlighting the traditional issues associated with telnet).

Note - Instructions: Part one should be in C language.

Reference no: EM132267160

Questions Cloud

Percentage change in quantity demanded : If the price of good X decreases by 0.5% and the price elasticity of demand is 1.4, find the percentage change in quantity demanded and the percentage change
Explain the societal roles and the environment during this : A Modern Translation of the Bushido Shoshinshu of Taira Shigesuke, Translated and Introduced by Thomas Cleary.
Why did the federalist party fail : How did Jefferson carry out his policies in his first term? Was war with Great Britain inevitable?
What is the role of e-commerce and infrastructure : What is the role of e-commerce and infrastructure as it relates to international logistics?
Write two programs for either MS Windows or Linux : Assignment - Smashing The Stack For Fun And Profit. For the first part of this assignment you will write two programs for either MS Windows or Linux
What are the most revealing details of urban life captured : How does Wells explain the growing frequency of lynching in the post–Civil War period? How large a part did rape charges play in these episodes?
The time for performance of the contract obligations : A repudiation is made in advance of the time for performance of the contract obligations.
Explain the negative externality : Explain the negative externality that could occur due to the building of a new airport.
Write an inspection report describing the fire hazard : OM 2023 - Fire Safety in Buildings - International College for Engineering and Management - B.Sc. (Hon.) Fire Safety Engineering

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd