The aim of this article is to solve the system XA=Y, where A=(ai,j)∈Mn×m(S), Y∈Sm and X is an unknown vector of a size n, with S being an additively idempotent semiring. If the system has solutions, then we completely characterize its maximal one, and in the particular case where S is a generalized tropical semiring, a complete characterization of its solutions is provided as well as an explicit bound of the computational cost associated with its computation. Finally, we show how to apply this method to cryptanalyze two different key exchange protocols defined for a finite case and the tropical semiring, respectively.