The Messenger of Allah ﷺ said, "A thief does not steal while he is a believer, an adulterer does not commit adultery while he is a believer, and a drinker does not drink while he is a believer," meaning wine. "By the One in whose hand is Muhammad's soul, none of you seizes plunder of value, toward which the believers raise their eyes, while he is a believer at the moment he seizes it. And none of you steals from the spoils while he is a believer. So beware, beware!"
وقال رسول الله ﷺ لا يسرق سارق حين يسرق وهو مؤمن ولا يزني زان حين يزني وهو مؤمن ولا يشرب الشارب حين يشرب وهو مؤمن يعني الخمر والذي نفس محمد بيده ولا ينتهب أحدكم نهبة ذات شرف يرفع إليه المؤمنون أعينهم فيها وهو حين ينتهبها مؤمن ولا يغل أحدكم حين يغل وهو مؤمن فإياكم إياكم
This is a sahih hadith. It appears in al-Sahifa al-Mufrada, number 89. Bukhari did not narrate it through this route, but rather narrated it through other routes, as we will mention, Allah willing. Muslim narrated it [55:1 S / 1:31–32 Bulaq] through this route, but he did not quote its wording, because he had already narrated it earlier through other routes and referred its wording back to that. Bukhari narrated it, both at length and in abridged form, through various routes [5:86, 10:28–29, 12:50, 101 Fath], and it has already passed in abridged form [7316].As for his statement, "So beware, beware," this is what is established in the manuscripts of the Musnad. In Jami al-Masanid it reads, "So beware and beware," with the addition of the conjunctive waw. And in al-Sahifa al-Mufrada it reads, "And beware and beware," with the conjunctive waw in the first instance in place of the fa, and with it retained in the second instance as well.