I heard the Messenger of Allah ﷺ say, "The world is cursed, and cursed is everything in it, except the remembrance of Allah and what is connected to it, or a scholar, or a student of knowledge."
سمعت رسول الله ﷺ يقول: الدنيا ملعونة، ملعون ما فيها، إلا ذكر الله وما والاه، أو عالما، أو متعلما.
Tirmidhi (2322) and Ibn Majah (4112) both narrated it through Abdul-Rahman bin Thabit bin Thawban, who said, I heard Ataa bin Qurrah say, I heard Abdullah bin Damrah Saluli say, Abu Hurairah narrated to us, and he related it.Its chain of transmission is hasan, on account of Ibn Thawban, his teacher, and his teacher's teacher, for all three of them are "truthful."