Using c, For this assignment, the project involves buffer overflow.. Now perform
ID: 3721093 • Letter: U
Question
Using c,
For this assignment, the project involves buffer overflow.. Now perform a stack smash on this program called notsafe.c by using a program you made called exploits.c
Create shellcode in exploits.c and then implement it into with stack smash which is vuln.c
Article on stack smash. http://insecure.org/stf/smashstack.html
//notsafe.c
int main(int argc , char **argv) {
char w[100] , x[100] , y[100] , z[100];
easyExploit (argv [1]);
return(0); }
int easyExploit (char *arg) {
char bufferstack [10];
strcpy(bufferstack , arg );
printf ("The buffer replies are .. [%s/%p]. " , bufferstack , &bufferstack );
return(0); }
Explanation / Answer
BUFFER OVERFLOW:
Bufferflow occurs when the data written to a buffer corrupts the values in memory adresses adjacent to the destination buffer due to insufficient bounds checking. This buffer overflows when the data is copied fron one buffer to another takes place without checking the memory in the destination buffer.
In the command line argument if the length greater than 10 then there will be buffer overflow. In the given program the bufferstack is of length 10.
Buffer overflow occurs when the input length is greater than 10 and copying that argument to bufferstack then overflow occurs.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.