We were with the Messenger of Allah ﷺ on the night of Arafah, the one before the Day of Arafah, when suddenly there was the sound of a snake. The Messenger of Allah ﷺ said, "Kill it." It slipped into the crevice of a hole, so we inserted a stick and dug out part of the hole. Then we took a palm branch and set it on fire inside.The Messenger of Allah ﷺ said, "Allah protected it from your harm and protected you from its harm."
أخبرنا عمرو بن علي قال حدثنا يحيى قال حدثنا ابن جريج أخبرني أبو الزبير عن مجاهد
كنا مع رسول الله ﷺ ليلة عرفة التي قبل يوم عرفة فإذا حس الحية فقال رسول الله ﷺ اقتلوها فدخلت شق جحر فأدخلنا عودا فقلعنا بعض الجحر فأخذنا سعفة فأضرمنا فيها نارا فقال رسول الله ﷺ وقاها الله شركم ووقاكم شرها
[Sahih] Ahmad reported it: 1/385, from Yahya Qattan, through him, and it is in Kubra, no. 3867, and it has corroborating narrations, including the previous hadith.