Sahl bin Sa’d (may Allah be pleased with him) narrates that a man looked through a hole into one of the rooms of the Prophet ﷺ. At that time, the Prophet ﷺ had a comb with which he was scratching his blessed head. The Prophet ﷺ said: “If I had known that you were peeping, I would have poked this comb into your eye, because seeking permission is required due to the act of looking.”
Hadith Referenceمسند الإمام الشافعي / كتاب العتق / 1672
Hadith Takhrijاخرجه البخاري، الاستئذان، باب الاستئذان من اجل البصر (6241) ومسلم، الآداب، باب تحريم النظر في بيت غيره (2156)۔