Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) narrates: The Prophet (peace and blessings be upon him) addressed us and said in his sermon: "Behold! Soon I will be called and I will respond. After me, people will become your rulers who will act in ways that you know and do things that you recognise as right; obedience to them is true obedience. Things will remain like this for some time. Then after them, people will become your rulers who will act in ways that you do not know (to be right) and do things that you do not recognise as right (that is, as good). Whoever goes along with them and gives them sincere counsel, such people are ruined themselves and bring ruin upon others. Mix with them in body, but separate from them in your deeds, and bear witness about the one who does good that he is a doer of good, and about the one who does evil that he is a doer of evil."
Al-Tabarani recorded it in al-Mu'jam al-Awsat from his teacher Muhammad bin Ali al-Marwazi, who is da'if (weak).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الخلافة / 9201