All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu 'alyhi wa sallam, is His slave and Messenger.
The Prophet ordered the killing of snakes and scorpions wherever they were found, even in the Sacred Precincts of Makkah. This is because they are poisonous and harmful. In a Hadeeth (narration) on the authority of ‘Aa'ishah there were some animals that the Prophet ordered to be killed wherever found: snakes, crows whose color combines black and white, rats, wild rapacious dogs, scorpions and kites. [Muslim]
However, a snake found in the house is an exception. If a man finds a snake in his house, it should be instructed to leave in a three-day interim. If it does not leave, he may kill it. In a Hadeeth on the authority of Abu Sa‘eed Al-Khudri the Prophet ordered anyone who sees a snake in his house to ask it to leave and give it three days, for it may be a Jinn. If it does not leave, he should kill it. [Muslim]
Snakes and scorpions alike can harm man and a person must beware of them. Indeed, both scorpions and snakes sting and bite only by the permission and will of Allaah The Almighty.
Allaah Knows best.