Easy Overflow - DuckCTF 2023
We have been provided with the C code for this challenge; #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int id = 0; char name[16] = ""; printf("Input your name: "); gets(name); printf("Your name is %s with ID %d.\n", name, id); if (id == 1179402567) { printf("%s\n", argv[1]); } return 0; } As we can see, we are using the vulnerable gets function. We can use gets to overwrite the id variable which is just above the name variable on the stack....