Narrated Anas
A man peeped into one of the dwelling places of the Prophet. The Prophet got up and aimed a sharp-edged arrow head (or wooden stick) at him to poke him stealthily.
Narrated Sahl bin Sa'd As-Sa'idi
A man peeped through a hole in the door of Allah's Messenger (ﷺ)'s house, and at that time, Allah's Messenger (ﷺ) had a Midri (an iron comb or bar) with which he was rubbing his head. So when Allah's Messenger (ﷺ) saw him, he said (to him), "If I had been sure that you were looking at me (through the door), I would have poked your eye with this (sharp iron bar)." Allah's Messenger (ﷺ) added, "The asking for permission to enter has been enjoined so that one may not look unlawfully (at what there is in the house without the permission of its people)."
Narrated Abu Huraira
Abul Qasim said, "If any person peeps at you without your permission and you poke him with a stick and injure his eye, you will not be blamed."