#include #include #include void give_shell(){ gid_t gid = getegid(); setresgid(gid, gid, gid); system("/bin/sh -i"); } void vuln(char *input){ char buf[16]; int secret = 0; strcpy(buf, input); if (secret == 0xc0deface){ give_shell(); }else{ printf("The secret is %x\n", secret); } } int main(int argc, char **argv){ if (argc > 1) vuln(argv[1]); return 0; }