How Ransomware Works
Follow a ransomware attack from the first foothold to the ransom note, and see where each stage can be stopped.
Key takeaways
- Ransomware attacks usually follow a sequence: get in, gain wider control, steal data, disable recovery, then encrypt.
- Attackers use sound, standard cryptography, so recovery without their key is generally impossible unless they made a mistake.
- Backups only save you if the intruder cannot delete or encrypt them and you have practiced restoring.
- Patching exposed systems, requiring strong multi-factor sign-in and limiting administrator rights close the most common paths.
- Paying carries no guarantee and may raise legal issues, so involve legal, insurance and law enforcement contacts early.
Ransomware is malicious software that locks up your data, usually by encrypting it, and demands payment for the key. In many attacks the criminals also copy the data first and threaten to publish it, so restoring from backup no longer ends the problem on its own.
The encryption is the loud final step. Against an organization, it often comes after days or weeks of quiet activity in which intruders get in, gain control and look for the backups. Each of those earlier stages is a chance to stop them.
Who is behind it
Many ransomware operations run like a franchise, often called ransomware as a service. A core group builds and maintains the encryption software, the payment site and the leak site. Affiliates carry out the intrusions and share the proceeds. Separate specialists, known as initial access brokers, sell working footholds into networks.
This division of labor explains why the same family of ransomware can arrive in very different ways, and why taking down one name rarely ends the activity. The people and tools tend to reorganize under another.
Attacks on home users still exist, usually as a trojan inside a pirated program or fake download that encrypts one computer and asks for a modest sum. The large, hands-on attacks target businesses, schools, hospitals, local governments and their service providers, where downtime is painful.
Stage one: getting in
The first foothold typically comes from one of a few places.
- Stolen or guessed credentials used on remote desktop, VPN or email services, especially where a second factor is missing. Infostealer malware feeds this market.
- Unpatched internet-facing systems. VPN appliances and other edge devices, file transfer products and web servers are prominent targets.
- Phishing that delivers a loader or captures a login.
- A trusted third party, such as an IT provider or software supplier whose access reaches many customers.
An intrusion that stops here is an incident. One that continues becomes a crisis.
Stage two: expanding control
Once inside, intruders explore. They list machines, accounts and file shares, then try to collect more powerful credentials, with a central directory administrator account as the usual prize. Moving from one machine to others is called lateral movement.
Much of this uses legitimate tools that administrators also use: remote management software, scripting shells and built-in commands. That makes it hard to spot with file scanning alone. Alerts on unusual behavior help, such as a workstation account suddenly logging in to many servers, a new administrator appearing at night, or security software being disabled.
Flat networks make this easy. Segmenting the network and keeping administrator accounts separate from everyday ones force the intruder to work harder and make more noise.
Stage three: theft and sabotage
Before encrypting, many groups copy valuable data to servers they control. Payroll files, contracts, customer records and internal email give them a second lever. This is often called double extortion. Some groups skip encryption altogether and extort on the stolen data alone.
Next they go after your ability to recover. Typical targets include backup servers and their consoles, snapshots, Windows shadow copies, virtual machine storage and cloud backup accounts reachable with the credentials they now hold. If the backups sit on the same network, managed with the same administrator login, assume the attacker can reach them.
Timing varies widely; the encryption is the stage everyone notices.
Stage four: the encryption itself
Ransomware combines two kinds of cryptography, the same combination that protects ordinary web traffic. Symmetric encryption is fast, so it scrambles the files. Public key encryption is slower but lets someone lock a secret that only the holder of a private key can open.
The program generates random symmetric keys on the victim's machine, encrypts files with them, then encrypts those keys with the attacker's public key. The private key needed to unwrap them never touches your computer. This is why scanning the infected machine for "the password" gets nowhere.
To finish quickly, many strains encrypt only portions of large files, which is enough to make them unusable. They commonly stop databases and other services first so the files can be opened, and they may spread the program to every reachable machine and trigger it at the same moment.
Occasionally a family has a flaw in its cryptography, or police seize its keys. Free decryption tools then appear, collected by initiatives such as the No More Ransom project. Keep a copy of the encrypted files and the ransom note even if you rebuild, in case a tool arrives later.
What the first hours look like
If you find encrypted files, speed and restraint both matter.
- Isolate affected machines from the network, including Wi-Fi. Disconnect shared storage and backup systems that are still clean.
- Don't wipe or rebuild yet. Memory, logs and the malware itself may be needed to work out how they got in.
- Use a separate communication channel, since company email and chat may be watched or down.
- Call for help: your incident response provider, cyber insurer, legal counsel and law enforcement.
- Reset credentials from clean systems, starting with privileged accounts, once the intruder's access is understood.
- Rebuild from known-good sources, then restore data, checking that the original way in is closed.
Writing this down beforehand is the point of an incident response plan. On a home computer, the short version is disconnect, preserve a copy of the locked files, erase, reinstall and restore from backup.
The question of paying
Payment buys a promise from a criminal. Decryptors can be slow or buggy, some victims receive nothing, and there is no way to verify that stolen data was deleted. Payments also fund the next round. On the other side, an organization with no usable backups may face losing records, jobs or the ability to deliver essential services.
Law complicates the choice. Paying a sanctioned person or group can be unlawful in some countries, some public bodies face restrictions, and reporting duties for incidents and data theft differ by jurisdiction and have been changing. The arguments are laid out in should ransomware victims pay. Make this decision with legal advice.
Restoring is harder than it sounds
A backup is only one ingredient of recovery. Rebuilding an organization after encryption means restoring services in an order that works: networking and name resolution, then the directory that handles sign-ins, then databases, then the applications that depend on them. If the directory itself was compromised, administrators may need to rebuild it or carefully clean it before anything else can be trusted.
Time is the other surprise. Copying large volumes of data back from a remote or cloud service can take days over an ordinary connection, and a restore that has never been rehearsed tends to uncover missing license keys, forgotten dependencies and passwords that were stored on the very systems now encrypted.
Intruders may also have been inside long enough for their tools to appear in recent backups. Teams therefore restore into an isolated environment first, scan it, reset credentials and only then reconnect. Keep printed or offline copies of the essentials: a system inventory, restore instructions, vendor contacts and the keys needed to decrypt your own backups.
For a household the same logic applies in miniature. Know where your backup is, how you would reinstall the operating system, and how you would sign in to your accounts if your only computer and its saved passwords were gone.
Prevention that changes the outcome
- Patch internet-facing systems first, and quickly.
- Require multi-factor authentication on every remote login, preferably a phishing-resistant method for administrators.
- Don't expose remote desktop directly to the internet.
- Separate administrator accounts from daily ones and grant the least access each role needs.
- Keep at least one backup offline or immutable, meaning it cannot be altered for a set period, with its own credentials.
- Test restores of whole systems and time them. A recovery objective you have never measured is a guess.
- Collect logs somewhere the intruder cannot easily erase, and act on alerts about disabled protection or mass file changes.
Smaller organizations can start with the first three items and the offline backup. Together they remove the easiest ways in and keep a way back, which matters more than buying another tool nobody has time to watch.
Common questions
Does cloud sync protect me?
Only partly. Sync faithfully copies encrypted files over good ones. Version history may let you roll back, within its limits, but sync is not the same as backup.
Can ransomware spread from one home device to another?
It can, if devices share folders or reuse passwords, or if a worm-like strain exploits an unpatched flaw. Keeping everything updated and limiting shared access reduces the chance considerably.