It depends on where it happens, and the nationality of the hacker. In some US states, it’s punishable by county jail time.