Leak Society - The Home Of Nulled Resources.
Forum Beta v1 Now Live!
Stack Buffer Overflow
Thead Owner : Houga, Category : Everything Coding, 3 Comment, 101 Read
Viewers: 3 Guest(s)
Member
***
68
Messages
29
Threads
0
Rep
4 Years of Service
08-10-2014, 11:19 PM
#1
Stack Buffer Overflows are an incredibly common attack and have only gained popularity as programmers, for some reason, refuse to sanitize user input. Though it is not considered to be a buffer overflow attack, the recent Heart Bleed vulnerability used unsanitized user input as code thus allowing the user to provide core data used by the program.
Stack Buffer Overflows occur when more data is written to an object than originally allocated. The data then leaks into other parts of adjacent data. This will eventually reach the return address portion. Once the return address is controlled by the user, he can use it to jump to any point in memory accessible by the program. There are many forms of mitigation of buffer overflow attacks such as ASLR (Address Space Layout Randomization), NX (Non-executable Stack), and DEP (Data Execution Prevention). Though they may hinder an attacker‟s success, they each have their problems and are far from being impenetrable. The following is an example of a stack buffer overflow:

Code:
#include <stdio.h> #
#include <string.h>
int main(){
     printf("Enter a string: ");
     char str[25]; //allocates 25 bytes on stack
     scanf("%s", str); //allows for undetermined length of input
     printf("You said ‘%s’\n", str);
}
s you can see, 25 bytes were allocated on the stack for the variable „str‟. Upon asking for user input, the user is able to provide much more than 25 bytes (essentially unlimited). The data is written to str and continues by overwriting the return address. Often times the return address provided by a string is invalid (For example, if the string “ABCD” is in the return address, it will attempt to return to 0x41424344 which is an invalid address). This may, however, be tailored to meet the attacker‟s needs. A common place to store code is in the variable itself in the ESP space.

-H
Houga@entropy.cat
Junior Member
**
15
Messages
1
Threads
0
Rep
4 Years of Service
08-11-2014, 11:28 AM
#2
also dindt know about this thanks for posting
Junior Member
**
2
Messages
1
Threads
0
Rep
4 Years of Service
08-26-2014, 04:57 PM
#3
Why didn't you show us how to execute a buffer overflow attack?
Member
***
168
Messages
3
Threads
0
Rep
4 Years of Service
09-01-2014, 05:10 AM
#4
How to hack is blackhat which isn't something the forum allows unless provided permission or I think there is an upgraded section for it.


Forum Jump: