Israel has battered Iran on the battlefield, but Tehran has notched a series of embarrassing breaches targeting government agencies and officials.