It is narrated from Abu Huraira (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "When any of you wakes up from sleep, he should wash his hands three times before putting them into a vessel, for he does not know where his hand spent the night."
Hadith Referenceمسند الإمام الشافعي / كتاب الطهارة / 41
Hadith Takhrijأخرجه مسلم: الطهارة، باب كراهة غمس المتوضئ وغيره يده المشكوك في نجاستها في الإناء قبل غسلها ثلاثاً: (278).