An Iranian national has been charged over a cyberattack that attempted to compromise both private sector companies and U.S. government entities, including the Treasury Department and State Department.