From Sahih Muslim (Hadith 5643):
Abu Huraira reported Allah's Messenger (ﷺ) as saying:If a person were to cast a glance in your (house) without permission, and you had in your hand a staff and you would have thrust that in his eyes, there is no harm for you
Reference: Muslim 5643