Messing with other people's computers in any form without their information and consent is usually prohibited by law.
A slightly broken analogy would be breaking into a house to remove a hornets nest. Even if you do it carefully and not do any damage and what you do is beneficial for the community as a whole, it's contrary to the law.
If my neighbours hornets nest had killer hornets that were biting all the children in the neighbourhood and the police / council refused to do anything; then it'd be a damned shame if someone neatly removed the hornets nest.
Of course that wouldn't make it any more legal; but your defence would have a field day with the prosecution I'd imagine.
IANAL but I've watched the first double episode of The Firm, and I reckon I've got a pretty good grasp on how the law works now!
I'm curious now. What if my neighbours house was on fire? That fire threatens the whole neighbourhood. Surely I can protect my property by attempting to put out the fire. Do firefighters have indeminty for attempting to put out fires? What about volunteer firefighters?
Obviously I consider a house on fire to be analagous to an infected computer, but I do have some protection putting out a fire right? Nobody would sue me for fire damage (as long as I'm reasonable etc).
With a house on fire you're taking reasonable action to protect life.
In general, when you do something you then take responsibility for the consequences of that action. Thus, if there was a tiny fire and you flooded the house with water and foam and caused considerable water damage you may find the home owner suing for damage caused. You could counter by saying you prevented much more damage, but they'd say that a competent fire-fighter would have done that and avoided all the water damage.
The analogy fails (as they always do) because there are specific criminal laws around computer misuse / unauthorised use. Running software on someone's machine without their permission is unlawful.
You may have mitigation if you can claim that the harm from the botnet was more severe than the harm caused by the clean-up-hacking.
It is frustrating. I used to say "Don't fight abuse with abuse", but it's pretty hard to keep that attitude in the face of so much malware and spam.
"A slightly broken analogy would be breaking into a house to remove a hornets nest. Even if you do it carefully and not do any damage and what you do is beneficial for the community as a whole, it's contrary to the law."
On the other hand, you can't give a choking person the heimlich maneuver, or perform CPR on someone, without physical contact that could be construed as assault (or battery? not sure) in any other context.
But what if I genuinely wanted to see if I had registered a user by the name of "' or 1=1 --"? Oh well, hopefully someone else did it too, since it was posted here.
A slightly broken analogy would be breaking into a house to remove a hornets nest. Even if you do it carefully and not do any damage and what you do is beneficial for the community as a whole, it's contrary to the law.