The report by ISNA quoted Mohammad Reza Golshani, IT head of Iran's state offshore oil company, as blaming Israel for having planned the attack.
Iran periodically reports the discovery of viruses and other malicious programs in government, nuclear, oil and industrial networks, blaming Israel and the United States. In May, Iran shut down part of its oil facilities because of another such cyberattack.
Israel has done little to deflect suspicion that it uses viruses against Iran.
In this case, Golshani said, the attack occurred over the past two weeks, was routed through China, and affected only the communications systems of the network. He said the main network was safe since it was isolated from the Internet, and was back to normal operations. Iran announced that it had temporarily disconnected its oil ministry and its main crude export terminal from the Internet after the May attack.
Iran earns up to 80 percent of its foreign revenue from the export of crude.
Iran is odds with the West over its nuclear program. The West suspects the program is aimed at developing weapons. Tehran denies the charge, saying its nuclear program is geared toward peaceful purposes like power generation and cancer treatment.
A computer worm known as Stuxnet briefly brought Iran's uranium enrichment activity to a halt in 2010.