I decided to follow the steps of a book entitled "Shellcoder's handbook" in Ubuntu for educational purposes, but I am facing some problems. This is a basic code I tested it on.
Code:
void return_input (void)
{
char array[6];
gets(array);
printf("%s\n", array);
}
int main()
{
return_input();
return 0;
}
Running it on debugger with -fno-stack-protector compile parameter, I put AAAAAAAAAAAA\x23\x84\x04\x08. The eight first A fill the entire array plus the padding, the next four characters overwrite the saved ebp on stack and finally the last ones are supposed to overwrite the return address with the address that the string contains and corresponds to line "gets(array)". However, I then get the result
Code:
Program received signal SIGSEGV, Segmentation fault.
0x785c4141 in ??
So, how is the address different from 0x08048423?