Pwn

https://guyinatuxedo.github.io/02-intro_tooling/pwntools/index.html

from pwn import *

target = remote("<url>", <port>)

target = process("./challenge")

# If you want to attach the gdb debugger to a process:
gdb.attach(target)
gdb.attach(target, gdbscript='b *main')

target.send(x)
target.sendline(x)
print target.recvline()
print target.recvuntil("out")

# To pack the integer y as a least endian QWORD (commonly used for x64):
p64(x)
p32(x)

# It can also unpack values we get. Let's say we wanted to unpack a least endian QWORD and get it's integer value:
u64(x)
u32(x)

target.interactive()