Last updated
Last updated
Read source, there's a code var.
It's set to 0. At the end, if it's not 0, a shell is popped.
Pretty simple chall, just spam chars and a shell pops, cat flag.txt
Same thing, except code must be 0xcafebabe.
Let's disassemble main, we'll find the difference between our input(rbp-0x20) and the var(rbp-0x8) is 24 bytes, so send 24 bytes + p64(0xcafebabe)
ret2win exploit. There's a function called binFunction.
Our input is at rbp-0x10, so 0x10 + 8 bytes until return address.
Overwrite return address with address of binFunction, which pops a shell.