The Prophet ﷺ said, "When you hear the crowing of roosters, ask Allah of His bounty, for they have seen an angel. And when you hear the braying of a donkey, seek refuge in Allah from Satan, for it has seen a devil."
أن النبي ﷺ قال: إذا سمعتم صياح الديكة فاسألوا الله من فضله، فإنها رأت ملكا، وإذا سمعتم نهيق الحمار فتعوذوا بالله من الشيطان، فإنه رأى شيطانا.
Bukhari related it in the Beginning of Creation (3303), and Muslim in Remembrance (2729), both of them from Qutayba bin Saeed, who said, Layth narrated to us, from Jafar bin Rabia, from Araj, from Abu Hurairah, who mentioned it.