It is narrated from Sayyiduna Abu Umamah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When any of you enters the toilet, let him not fail to say: 'O Allah, I seek refuge in You from the filth, the impurity, the wicked and the corrupting one, Satan the accursed.'"
Hadith Referenceالمعجم الكبير للطبراني / باب الصاد / 7818