مشكوة المصابيح Mishkat al-Masabih كتاب الطهارة The Book of Purification
(دُعَاءُ دُخُولِ بَيْتِ الخَلَاءِ)

(The supplication for entering the toilet)

1 hadith
Hadith 337
وَعَنْ أَنَسٍ قَالَ: كَانَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِذَا دَخَلَ الْخَلَاءَ يَقُولُ: «اللَّهُمَّ إِنِّي أَعُوذُ بِكَ مِنَ الْخبث والخبائث»
Anas reported that when God’s messenger entered the privy he used to say, "O God, I seek refuge in Thee from male and female devils.”* *One might be inclined to translate this phrase as "from infidelity and act of disobedience,” but the tradition from Zaid b. Arqam (p. 76) is very explicit, and so the translation above is probably the correct one. PT-2 (12-71.) (Bukhari and Muslim).
Hadith Reference Mishkat al-Masabih / The Book of Purification / Hadith: 337
Hadith Grading الألبانی: مُتَّفَقٌ عَلَيْهِ  |  زبیر علی زئی: متفق عليه
Hadith Takhrij ´تحقيق و تخريج: محدث العصر حافظ زبير على زئي رحمه الله` «متفق عليه، رواه البخاري (142) و مسلم (122 / 375)»