The Messenger of Allah ﷺ was asked about the house-snakes. He said: When you see one of them in your dwelling, say: I adjure you by the covenant which Noah made with you, and I adjure you by the covenant which Solomon made with you not to harm us. Then if they come back, kill them. (Using translation from Abū Dāʾūd 5260)
كُنْتُ جَالِسًا مَعَ النَّبِيِّ ﷺ فَأَتَاهُ رَجُلٌ فَسَأَلَهُ عَنْ حَيَّاتِ الْبُيُوتِ فَقَالَ إِذَا رَأَيْتُمْ مِنْهُنَّ شَيْئًا فِي مَسَاكِنِكُمْ فَقُولُوا أَنْشَدْنَاكُمْ بِالْعَهْدِ الَّذِي أَخَذَ عَلَيْكُمْ نُوحٌ وَنُنْشِدُكُمْ بِالْعَهْدِ الَّذِي أَخَذَ عَلَيْكُمْ سُلَيْمَانُ أَنْ تُؤْذُونَا فَإِنْ عُدْنَ فَاقْتُلُوهُنَّ