Stack-Based Buffer Overflow Explained

Contributed by Marc Koser.

This paper is intended to demystify the complicated subject of stack-based overflows. I have written this paper for people who may not have a background in computer science. I explain what a buffer is, what the different parts of a buffer are used for, how to craft a buffer overflow, and what happens when a buffer overflow is executed on a victim. Additionally, I explain common payloads and exploits that are run in the attack, and investigate post-exploitation activities.

What is a buffer? A data buffer is simply an abstraction of physical memory, or random access memory (RAM) that is used to momentarily hold data. There are data buffers implemented everywhere: microwaves, airplanes, printers, and SCADA systems to name a few. If it has a processor, it most likely uses some form of a data buffer. Buffers are most useful for compensating for different read/write speeds between two points, such as a media server and a receiving host, or a program and a hard disk. The buffer allows for the quick, seamless delivery of data between the two. In this essay, the focus will be on the use of buffers to hold variables assigned to memory from program code.

This document is in PDF format. To view it click here.

Rate this article: 
Average: 3.8 (6 votes)