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