Let's change the analogy: ISIS terrorists take over the MIT campus. Inside the university are 50 armed terrorists. Is it valid to now bomb the university? What if there are 100 terrorists?
There is no issue with scale here. No matter how much it scales, you won't reach a point where there is an ethical position that argues for the mass murder of people that we actually view as people. It only becomes ethical when we dehumanize the people affected.
So we're back to 'all of them are guilty'
The shame here is what you described is literally Hamas' reasoning for carrying out the October attacks. Dehumanization, hyper aggression, and hiding it all behind 'the opposition is inherently evil, guilty by association, so we are fundamentally justified'.