We were with the Messenger of Allah ﷺ at Khayf in Mina when surah al-Mursalat was revealed. A snake came out, and the Messenger of Allah ﷺ said, "Kill it." We rushed at it, but it slipped into its hole.
أخبرنا أحمد بن سليمان قال حدثنا يحيى بن آدم عن حفص بن غياث عن الأعمش عن إبراهيم عن الأسود
كنا مع رسول الله ﷺ بالخيف من منى حتى نزلت والمرسلات عرفا فخرجت حية فقال رسول الله ﷺ اقتلوها فابتدرناها فدخلت في جحرها
Bukhari, Compensation for Hunting, Chapter on what a person in the state of ihram may kill among animals, no. 1830, and Muslim, Greetings, Chapter on killing snakes and the like, no. 2235, from the hadith of Hafs, through this same chain. It is also found in Kubra, no. 3866.