Users tricked by spam messages to open malicious Word documents that distribute the Dridex online banking Trojan might have a surprise: they'll get a free anitivirus program instead.

That's because an unknown person -- possibly a white hat hacker -- gained access to some of the servers that cybercriminals use to distribute the Dridex Trojan and replaced it with an installer for Avira Free Antivirus.

Dridex is one of the three most widely used computer Trojans that target online banking users. Last year, law enforcement authorities from the U.S. and U.K. attempted to disrupt the botnet and indicted a man from Moldova who is believed to be responsible for some of the attacks.

Their efforts caused only a temporary drop in Dridex activity, the botnet returning to full strength since then and even adding new tricks to its toolset. The Trojan can record key strokes and injects malicious code into banking websites opened on affected computers.

Dridex attacks usually start with targeted email messages that contain malicious Word documents. Those documents have embedded macros, which, if allowed to execute, connect to a server and download the Dridex installer.

Very recently, malware researchers from antivirus vendor Avira observed that some of the Dridex distribution servers were pushing out an "up-to-date Avira web installer" instead of the Trojan.

This means that some victims were lucky and instead of having their computers infected, received a legitimate and digitally-signed copy of the company's antivirus program. However, the program's installation is not automatic or silent, so users would have had to manually go through the installation process to get it running.

"We still don’t know exactly who is doing this with our installer and why, but we have some theories," said Moritz Kroll, a malware expert at Avira, via email. "This is certainly not something we are doing ourselves."

One possibility is that cybercriminals are doing this themselves in order to confuse antivirus vendors and mess with their detection processes. However, this is unlikely, as they would have more to lose than gain from helping victims secure their computers.

The more likely explanation is that this unusual incident is the work of a white hat hacker who hijacked the Dridex distribution servers. This is supported by an independent analysis of some of those servers by a researcher named Bryan Campbell.

Campbell found a message left behind on the Dridex distribution websites that reads "the only thing on this website is crime."

"I really think it is a hacker who has discovered how to do a good thing but perhaps with not strictly legal methods," Kroll said. "If you think about it, there was a huge media announcement when Dridex was 'taken down' by the government authorities and a much smaller level of reporting on its return to the marketplace. That has got to be frustrating to some and might cause them to think: 'The government tried to take it down, they could not, I can do something myself'."

This is actually not the first time something like his happens. The Avira antivirus installer has been distributed in the past from hacked command-and-control servers for the CryptoLocker and Tesla ransomware. The people responsible for those incidents are not known either.