Sayyiduna Abu Musa (may Allah be pleased with him) says that whenever the Prophet (peace and blessings be upon him) feared a people, he would say: 'Allahumma inni aj'aluka fi nuhurihim wa a'udhu bika min shururihim' (O Allah, I place You against them, and I seek refuge in You from their evils.)
(b) Abu Dawud (may Allah have mercy on him) narrates from his father that whenever the Messenger of Allah (peace and blessings be upon him) supplicated against a people; then he mentioned the same supplication.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحج / 10324
Abu Burdah bin Abdullah bin Qays (may Allah have mercy on him) says that his father (may Allah be pleased with him) narrated that whenever the Prophet (peace and blessings be upon him) feared a people, he would say: 'Allahumma inna naj'aluka fi nuhurihim wa na'udhu bika min shururihim' (O Allah, we place You against them, and we seek refuge in You from their evils.)
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحج / 10325