It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Soon there will be rulers in whom (some things) will seem good and (others) bad. Whoever openly opposes them will be saved, whoever keeps apart from them will remain safe, and whoever mixes with them will be ruined."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10927