كتاب الحج
15  
The Book of Pilgrimage
(68)
Chapter: It is recommended for pilgrims and others to enter the Ka'bah and pray therein, and supplicate in all its corners
(68)
باب اسْتِحْبَابِ دُخُولِ الْكَعْبَةِ لِلْحَاجِّ وَغَيْرِهِ وَالصَّلاَةِ فِيهَا وَالدُّعَاءِ فِي نَوَاحِيهَا كُلِّهَا
Sahih Muslim 1329 f

Salim narrated on the authority of his father (Allah be pleased with him) that Allah's Messenger (ﷺ) entered the House along with Usama b. Zaid, Bilal and Uthman b. Talha. They closed the door from within, and, as they opened it, I was the first to get into it and meet Bilal, and I asked him:

Did Allah's Messenger (ﷺ) observe prayer in it? He said: Yes, he observed prayer between these two Yemenite pillars (pillars situated towards the side of Yemen).
وَحَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، ح وَحَدَّثَنَا ابْنُ رُمْحٍ، أَخْبَرَنَا اللَّيْثُ، عَنِ ابْنِ، شِهَابٍ عَنْ سَالِمٍ، عَنْ أَبِيهِ، أَنَّهُ قَالَ دَخَلَ رَسُولُ اللَّهِ صلى الله عليه وسلم الْبَيْتَ هُوَ وَأُسَامَةُ بْنُ زَيْدٍ وَبِلاَلٌ وَعُثْمَانُ بْنُ طَلْحَةَ فَأَغْلَقُوا عَلَيْهِمْ فَلَمَّا فَتَحُوا كُنْتُ فِي أَوَّلِ مَنْ وَلَجَ فَلَقِيتُ بِلاَلاً فَسَأَلْتُهُ هَلْ صَلَّى فِيهِ رَسُولُ اللَّهِ صلى الله عليه وسلم قَالَ نَعَمْ صَلَّى بَيْنَ الْعَمُودَيْنِ الْيَمَانِيَيْنِ.‏
Reference : Sahih Muslim 1329f
In-book reference : Book 15, Hadith 439
USC-MSA web (English) reference : Book 7, Hadith 3073
  (deprecated numbering scheme)