Hadithcore
Hadith #508160

Yahya related to me from Malik that he had heard that when the Messenger of Allah, (ﷺ), had finished his tawaf of the House, prayed two rakas, and wanted to go to Safa and Marwa, he would salute the corner of the Black Stone before he left.

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

References1 variant
Arabic/English book reference
Book 20, Hadith 113