4 ms·
It is trivial and intentional bug in the presented hackme.c. The strcpy() to stack allocated buffer there serves no useful purpose (one can just call the printf
by dfox 3y ago
It is trivial and intentional bug in the presented hackme.c. The strcpy() to stack allocated buffer there serves no useful purpose (one can just call the printf() with argv[1] directly), but is an obvious thing to exploit.
Also, W^X would not really help there, as what gets overwritten is return address on stack, which is simply data and does not get executed. You would need some kind of stack canaries or control-flow integrity to catch that, which is probably somewhat complicated by the fact that it is in main(). (And also, on PDP-11 overhead of such schemes will probably be significant)