Sayyiduna Abu Sa'id Khudri (may Allah be pleased with him) narrates that the Prophet Muhammad (peace and blessings be upon him) said: "These animals from among the jinn (i.e., snakes), when any person sees one of them in his house, he should warn it three times. If he still sees it after that, then he should kill it, for it will be a devil."
The narrator named Muhammad bin Abu Yahya is the father of Ibrahim bin Muhammad bin Abu Yahya, who was a student of Imam Shafi'i.