In this section, we will look at how we can get started with exploiting a plain vanilla stack based buffer overflow on an ARM environment.
- The vulnerable program in this case is as follows:
#include <stdio.h> #include <stdlib.h> void IShouldNeverBeCalled() { puts("I should never be called\n"); exit(0); } void vulnerable(char *arg) { char buff[10]; strcpy(buff,arg); } int main(int argc, char **argv) { vulnerable(argv[1]); return(0); }
As you can see in the preceding program, the main function takes a user-supplied input and then passes that argument to the vulnerable function which has a buffer, with the name buff, of 10 bytes. As expected, if the input argument size is significantly larger than the size of the buff, it ...