Sunan Ibn Majah · Hadith 315
The Book of Purification and its Sunnah - كتاب الطهارة وسننها
حدثنا عمرو بن رافع، حدثنا إسماعيل ابن علية، عن عبد العزيز بن صهيب، عن أنس بن مالك، قال كان رسول الله صلى الله عليه وسلم إذا دخل الخلاء قال " أعوذ بالله من الخبث والخبائث " .
It was narrated that Anas bin Malik said: "Whenever the Messenger of Allah entered the toilet, he would say: 'A'udhu Billahi minal-khubthi wa'l-khaba'ith (I seek refuge with Allah from male and female devils).'"
Gradings are classical jarḥ-wa-taʿdīl, name-matched to a rijāl index (not individually re-verified).