MOSCOW — Russia was again at the center of a global hacking scandal when computer systems the world over were frozen this weekend by a variant of malicious software known as WannaCry. But this time, Russians were among the victims of the attack, not suspected of being the perpetrators.

In fact, of all the countries afflicted in the first wave of the spread of the malicious software, Russia was hit the hardest: The virus tried to infect more computers in Russia than anywhere else, according to an analysis by Kaspersky Lab, a Russian antivirus company.

While government computers were crashing, banks, cellphone operators and railroads in Russia were fending off attacks designed to freeze their systems in demand for ransoms to unlock the data.

Now on the business end of a cyberattack, Russian officials were quick to voice outrage.

“Humanity is dealing here with cyberterrorism,” said Frants Klintsevich, the deputy chairman of the Russian Senate’s defense committee, according to the state-run Tass news agency. “It’s an alarming signal, and not just a signal but a direct threat to the normal functioning of society, and important life-support systems.”