Hackers invaded computer systems at the departments of Treasury and Commerce starting in the spring, according to reports.