كتاب السلام
5  
The Book of Greetings
(140)
Chapter: Seeking Permission to Enter (Someone's House) and Manners Relating to It
(140)
- باب الاستئذان وآدابه
Riyad as-Salihin 871
Sahl bin Sa'd (May Allah be pleased with him) reported:
The Messenger of Allah (ﷺ) said, "Seeking permission to enter (somebody's house) has been prescribed in order to restrain the eyes (from looking at something we are not supposed to look at)."

[Al-Bukhari and Muslim].

وعن سهل بن سعد قال‏:‏ قال رسول الله صلى الله عليه وسلم ‏:‏ ‏ "‏إنما جعل الاستئذان من أجل البصر‏"‏ ‏(‏‏(‏متفق عليه‏)‏‏)‏‏.‏
Reference : Riyad as-Salihin 871
In-book reference : Book 5, Hadith 28