(68) باب اسْتِحْبَابِ دُخُولِ الْكَعْبَةِ لِلْحَاجِّ وَغَيْرِهِ وَالصَّلاَةِ فِيهَا وَالدُّعَاءِ فِي نَوَاحِيهَا كُلِّهَا
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(deprecated numbering scheme): Book 7, Hadith 3076