Abdullah ibn Mas’ud reported: The Messenger of Allah, peace and blessings be upon him, taught us to bear witness to faith in prayer and to bear witness to faith in times of need. Bearing witness in prayer is to say, “Greetings are for Allah, as are prayers and pure things. Peace be upon you, O Prophet, and the mercy of Allah and His blessings. Peace be upon us and upon the righteous servants of Allah. I testify there is no God but Allah, and I testify that Muhammad is His servant and His messenger.” Bearing witness in times of need is to say, “Verily, all praise is due to Allah. We seek His help and His forgiveness, and we seek refuge in Him from the evil of our own selves and our bad deeds. Whomever Allah guides, there is none to lead him astray. Whomever Allah leads astray, there is none to guide him. I testify there is no God but Allah, and I testify that Muhammad is His servant and His messenger.”
Source: Sunan al-Tirmidhī 1105
Grade: Hasan (fair) according to Al-Tirmidhi
عَنْ عَبْدِ اللهِ بْنِ مَسْعُودٍ قَالَ عَلَّمَنَا رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ التَّشَهُّدَ فِي الصَّلَاةِ وَالتَّشَهُّدَ فِي الْحَاجَةِ قَالَ التَّشَهُّدُ فِي الصَّلَاةِ التَّحِيَّاتُ لِلهِ وَالصَّلَوَاتُ وَالطَّيِّبَاتُ السَّلَامُ عَلَيْكَ أَيُّهَا النَّبِيُّ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ السَّلَامُ عَلَيْنَا وَعَلَى عِبَادِ اللهِ الصَّالِحِينَ أَشْهَدُ أَنْ لَا إِلَهَ إِلَّا اللهُ وَأَشْهَدُ أَنَّ مُحَمَّدًا عَبْدُهُ وَرَسُولُهُ وَالتَّشَهُّدُ فِي الْحَاجَةِ إِنَّ الْحَمْدَ لِلهِ نَسْتَعِينُهُ وَنَسْتَغْفِرُهُ وَنَعُوذُ بِاللهِ مِنْ شُرُورِ أَنْفُسِنَا وَسَيِّئَاتِ أَعْمَالِنَا فَمَنْ يَهْدِهِ اللهُ فَلَا مُضِلَّ لَهُ وَمَنْ يُضْلِلْ فَلَا هَادِيَ لَهُ وَأَشْهَدُ أَنْ لَا إِلَهَ إِلَّا اللهُ وَأَشْهَدُ أَنَّ مُحَمَّدًا عَبْدُهُ وَرَسُولُهُ
1105 سنن الترمذي أبواب النكاح باب ما جاء في خطبة النكاح
2/398 المحدث الترمذي خلاصة حكم المحدث حسن في سنن الترمذي