It is narrated from Sayyiduna Sahl bin Sa’d Sa’idi (may Allah be pleased with him): A man peeped through a hole into the room of the Messenger of Allah (peace and blessings be upon him). The Messenger of Allah (peace and blessings be upon him) had a comb in his hand with which he was scratching his head. The Noble Prophet (peace and blessings be upon him) said: “If I had known you were peeping, I would have poked your eye. Permission is prescribed for this reason, so that the gaze does not fall upon someone’s privacy.”
Hadith Referenceالسنن المأثورة / باب ما يحل من هتك حرمة مسلم / 607
Hadith Takhrijصحیح بخارى، الاستئذان، باب الاستئذان من أجل البصر، رقم: 624، صحيح مسلم، الآداب، باب تحريم النظر في بیت غیرہ، رقم: 2156۔