The Messenger of Allah ﷺ said, "A time will come upon people when a man will not care where he obtained his wealth, whether from lawful or unlawful means."
حدثنا القاسم بن زكريا بن دينار قال حدثنا أبو داود الحفري عن سفيان عن محمد بن عبد الرحمن عن المقبري
قال رسول الله ﷺ يأتي على الناس زمان ما يبالي الرجل من أين أصاب المال من حلال أو حرام
Bukhari reported it in the Book of Sales, in the chapter "Allah's statement, Almighty is He, "O you who believe, do not consume riba"... etc.," Hadith 2083, from the hadith of Muhammad bin Abdul-Rahman bin Abu Dhib, transmitted through him. It is also found in Al-Kubra, Hadith 6041.Sufyan here is Thawri.