I've been trying to get my bosses on board with offensive security at work, where if I see someone trying to attack us I want the right to attack them back. Kind of turning the blue team into the red team. Imagine if you did that and then found out the attackers that you just counter-hacked were actually the government and now you're being arrested?
--I know it's illegal (except if a big company like Microsoft or a government agency like the FBI does it). It's the dream of every information security professional though.
Counter hacking is just hacking, the only difference is how you pick your target. And you never know, maybe the owner of the originating system was just another victim. (Hacker breaks in computer A, then precedes to hack computer B leaving trace back to computer A, not the hacker)
It is also against the law in most of developed world.
Counterattacking is a big no-no in most countries, so I would stay from that offensive security stuff. Unless of course, you're working for a government, in which case you need to look at the conventions of warfare and see if you can declare war on another country where the attack allegedly originated from ;-))) Tough sell :-)
After all virus writers/crackers/spammers are just business too.
Just because its government that hacks you doesn't make it any better, I believe it makes it worse.