Sunan Abi Dawud, Book 3, Hadith 1025 (USC-MSA)

Abu Hurairah reported the Messenger of Allah as saying; When one of you stands up to pray, the devil comes to him and confuses him so that he does not know how much he has prayed. If any of you has such an experience, he should perform two prostrations while he is sitting. Abu Dawud said; This tradition has been narrated in a similar manner by Ibn ‘Uyainab, Ma’mar and al-Laith.

حَدَّثَنَا الْقَعْنَبِيُّ، عَنْ مَالِكٍ، عَنِ ابْنِ شِهَابٍ، عَنْ أَبِي سَلَمَةَ بْنِ عَبْدِ الرَّحْمَنِ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ إِنَّ أَحَدَكُمْ إِذَا قَامَ يُصَلِّي جَاءَهُ الشَّيْطَانُ فَلَبَسَ عَلَيْهِ حَتَّى لاَ يَدْرِي كَمْ صَلَّى فَإِذَا وَجَدَ أَحَدُكُمْ ذَلِكَ فَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ ‏" ‏ ‏.‏ قَالَ أَبُو دَاوُدَ وَكَذَا رَوَاهُ ابْنُ عُيَيْنَةَ وَمَعْمَرٌ وَاللَّيْثُ ‏.‏

sunnah.com