Abdullah bin Masud reported,

The Messenger of Allah ﷺ taught me the tashahhud to recite in the middle of the prayer and at its end.We used to memorize this from Abdullah when he told us that the Messenger of Allah ﷺ had taught it to him. He said that when he sat in the middle of the prayer and at its end on his left thigh, he would say, "All greetings, prayers, and pure things are for Allah. Peace be upon you, Prophet, and the mercy of Allah and His blessings. Peace be upon us and upon the righteous servants of Allah. I bear witness that there is no god but Allah, and I bear witness that Muhammad is His servant and messenger."He said, "Then, if it was in the middle of the prayer, he would rise once he finished his tashahhud. If it was at the end of the prayer, he would supplicate after his tashahhud with whatever Allah willed him to supplicate, then give the salam."

Azami 2146

Hasan

عن عبد الله بن مسعود، قال

علمني رسول الله ﷺ التشهد في وسط الصلاة وفي آخرها. فكنا نحفظ عن عبد الله حين أخبرنا أن رسول الله ﷺ علمه إياه قال: فكان يقول: إذا جلس في وسط الصلاة وفي آخرها على وركه اليسرى: التحيات لله، والصلوات والطيبات، السلام عليك أيها النبي ورحمة الله وبركاته، السلام علينا وعلى عباد الله الصالحين، أشهد أن لا إله إلا الله، وأشهد أن محمدا عبده ورسوله. قال: ثم إن كان في وسط الصلاة نهض حتى يفرغ من تشهده، وإن كان آخرها دعا بعد تشهده بما شاء الله أن يدعو، ثم يسلم.

الأعظمي 2146حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Tashahhud and salam
Section
How to sit during the second tashahhud
Numbering
Jami al-Kamil 2146 (2nd edition)
Azami 2146