I want to exploit this code vulnerability and get it to launch me into a shell with privilege access. I'm guessing I need to "push" bob from its current address to address 0x41414142 using the "gets" function. I can only use the command line in Linux. I cannot alter the program whatsoever. How can I achieve that? The system uses Little Endian byte order.
Here is the code:
#include <stdlib.h>
int main(){
int bob;
char alice[80];
printf("alice is at %08x, bob is at %08x\n", &alice, &bob);
printf("\nHelp alice and bob meet");
gets(alice);
if (bob==0x41414142){
setresuid(504,504,504);
system("/bin/sh");
}
}