Commentary for Berakhot 123:6
א"ר תנחום בר חנילאי כל הצנוע בבית הכסא נצול משלשה דברים מן הנחשים ומן העקרבים ומן המזיקין ויש אומרים אף חלומותיו מיושבים עליו
R. Tanhum b. Hanilai said : Whoever is modest in a privy is delivered from three things : from serpents, scorpions and evil spirits ; some say : Also his dreams will be such that his mind will be set at ease.
Abraham Cohen Footnotes to the English Translation of Masechet Berakhot
The Moslems also believe that evil spirits haunt such places, and offer a prayer before entering ; cf. Lane, p. 229.
Ask RabbiBookmarkShareCopy