Results 1 to 6 of 6

Thread: What is a Buffer Overflow?

  1. #1
    Join Date
    Feb 2006

    Question What is a Buffer Overflow?

    what is a buffer overflow and can you mention examples?

  2. #2
    Just Another Geek
    Join Date
    Jul 2002
    Rotterdam, Netherlands
    A buffer overflow is exactly what it says.. It happens when a buffer of a certain size gets more then it can handle..

    The de facto standard doc about buffer overflows is Aleph One's "Smashing the stack for fun and profit"
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  3. #3
    The Prancing Pirate
    Join Date
    Jul 2004
    My Search

    From Whatis

    A buffer overflow occurs when a program or process tries to store more data in a buffer (temporary data storage area) than it was intended to hold. Since buffers are created to contain a finite amount of data, the extra information - which has to go somewhere - can overflow into adjacent buffers, corrupting or overwriting the valid data held in them. Although it may occur accidentally through programming error, buffer overflow is an increasingly common type of security attack on data integrity. In buffer overflow attacks, the extra data may contain codes designed to trigger specific actions, in effect sending new instructions to the attacked computer that could, for example, damage the user's files, change data, or disclose confidential information. Buffer overflow attacks are said to have arisen because the C programming language supplied the framework, and poor programming practices supplied the vulnerability.
    From Linux Journal

    What is buffer overflow, why is it dangerous and how is it preventable?
    Buffer overflow problems always have been associated with security vulnerabilities. In the past, lots of security breaches have occurred due to buffer overflow. This article attempts to explain what buffer overflow is, how it can be exploited and what countermeasures can be taken to avoid it.

    Knowledge of C or any other high level language is essential to this discussion. Basic knowledge of process memory layout is useful, but not necessary. Also, all the discussions are based on Linux running on x86 platform. The basic concepts of buffer overflow, however, are the same no matter what platform and operating system is used.

    Buffer Overflow: the Basics
    A buffer is a contiguous allocated chunk of memory, such as an array or a pointer in C. In C and C++, there are no automatic bounds checking on the buffer, which means a user can write past a buffer. For example:

    int main () {
    int buffer[10];
    buffer[20] = 10;

    The above C program is a valid program, and every compiler can compile it without any errors. However, the program attempts to write beyond the allocated memory for the buffer, which might result in unexpected behavior. Over the years, some bright people have used only this concept to create havoc in the computer industry. Before we understand how they did it, let's first see what a process looks like in memory.

    A process is a program in execution. An executable program on a disk contains a set of binary instructions to be executed by the processor; some read-only data, such as printf format strings; global and static data that lasts throughout the program execution; and a brk pointer that keeps track of the malloced memory. Function local variables are automatic variables created on the stack whenever functions execute, and they are cleaned up as the function terminates.

    Please search before you post. Then, if you still have some questions left unanswered, or you seek more specific information on the topic, just ask.


    TAZForum <---- click

  4. #4
    The Prancing Pirate
    Join Date
    Jul 2004
    @tt!tud3 - that's the first one I posted.


    TAZForum <---- click

  5. #5
    Originally posted here by J_K9
    @tt!tud3 - that's the first one I posted.



    ooopppsss.... i really didn't see your post...
    maybe we post on the same time...

    anyhow i'll delete mine..... sorry

  6. #6
    Senior Member RoadClosed's Avatar
    Join Date
    Jun 2003
    Buffer overflow hypothetical example in a coffee cup...

    Say you have an input form on a web site. it says "Name" and has a place to enter your name. This could be an input buffer - a variable set aside in the program to place it in memory. The program could control where in memory it goes or it could be a run time or OS.

    So you are very stupid and you make this input buffer capable of holding 5 letters and you don't program in a check to see if someone enters more than five letters. So if they enter "Bob" which is only 3 everything is OK. But if they enter "Sleezybackhumperdink" This could "overflow" your 5 digit name buffer and go into another buffer that is reserved for some other information like "User-name" or it could just return a STOP error right away in your crappy code. What happens when crappy programs get a stop error, they cease to function. So you could have an open website with access controls disabled, because they are no longer active. DID you catch that... acess control is a mechanism of SOFTWARE!!!!!!!! At your code level, and of the OS or any 3rd party software like PHP running your website. You could get as much as a command prompt on a local machine or any number of things.

    But buffers aren't limited to data we directly manipulate. You could manipulate a printer buffer for example which could also produce bad results. Or the buffer in your network card that is receiving packets. Buffers are there because "things" need to be captured before processed. What happens is unpredictable unless you have access to the source code.

    Even that dastardly address bar in your browser is a, well once -was a very powerful and elite hacking tool.
    West of House
    You are standing in an open field west of a white house, with a boarded front door.
    There is a small mailbox here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts