كتاب الآداب
38  
The Book of Manners and Etiquette
(9)
Chapter: The Prohibition Of Looking Into A House
(9)
باب تَحْرِيمِ النَّظَرِ فِي بَيْتِ غَيْرِهِ ‏‏
Sahih Muslim 2156 b

Sahl b. Sa'd as-Sa'idi reported that a person peeped through the hole of the door of Allah's Messenger (ﷺ) and he had with him some pointed thing with which he had been adjusting (the hair of his head). Allah's Messenger (ﷺ) said to him:

If I were to know that you had been peeping. I would have thrust it in your eyes. Allah has prescribed seeking permission because of protection against glance.
وَحَدَّثَنِي حَرْمَلَةُ بْنُ يَحْيَى، أَخْبَرَنَا ابْنُ وَهْبٍ، أَخْبَرَنِي يُونُسُ، عَنِ ابْنِ شِهَابٍ، أَنَّأَخْبَرَهُ أَنَّ رَجُلاً اطَّلَعَ مِنْ جُحْرٍ فِي بَابِ رَسُولِ اللَّهِ صلى الله عليه وسلم وَمَعَ رَسُولِ اللَّهِ صلى الله عليه وسلم مِدْرًى يُرَجِّلُ بِهِ رَأْسَهُ فَقَالَ لَهُ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ لَوْ أَعْلَمُ أَنَّكَ تَنْظُرُ طَعَنْتُ بِهِ فِي عَيْنِكَ إِنَّمَا جَعَلَ اللَّهُ الإِذْنَ مِنْ أَجْلِ الْبَصَرِ ‏"‏ ‏.‏
Reference : Sahih Muslim 2156b
In-book reference : Book 38, Hadith 54
USC-MSA web (English) reference : Book 25, Hadith 5367
  (deprecated numbering scheme)