buffer overflow example from Art of Exploitation book

后端 未结 1 1861
梦谈多话
梦谈多话 2020-12-03 02:09

I was reading this book Art of Exploitation, which is kinda good book and I run across that example from exploit_notesearch.c file.

Briefly author tries to overflow

1条回答
  •  隐瞒了意图╮
    2020-12-03 02:56

    The author simply assumes that the C compiler will place the stacks of those two programs at the same (or very similar) virtual addresses and that the operating system will not perform address randomization (ASLR). This means that the stack frames of both main functions will be roughly at the same location, enabling this exploit.

    This is not a very robust way of exploitation, as you can imagine (it will probably fail on most modern 64-bit systems). More robust exploits could use a form of return oriented programming or could try to utilize the existing char *argv pointer to the relevant stack frame.

    0 讨论(0)
提交回复
热议问题