You are speaking of Palestinians as a monolith. If you apply the same logic to Israelis, Palestinians are perfectly justified in attacking them. Hamas and Likud are both terrorist organizations. Targeting civilians is a war crime no matter who does it or why they say it’s justified.