كتاب الحج
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 1331

Ibn Abbas (Allah be pleased with them) reported that Allah's Apostle (ﷺ) entered the Ka'ba, and in it there were six pillars, and he stood near a pillar and made supplication, but did not observe the prayer.

حَدَّثَنَا شَيْبَانُ بْنُ فَرُّوخَ، حَدَّثَنَا هَمَّامٌ، حَدَّثَنَا عَطَاءٌ، عَنِ ابْنِ عَبَّاسٍ، أَنَّ النَّبِيَّ صلى الله عليه وسلم دَخَلَ الْكَعْبَةَ وَفِيهَا سِتُّ سَوَارٍ فَقَامَ عِنْدَ سَارِيَةٍ فَدَعَا وَلَمْ يُصَلِّ ‏.‏
Reference : Sahih Muslim 1331
In-book reference : Book 15, Hadith 442
USC-MSA web (English) reference : Book 7, Hadith 3076
  (deprecated numbering scheme)