Sahih al-Bukhari — Hadith 1196 (KitabGrid sequence)
Narrated Abu Huraira:
حَدَّثَنَا عَبۡدُ اللَّهِ بۡنُ يُوسُفَ، أَخۡبَرَنَا مَالِكٌ، عَنِ ابۡنِ شِهَابٍ، عَنۡ أَبِي سَلَمَةَ بۡنِ عَبۡدِ الرَّحۡمَنِ، عَنۡ أَبِي هُرَيۡرَةَ ـ رضى الله عنه ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ
" إِنَّ أَحَدَكُمۡ إِذَا قَامَ يُصَلِّي جَاءَ الشَّيۡطَانُ فَلَبَسَ عَلَيۡهِ حَتَّى لاَ يَدۡرِيَ كَمۡ صَلَّى، فَإِذَا وَجَدَ ذَلِكَ أَحَدُكُمۡ فَلۡيَسۡجُدۡ سَجۡدَتَيۡنِ وَهُوَ جَالِسٌ ".
Translation
Abdullah ibn Yusuf narrated to us; Malik informed us, from Ibn Shihab, from Abu Salamah ibn Abd al-Rahman, from Abu Hurayrah رضي الله تعالى عنه:
The Messenger of Allah صلى الله عليه وآله وسلم said, “When one of you stands to pray, Satan comes and confuses him until he does not know how much he has prayed. If one of you experiences this, let him perform two prostrations while seated.”