Sunan an-Nasa'i, Book 1, Hadith 162 (In-Book)

It was narrated from Abu Hurairah that the Messenger of Allah said: "When any one of you wakes from sleep, let him not put his hand into the vessel until he has washed it three times, because he does not know where his hand spent the night."

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

sunnah.com