سنن ابن ماجه Sunan Ibn Majah كتاب إقامة الصلاة والسنة Establishing the Prayer and the Sunnah Regarding Them
. بَابُ : مَا جَاءَ فِي سَجْدَتَيِ السَّهْوِ قَبْلَ السَّلاَمِ

Chapter: Concerning the two prostration of forgetfulness before the Salam

2 hadith
Hadith 1216
حَدَّثَنَا سُفْيَانُ بْنُ وَكِيعٍ ، حَدَّثَنَا يُونُسُ بْنُ بَكِيرٍ ، حَدَّثَنَا ابْنُ إِسْحَاق ، حَدَّثَنِي الزُّهْرِيُّ ، عَنْ أَبِي سَلَمَةَ ، عَنْ أَبِي هُرَيْرَةَ ، أَنّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، قَالَ : " إِنَّ الشَّيْطَانَ يَأْتِي أَحَدَكُمْ فِي صَلَاتِهِ ، فَيَدْخُلُ بَيْنَهُ وَبَيْنَ نَفْسِهِ حَتَّى لَا يَدْرِيَ زَادَ أَوْ نَقَصَ ، فَإِذَا كَانَ ذَلِكَ فَلْيَسْجُدْ سَجْدَتَيْنِ قَبْلَ أَنْ يُسَلِّمَ ، ثُمَّ يُسَلِّمْ " .
´It was narrated from Abu Hurairah that the Prophet (ﷺ) said:` “The Satan comes to any one of you while he is praying and comes between him and his soul, until he does not know whether he as added something or omitted something. If that happens, then he should prostrate twice before the Salam, then he should say the Salam.”
Hadith Reference Sunan Ibn Majah / Establishing the Prayer and the Sunnah Regarding Them / Hadith: 1216
Hadith Grading الألبانی: حسن صحيح  |  زبیر علی زئی: حسن
Hadith Takhrij « سنن ابی داود/الصلاة 31 ( 516 ) ، 198 ( 1032 ) ، ( تحفة الأشراف : 15252 ) ، وقد أخرجہ : صحیح البخاری/الأذان 4 ( 608 ) ، صحیح مسلم/المساجد 19 ( 389 ) ، سنن الترمذی/الصلاة 174 ( 397 ) ، موطا امام مالک/السہو 1 ( 1 ) ( حسن صحیح ) » ( «قبل أن یسلم» کا جملہ صحیح نہیں ہے )
Hadith 1217
حَدَّثَنَا سُفْيَانُ بْنُ وَكِيعٍ ، حَدَّثَنَا يُونُسُ بْنُ بَكِيرٍ ، حَدَّثَنَا ابْنُ إِسْحَاق ، أَخْبَرَنِي سَلَمَةُ بْنُ صَفْوَانَ بْنِ سَلَمَةَ ، عَنْ أَبِي سَلَمَةَ ، عَنْ أَبِي هُرَيْرَةَ ، أَنّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ : " إِنَّ الشَّيْطَانَ يَدْخُلُ بَيْنَ ابْنِ آدَمَ وَبَيْنَ نَفْسِهِ ، فَلَا يَدْرِي كَمْ صَلَّى ، فَإِذَا وَجَدَ ذَلِكَ فَلْيَسْجُدْ سَجْدَتَيْنِ قَبْلَ أَنْ يُسَلِّمَ " .
´It was narrated from Abu Hurairah that the Prophet (ﷺ) said:` “The Satan comes between the son of Adam and his soul, and he does not know how many Rak’ah he has prayed. If a person notices that, then let him prostrate twice before he says the Salam.”
Hadith Reference Sunan Ibn Majah / Establishing the Prayer and the Sunnah Regarding Them / Hadith: 1217
Hadith Grading الألبانی: حسن صحيح  |  زبیر علی زئی: حسن
Hadith Takhrij « تفرد بہ ابن ماجہ ، ( تحفة الأشراف : 14962 ) ، وقد أخرجہ : صحیح البخاری/الأذان 4 ( 608 ) ، العمل في الصلاة 18 ( 1222 ) ، السہو 6 ( 1231 ) ، بدء الخلق 11 ( 3285 ) ، صحیح مسلم/السہو19 ( 389 ) سنن ابی داود/الصلاة 31 ( 516 ) ، مسند احمد ( 2/313 ، 398 ، 411 ) ( حسن صحیح ) »