Mishkat al-Masabih 975
وَعَنْ عَبْدِ الرَّحْمَنِ بْنِ غَنْمٍ عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ أَنَّهُ قَالَ: «مَنْ قَالَ قَبْلَ أَنْ يَنْصَرِفَ وَيَثْنِيَ رِجْلَيْهِ مِنْ صَلَاةِ الْمَغْرِبِ وَالصُّبْحِ لَا إِلَهَ إِلَّا اللَّهُ وَحْدَهُ لَا شَرِيكَ لَهُ لَهُ الْمُلْكُ وَلَهُ الْحَمْدُ بِيَدِهِ الْخَيْرُ يُحْيِي وَيُمِيتُ وَهُوَ عَلَى كُلِّ شَيْءٍ قَدِيرٌ عَشْرَ مَرَّاتٍ كُتِبَ لَهُ بِكُلِّ وَاحِدَةٍ عَشْرُ حَسَنَاتٍ وَمُحِيَتْ عَنْهُ عَشْرُ سَيِّئَاتٍ وَرُفِعَ لَهُ عَشْرُ دَرَجَاتٍ وَكَانَت حِرْزًا مِنْ كُلِّ مَكْرُوهٍ وَحِرْزًا مِنَ الشَّيْطَانِ الرَّجِيم وَلم يحل لذنب يُدْرِكَهُ إِلَّا الشِّرْكُ وَكَانَ مِنْ أَفْضَلِ النَّاسِ عَمَلًا إِلَّا رَجُلًا يَفْضُلُهُ يَقُولُ أَفْضَلَ مِمَّا قَالَ» . رَوَاهُ أَحْمد
From ʿAbd ar-Rahman ibn Ghanm, from the Prophet ﷺ, that he said: "Whoever says, before leaving and before turning his legs from [sitting in] the Maghrib and Subh prayers, There is no god but Allah alone, with no partner; His is the dominion and His is the praise; in His hand is the good; He gives life and causes death, and He has power over all things ten times, ten good deeds will be written for him for each one, ten bad deeds will be erased from him, and he will be raised ten ranks. It will be a protection for him from every hateful thing and a protection from the accursed Shaytan, and no sin will be permitted to overtake him except shirk. He will be among the best of people in deeds, except a man who surpasses him by saying something better than what he said." Reported by Ahmad.