Narrated Sahl bin Sa’ad: A man peeped through a round hole into the dwelling place of the Prophet, peace be upon him, while the Prophet, peace be upon him, had an iron comb with which he was scratching the head. The Prophet, peace be upon him, said, “Had I known you were looking (through the hole), I would have pierced your eye with it (i.e. the comb).” Verily! The order of taking permission to enter has been enjoined because of that sight (that one should not look unlawfully at the state of others).
“O Believers, do not enter other houses than your own until you have the approval of the inmates and have wished them peace; this is the best way for you: it is expected that you will observe it. Then, if you do not find anyone therein, do not enter until you have been given permission, and if you are told to go back, you should go back. This is a purer way for you, and Allah has full knowledge of whatever you do. There is, however, no harm if you enter uninhibited houses wherein is comfort for you; Allah knows whatever you disclose and whatever you conceal.”
An-Noor 27: 24-29]
[8: 258- O.B. Sahih Al-Bukhari]
Narrated Abu Hurairah: If someone is peeping into your house without your permission, and you throw a stone at him and destroy his eyes, there will be no sin for you.”
[9: 26- O.B. Sahih Al-Bukhari)