Yes it is illegal. First of all, any kind of hacking that is deemed to be harmful to the target is a federal offense. Second, add onto the fact that it was preemptive, that would take on a conspiracy charge. Then you have the multiple theft charges for whatever you changed, electronic vandalism, and I'm sure many others.