How to avoid ransomware infection: a practical guide to protection
Avoiding ransomware infection is one of the main concerns for users, administrators, and business owners. Ransomware blocks access to files and demands payment for decryption. This article compiles practical measures: backups, updates, email protection, access rights configuration, remote access control, and an action plan in case of suspected infection. The goal is simple: reduce the likelihood of an attack and avoid data loss, even if malware still infiltrates the system.
Ransomware is dangerous not only because it damages documents, photos, databases, and work projects. They often spread across networks, disable protective tools, delete shadow copies, and attempt to encrypt backup storage. Therefore, a single antivirus program is not enough. A multi-layered protection approach is needed, where each measure addresses a specific attack vector.

What is ransomware and how does it infect devices?
Ransomware is malware that encrypts files or locks a system and then displays a ransom demand. Attackers promise to provide the decryption key after payment, but there are no guarantees. Even if the key is indeed sent, the data may be corrupted, and the organization may be attacked again.
Typically, infection does not happen “on its own.” There is usually a specific entry point: an email with an attachment, a link to a fake website, a vulnerability in outdated software, a weak password for remote desktop access, or launching pirated software. Understanding these scenarios helps build defenses without unnecessary panic.
Main infection channels
In practice, ransomware most often infiltrates systems through the following channels:
- phishing emails with malicious attachments or links;
- documents with macros, scripts, and password-protected archives;
- hacked accounts and weak passwords;
- unprotected RDP, VPN, or admin panels;
- vulnerabilities in operating systems, browsers, office suites, and servers;
- pirated software, “activators,” keygens, and dubious builds;
- infected flash drives and network folders with broad access rights;
- compromise of a supplier or remote contractor.
It is important to consider that the attack may be manual. In this case, the attacker first secures themselves in the network, studies the infrastructure, escalates privileges, disables protections, and only then initiates encryption. Therefore, prevention must include not just protection for individual computers but also account, network access, and backup control.
A short protection plan against ransomware
If you need a quick checklist, start with these actions. They address the most common infection causes and help recover without paying a ransom.
- Set up backups according to the 3-2-1 rule.
- Regularly update operating systems, browsers, office applications, and server software.
- Enable reliable endpoint protection: antivirus, EDR, or built-in OS tools.
- Limit user rights and avoid working constantly as an administrator.
- Protect email from phishing, macro attachments, and suspicious links.
- Close open RDP access from the internet or move access behind a VPN with MFA.
- Use unique complex passwords and multi-factor authentication.
- Segment the network and limit access to shared folders.
- Train employees to recognize suspicious emails and requests.
- Prepare a response plan: who to notify, what to disable, where to look for backups.
Such a set of measures does not guarantee absolute security. However, it significantly complicates an attack and reduces damage if an infection occurs.
Backups as the main data protection
Backups are the last line of defense. If files are encrypted, and clean copies are available, the company or user can recover without paying a ransom. But backups must be organized correctly. A regular copy on a connected network drive can be encrypted along with other files.
Use the 3-2-1 rule
The classic 3-2-1 rule looks like this:
- 3 copies of data: one working version and at least two backups;
- 2 different types of media or storage: for example, local NAS and cloud storage;
- 1 copy off the main infrastructure: an offline disk, immutable object storage, or remote site.
To protect against ransomware, immutable backups are particularly useful. These are copies that cannot be altered or deleted for a set period. In clouds, this function is often referred to as object lock, immutability, or retention lock. In a corporate environment, it should be enabled for critical data.
Check recovery, not just the creation of copies
A common mistake among organizations is to assume that having a backup job already means security. In reality, it’s important to regularly conduct recovery tests. A copy may be incomplete, corrupted, outdated, or inaccessible due to incorrect credentials.
The minimum order of verification:
- Select a few critical files, databases, or virtual machines.
- Restore them to a test environment without affecting the working system.
- Check data integrity and application launch.
- Record the recovery time.
- Update the instructions if errors are found.
For home users, checking is simpler: open several files from the backup, ensure that photos, documents, and archives are readable, and then disconnect the external disk from the computer.
Updates and vulnerability patching
Updates close vulnerabilities that can be exploited for remote infection. The longer a system runs without patches, the higher the risk that a known vulnerability will be used against it. This applies not only to Windows, macOS, or Linux, but also to browsers, extensions, office suites, archivers, VPN gateways, CMS, database servers, and network equipment.
What to prioritize for updates
Prioritization should be based on risk. First, update:
- operating systems of workstations and servers;
- browsers and email clients;
- Microsoft Office, LibreOffice, and PDF viewers;
- VPN, RDP gateways, firewalls, and routers;
- hypervisors and virtualization platforms;
- backup systems;
- public web applications, CMS, and plugins;
- Java, .NET, Python, Node.js, and other runtime components, if used.
In a business environment, maintaining an asset register is useful. It’s impossible to update effectively what no one knows about. Even a simple table with a list of servers, software versions, and responsible persons is better than having no accounting.
How to update safely
For home devices, it’s usually enough to enable automatic updates. For organizations, the approach should be more managed: a testing group, maintenance windows, backups before critical updates, and monitoring after installation.
At the same time, patches should not be indefinitely postponed due to the fear of “breaking something.” Vulnerable VPN gateways, old email servers, and public control panels often become entry points for ransomware. The balance is this: first test, then quickly deploy on critical systems.
Email and browser protection
Phishing remains one of the most convenient ways to deliver malware. An email can appear as an invoice, act, notification from a delivery service, resume, request from a manager, or message from a bank. Sometimes attackers copy the style of a real counterparty and use similar domains.

