A
Arquitecto
Hi ,i would like to give u a piece of code and discuss if it is
possible to call the hidden_function without modify code to call it .
I have read on internet about buffer overflows and i can overwrite
overwrite instruction pointer to point to start of the
hidden_function . But i see that on my ubuntu with my
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4) i get a
../test AAAAAAAAAAAAA
*** stack smashing detected ***: ./test terminated
i think this protection blocks me ,right ? Is there any other
technique i can call that hidden fuction ? And lets say we got a linux
binary ,that we dont know his source code ,is there any way to
determine hidden fuctions that may that binary have ? As an owner i
can maybe disable those protections from gcc but if i dont have the
source and only the binary ??? I would like to hear your opinions on
that , thanx in advance
#include <stdio.h>
#include <string.h>
void hidden_function()
{
printf("you find me \n");
}
main(int argc, char *argv[])
{
char buffer[10];
if (argc < 2) {
fprintf(stderr, "usage: %s string \n", argv[0]);
return 1;
}
strcpy(buffer, argv[1]);
return 0;
}
possible to call the hidden_function without modify code to call it .
I have read on internet about buffer overflows and i can overwrite
overwrite instruction pointer to point to start of the
hidden_function . But i see that on my ubuntu with my
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4) i get a
../test AAAAAAAAAAAAA
*** stack smashing detected ***: ./test terminated
i think this protection blocks me ,right ? Is there any other
technique i can call that hidden fuction ? And lets say we got a linux
binary ,that we dont know his source code ,is there any way to
determine hidden fuctions that may that binary have ? As an owner i
can maybe disable those protections from gcc but if i dont have the
source and only the binary ??? I would like to hear your opinions on
that , thanx in advance
#include <stdio.h>
#include <string.h>
void hidden_function()
{
printf("you find me \n");
}
main(int argc, char *argv[])
{
char buffer[10];
if (argc < 2) {
fprintf(stderr, "usage: %s string \n", argv[0]);
return 1;
}
strcpy(buffer, argv[1]);
return 0;
}