Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:42:39

And those who, when tyranny strikes them, they defend themselves,  

and those who, when they suffer aggression, injustice, defend themselves — these are another category — that is to say, they retaliate against those who wrong them in the same manner in which the latter wronged them, as God, exalted be He, says:
القرآن:٤٢:٣٩

وَالَّذِينَ إِذَا أَصَابَهُمُ الْبَغْيُ هُمْ يَنْتَصِرُونَ  

{والذين إذا أصابهم البغي} الظلم {هم ينتصرون} صنف، أي ينتقمون ممن ظلمهم بمثل ظلمه، كما قال تعالى: