Whenever the Messenger of Allah ﷺ stood upon Safa, he would say "Allahu Akbar" three times, then declare, "There is no god but Allah alone, with no partner. To Him belongs the dominion, to Him belongs all praise, and He is capable of all things." He would do this three times and supplicate, and he would do the same upon Marwa.
أخبرنا محمد بن سلمة والحارث بن مسكين قراءة عليه وأنا أسمع واللفظ له عن ابن القاسم قال حدثني مالك عن جعفر بن محمد عن أبيه
أن رسول الله ﷺ كان إذا وقف على الصفا يكبر ثلاثا ويقول لا إله إلا الله وحده لا شريك له له الملك وله الحمد وهو على كل شيء قدير يصنع ذلك ثلاث مرات ويدعو ويصنع على المروة مثل ذلك