(a) Sayyiduna Abu Hurayrah (may Allah be pleased with him) says that the Messenger of Allah (peace and blessings be upon him) said: "When any of you gets up at night, let him not put his hand into the vessel, but rather wash it three times, for he does not know where his hands spent the night."
(b) In one narration it is: "When any of you gets up at night."
(c) In the narration of al-A'mash, the words are: "two or three times."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 203