Sahih Muslim , Book 7, Hadith 3068 (USC-MSA)

Ibn Umar (Allah be pleased with them) reported that Allah's Messenger (may peace, be upon him) entered the Ka'ba. Usama, Bilal and 'Uthman b. Talha, the keeper (of the Ka'ba), were along with him. He closed the door and stayed in it for some time. Ibn 'Umar (Allah be pleased with them) said: I asked Bilal as he came out what Allah's Messenger had done there. He said: He prayed there in (such a position) that two pillars were on his left side, one pillar on his right, and three pillars were behind him, and the House at that time was resting on six pillars.

حَدَّثَنَا يَحْيَى بْنُ يَحْيَى التَّمِيمِيُّ، قَالَ قَرَأْتُ عَلَى مَالِكٍ عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم دَخَلَ الْكَعْبَةَ هُوَ وَأُسَامَةُ وَبِلاَلٌ وَعُثْمَانُ بْنُ طَلْحَةَ الْحَجَبِيُّ فَأَغْلَقَهَا عَلَيْهِ ثُمَّ مَكَثَ فِيهَا ‏.‏ قَالَ ابْنُ عُمَرَ فَسَأَلْتُ بِلاَلاً حِينَ خَرَجَ مَا صَنَعَ رَسُولُ اللَّهِ صلى الله عليه وسلم قَالَ جَعَلَ عَمُودَيْنِ عَنْ يَسَارِهِ وَعَمُودًا عَنْ يَمِينِهِ وَثَلاَثَةَ أَعْمِدَةٍ وَرَاءَهُ - وَكَانَ الْبَيْتُ يَوْمَئِذٍ عَلَى سِتَّةِ أَعْمِدَةٍ - ثُمَّ صَلَّى ‏.‏

sunnah.com