def submit_flag(flag, exploit=env_exploit_name, target=env_target_host, server=env_server, port=env_port, proto=env_proto, team=env_team_name):
 flag = flag.strip()
 log.success(('Flag: %r' % flag))
 data = '\n'.join([flag, exploit, target, team, ''])
 if os.path.exists(env_file):
  write(env_file, data)
  return
 try:
  with remote(server, int(port)) as r:
   r.send(data)
   return r.recvall(timeout=1)
 except Exception:
  log.warn(('Could not submit flag %r to %s:%s' % (flag, server, port)))

def submit_flag ( flag , exploit = env_exploit_name , target = env_target_host , server = env_server , port = env_port , proto = env_proto , team = env_team_name ) : flag = flag . strip ( ) log . success ( ( 'Flag: %r' % flag ) ) data = '\n' . join ( [ flag , exploit , target , team , '' ] ) if os . path . exists ( env_file ) : write ( env_file , data ) return try : with remote ( server , int ( port ) ) as r : r . send ( data ) return r . recvall ( timeout = 1 ) except Exception : log . warn ( ( 'Could not submit flag %r to %s:%s' % ( flag , server , port ) ) )
submits a flag to the game server arguments: flag: the flag to submit .