Template I use for pwntools. Might edit it later on.
from pwn import *
context.log_level = 'debug'context.binary = elf = ELF('./vuln')context.terminal = ['gnome-terminal', '-e']# libc = ELF('./libc.so.6')
USE_REMOTE = FalseREMOTE_HOST = 'hostname'REMOTE_PORT = 1337
USE_GDB = TrueGDB_SCRIPT = """"""
def start(): if USE_REMOTE: return remote(REMOTE_HOST, REMOTE_PORT) p = process(elf.path) if USE_GDB: gdb.attach(p, GDB_SCRIPT) return p
p = start()
# exploit goes here
p.interactive()