It is narrated from Abu Huraira (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "If someone peeks into your house without permission and you throw a pebble at him which causes his eye to be injured, there is no sin upon you."
Hadith Referenceمسند الإمام الشافعي / كتاب العتق / 1671
Hadith Takhrijاخرجه البخاري، الديات، باب من اخذ حقه أو اقتص دون السلطان (1888)، (6902) ومسلم، الآداب، باب تحريم النظر في بيت غيره (2158)۔