It is narrated from Usama bin Zaid (may Allah be pleased with them both), he says: The Messenger of Allah (ﷺ) and Bilal (may Allah be pleased with him) entered and went for some need (to relieve themselves), then both came out. Usama says: I asked Bilal (may Allah be pleased with him): What did the Messenger of Allah (ﷺ) do? Bilal (may Allah be pleased with him) replied: He went to relieve himself, then performed ablution, so he washed his face and hands, wiped his head, and wiped over his socks (as well).
Hadith Referenceمسند الإمام الشافعي / كتاب الطهارة / 72
Hadith Takhrijأخرجه النسائي: الطهارة، باب المسح على الخفين: (120)، وصححه ابن خزيمة: (185) والحاكم: 1/ 181-182.