How to recognize a phishing email
Pay attention to risk signs:
- an unexpected file or link, especially if the sender is rushing;
- an archive with a password specified in the email;
- a request to enable macros or “allow editing”;
- the sender's address resembles the real one but contains extra characters;
- the text pressures fear, urgency, or the threat of fines;
- the link leads to a domain that does not match the official one;
- the attachment has a double extension, such as
invoice.pdf.exe; - the email comes from a familiar person but is written in an unusual style.
If in doubt, it’s better to contact the sender through another channel: call, message in a messenger, or create a new email to the known address. Do not reply directly to a suspicious email, as the address may be spoofed.
Settings that reduce the risk of infection via email
For organizations, useful technical measures include:
- filtering attachments by file types;
- blocking executable files in archives;
- checking links and attachments in a sandbox;
- setting up SPF, DKIM, and DMARC for the domain;
- prohibiting macros from the internet;
- providing warnings about emails from external senders;
- creating specific rules for financial documents and payment requests.
For personal email, there are also simple steps. Use a modern email service, enable two-factor authentication, do not open suspicious attachments, and do not enter a password after clicking a link in an email. It is better to open the site in a browser by using a bookmark or manually typed address.
Access rights and account control
Ransomware typically encrypts only those files that the running process has access to. If a user has rights to all network folders, the damage will be much greater. Therefore, the principle of least privilege is one of the most important methods of protection against ransomware.
Do not work as an administrator constantly
Everyday accounts should not have admin rights. Administrative rights are needed only for installing software, changing system settings, and maintenance. It’s better to use a separate account for these tasks.
In companies, roles should be divided:
- regular users — access only to their work data;
- local administrators — limited and upon request;
- domain administrators — only for domain administration tasks;
- service accounts — with minimal permissions and no interactive login;
- contractor accounts — with a limited lifespan.
This approach reduces the likelihood that one infected workstation will lead to the encryption of the entire network.
Enable multi-factor authentication
MFA protects accounts even if a password is leaked. It is especially important to enable multi-factor authentication for:
- email;
- VPN;
- cloud storage;
- admin panels;
- backup systems;
- administrator accounts;
- contractor remote access.
It’s better to use authentication apps, hardware keys, or push confirmations with protection against exhaustion attacks. SMS is better than having no second factor, but for critical accounts, more resilient methods are preferable.