When the threat actor and victim agree
The transfer of 50 TB data would not be possible remotely – and on a filtered network such as that of Iran. Iran's official news agency IRNA downplayed the attack, quoting the spokesperson for the Ministry of Foreign Affairs who denied the breach.
Of note on the sheer size of this hack. The normal Internet download speed of Iranian is 11.8 megabits per second. To download 50 terabytes of data from the Foreign Affairs Ministry of Iran at this speed, would take over 392 days or over a year of uninterrupted download time, and Iran’s Internet frequent drops, is throttled by the government, and experiences regular government-induced blackouts. Based on these numbers, such an attack highly likely occurred from direct access to the data.