As far as I know it has never happened. On the contrary, when Alejandro Caceres admitted to ddosing North Korea - taking down all their public websites for a week - he was questioned by the FBI who decided to take no further action.

https://www.wired.com/story/p4x-north-korea-internet-hacker-...

So hostile countries should be fair game for Americans who want a side-hustle. Plenty of Russian targets that could be profitable.