Jami` at-Tirmidhi, Volume 1, Book 2, Hadith 397 (DarusSalam) ⓘ
Abu Hurairah narrated that: Allah's Messenger (S) said: "Indeed the Shaitan comes to one of you in his Salat confusing him until he does now know how much he has prayed. When one of you experiences that then let him perform two prostrations while sitting."
حَدَّثَنَا قُتَيْبَةُ، حَدَّثَنَا اللَّيْثُ، عَنِ ابْنِ شِهَابٍ، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " إِنَّ الشَّيْطَانَ يَأْتِي أَحَدَكُمْ فِي صَلاَتِهِ فَيَلْبِسُ عَلَيْهِ حَتَّى لاَ يَدْرِي كَمْ صَلَّى فَإِذَا وَجَدَ ذَلِكَ أَحَدُكُمْ فَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ " . قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ .
also referenced under: Hadith 397 (Reference) & Book 2, Hadith 250 (In-Book)