Ransomware Attack Stages: How It Works and How to Detect It
Skip to content

Ransomware Attacks: Stages, Detection and Response

A ransomware attack is an intrusion that ends in encryption. The attacker gains access, takes control of the network, steals data, and only then encrypts systems and demands payment.

Every stage before encryption leaves evidence. This guide walks through the stages in order: what the attacker does, where it becomes visible, and the detection methods that catch it while there is still time to act.

How Ransomware Works

Modern ransomware is operated by people, not released as a self-spreading virus. An operator signs in to the victim’s network and works through it by hand, using stolen credentials and ordinary administration tools.

Most groups run as a service. A core team builds the encryptor and the leak site. Affiliates carry out the intrusions and keep most of the payment. Access to a victim is often bought from a broker who specializes in breaking in and sells the foothold on.

The business model is double extortion. Data is copied out first, then systems are encrypted. The victim is pressed twice: pay to decrypt, and pay to stop publication. Some groups skip encryption and extort on stolen data alone.

The time from first access to encryption ranges from weeks to hours. A joint FBI and CISA advisory describes incidents where data left the network a little over two hours after initial access. Detection has to work at any hour, and it has to work on the early stages.

The Ransomware Ecosystem

Ransomware is an industry with specialized roles. Few of the people involved could run an attack alone, and none of them need to. Understanding who does what explains why the threat is so persistent, and why removing one group changes so little.

Operators

A core team writes the encryptor, runs the leak site and payment system, and manages the brand. They rarely break into victims themselves.

Affiliates

Independent intruders who use the operator’s toolkit. They choose the victim, carry out the intrusion, and keep the larger share of any payment. A skilled affiliate may work with several ransomware brands.

Initial access brokers

Criminals who specialize in getting in. They compromise organizations in bulk, through stolen credentials or vulnerable devices, and sell the access to whoever pays.

Infostealer operators

Sellers of logs harvested from infected computers. Each log contains saved passwords and sessions, including remote access logins that brokers and affiliates search for.

Tool developers

Authors of loaders, tools that disable security software, and the packers that hide malware from scanners.

Infrastructure providers

Hosting companies that ignore abuse complaints, and proxy networks that hide where traffic comes from.

Money launderers

Services that move cryptocurrency through mixers and exchanges until it can be spent.

The division of labor has three consequences for defenders.

First, the entry point and the ransomware are unrelated. The same affiliate may deliver two different brands in a month, and the same brand arrives by many different routes. Defenses built around one group’s known behavior age quickly.

Second, the intrusion may have two phases with a gap between them. A broker gains access and does little. Weeks later a buyer signs in with the same credentials and moves fast. An unexplained remote logon that led to nothing is worth investigating for this reason.

Third, the barrier to entry is low. An affiliate needs intrusion skills and a subscription, not the ability to write an encryptor. When a service is shut down, its affiliates move to another within weeks.

Groups and Law Enforcement

Ransomware brands rise, are disrupted, and reappear under new names. Three operations show the pattern.

Hive. In January 2023 the US Department of Justice announced that the FBI had been inside Hive’s network since July 2022. During that time it captured decryption keys and passed them to victims, preventing an estimated USD 130 million in ransom payments. Hive had targeted more than 1,500 victims in over 80 countries.

ALPHV, also called BlackCat. In December 2023 the Department of Justice announced a disruption of the operation and released a decryption tool that the FBI offered to more than 500 victims. The group resurfaced, was linked to the attack on Change Healthcare in February 2024, and then ceased operating.

LockBit. In February 2024 the UK National Crime Agency took control of LockBit’s infrastructure, source code, and leak site, and recovered decryption keys. Investigators found data from victims who had paid still held on the group’s servers.

Each operation removed infrastructure and, in some cases, led to arrests and sanctions. None removed the affiliates, who continued under other brands. For an organization, the practical lessons are that law enforcement may hold a decryption key, which is a reason to report an attack, and that payment has not reliably bought deletion of stolen data.

Profiles of four current and recent groups are in our guides to Akira, Qilin, LockBit, and Scattered Spider.

What an Attack Costs

The ransom demand is the visible number, and it is usually the smaller part of the cost. Organizations that never pay still face most of the following.

Downtime

Lost revenue and idle staff while systems are unavailable. For operations that depend on scheduling, logistics, or production systems, this is the largest single cost.

Response

Forensic investigators, legal counsel, and crisis communications, often for weeks.

Restoration

Rebuilding servers, reimaging workstations, and resetting every credential. Recovery of a whole network commonly takes weeks even with good backups.

Notification

Identifying affected people, writing to them, running a call center, and paying for identity protection where documents were exposed.

Legal and regulatory

Regulator inquiries, possible penalties, and claims from customers and affected individuals.

Lost business

Customers who leave, contracts that are not renewed, and higher insurance premiums afterward.

Two well-documented cases show how small the initial weakness can be. Colonial Pipeline shut down fuel distribution across the eastern United States in May 2021 after an intrusion through a legacy VPN account that used only a password, according to its chief executive’s testimony to the US Senate. The US Department of Justice later seized 63.7 bitcoins of the ransom that had been paid.

In February 2024, attackers entered Change Healthcare through a remote access portal that lacked multi-factor authentication, using compromised credentials, and deployed ransomware nine days later. The details come from the parent company’s testimony to the US Congress. The disruption to medical payments across the United States lasted for weeks.

In Australia, the Australian Signals Directorate’s Annual Cyber Threat Report 2024-25 describes ransomware as the most disruptive cybercrime threat. The agency responded to 138 ransomware incidents in that year, and ransomware featured in 11 percent of all incidents it handled.

The pattern in both cases above is the same as in most intrusions. One remote access route protected by a password alone was enough.

The Stages of a Ransomware Attack

StageWhat the attacker is doingBest source of visibility
1. Initial accessGetting a first foothold through remote access, an exposed device, or a user.VPN and firewall logs, email security, endpoint telemetry on the first host.
2. FootholdMaking access durable with remote tools, tunnels, and new accounts.Endpoint process and service events, DNS and outbound connections.
3. Credential theftCollecting passwords, hashes, and tickets until an administrator is captured.Endpoint telemetry, domain controller security logs.
4. Discovery and movementMapping the network and moving to servers, backups, and hypervisors.Authentication logs, east-west network traffic, endpoint telemetry.
5. Data theftGathering files, compressing them, and uploading them.File server and endpoint telemetry, firewall and proxy records.
6. PreparationDisabling defenses, destroying recovery options, staging the encryptor.Endpoint telemetry, backup and hypervisor logs, directory change logs.
7. EncryptionEncrypting servers and virtual machines, then leaving the note.File activity, hypervisor events, user reports.

Stages 2 to 6 are where defenders win. By stage 7 the job is limiting damage.

Stage 1: Initial Access

Most intrusions begin through remote access that accepts a password alone. The attacker signs in to a VPN, remote desktop gateway, or virtual desktop portal with credentials that were phished, reused from another breach, bought from a stealer log, or guessed by password spraying.

The second common route is an unpatched internet-facing device. Firewalls, VPN appliances, file transfer servers, and remote management servers are exploited within days of a vulnerability becoming public. A successful exploit often leaves a web shell or a new local account on the appliance.

Phishing remains in use. A user opens an attachment or runs a download from a fake software page, which installs a loader that calls out to the attacker.

Detection methods:

First-time remote access source

A VPN logon from a country, network provider, or device name the account has never used. Attacker machines often report generic hostnames, which VPN logs record.

Failures then success

Many failed logons across accounts from one source, followed by one success, indicates password spraying that worked.

Remote access without a second factor

Any successful VPN logon by an account excluded from multi-factor authentication deserves review. Service and vendor accounts are the usual gaps.

Dormant account activity

A logon by an account that has not been used for months, such as a former contractor.

Edge device changes

New administrator accounts, configuration changes, or unexpected files on a firewall or VPN appliance, particularly after a vulnerability advisory for that product.

Office application starting a script engine

A document or archive that leads to PowerShell, a script host, or a remote download on a workstation.

Visibility depends on VPN, firewall, and appliance logs being collected centrally. Many organizations keep them only on the device, where they are overwritten in days.

Stage 2: Foothold and Persistence

Once inside, the operator makes sure a password reset will not remove them. The usual method is to install a legitimate remote access tool, such as a remote support or remote monitoring product, which blends in with IT activity and calls out through the firewall on allowed ports.

Operators also set up tunnels that expose internal systems to the internet, deploy command and control frameworks, create local and domain accounts, and add scheduled tasks or services that relaunch their tools after a reboot.

Detection methods:

Remote access software inventory

Keep a list of the remote tools IT uses. Any other remote support, remote monitoring, or tunneling program starting on a server is a strong signal, whatever its reputation.

New services and scheduled tasks

Windows records a new service in the System log (event 7045) and a new scheduled task in the Security log (event 4698). Review those created outside change windows, especially ones that run from user profile or temporary folders.

New accounts and group changes

Account creation (event 4720) and additions to privileged groups (events 4728, 4732, and 4756) outside the normal provisioning process.

Regular outbound connections

A server contacting the same external address at even intervals, day and night, is typical of command and control. Network detection finds it without needing an agent on the host.

Rare destinations

Connections from servers to domains no other system in the organization contacts, and DNS queries to tunneling services.

Autostart changes

New entries in registry run keys and startup folders.

Persistence is easiest to see on servers, because servers change rarely. The same activity on a developer workstation is harder to separate from normal work.

Stage 3: Credential Theft and Privilege Escalation

The operator’s goal is a domain administrator account. Every technique at this stage is a way to turn one compromised machine into credentials for others.

The most common method is reading credentials from the memory of the Windows process that handles logons (LSASS). Any administrator who has signed in to that machine may have credentials there. Operators also copy the local account database, search file shares and browsers for saved passwords, and request Kerberos service tickets that can be cracked offline.

With enough privilege, the operator takes everything at once. They copy the directory database from a domain controller, or ask a domain controller to replicate password data to them as if they were another domain controller.

Backup servers are a frequent target at this stage. Backup software stores credentials for every system it protects, and those credentials can be extracted from its configuration database.

Detection methods:

Access to the logon process memory

Endpoint tools and Sysmon (event 10) record one process opening another. Anything other than known security software reading LSASS memory is high priority.

Dump creation

System utilities being used to write a memory dump of the logon process, or a dump file appearing in a temporary folder.

Directory database access

Use of the directory maintenance utility or volume shadow copies on a domain controller to copy the directory database. Legitimate use is rare and scheduled.

Replication requests from a non-domain controller

Domain controllers log directory replication operations (event 4662). A replication request from a workstation or member server is one of the clearest signs of full domain compromise.

Service ticket bursts

One account requesting Kerberos service tickets (event 4769) for many different services in a short period, particularly with older encryption types.

Administrator logons in the wrong place

A domain administrator signing in to an ordinary workstation exposes that credential. Privileged logons (event 4672) from unexpected hosts are both a risk and a signal.

Activity on backup servers

Interactive logons, new processes, or database queries on backup infrastructure outside backup windows.

Several of these events are recorded only when advanced audit policy is enabled on domain controllers. Directory service access auditing is off by default.

Stage 4: Discovery and Lateral Movement

Before moving, the operator maps the environment. They query the directory for administrators, servers, and trust relationships, scan address ranges for open management ports, and list file shares. Purpose-built tools collect this in minutes and draw the shortest path to domain control.

Movement uses the same protocols administrators use. Remote desktop gives an interactive session. Remote service creation over file sharing, Windows management interfaces, and remote PowerShell run commands without one. On Linux systems and hypervisors, the route is SSH.

Detection methods:

Discovery bursts

Several discovery commands on one host within minutes, such as listing domain administrators, domain controllers, and trusts. Individually they are routine. Together, from a user workstation, they are not.

Directory query volume

A workstation sending a large number of directory queries in a short time, which is how mapping tools collect their data.

Internal scanning

One host connecting to many addresses on management ports. Network detection sees this even where the scanning host has no agent.

New paths between systems

A workstation opening remote desktop or file-sharing sessions to servers it has never contacted. A baseline of who normally talks to whom makes these stand out.

Remote execution artifacts

A new service created remotely on a server, access to administrative shares (event 5145), or command processes started by the Windows management service.

Logon type and source

Network logons (event 4624, type 3) and remote desktop logons (type 10) by privileged accounts from user workstations.

Workstation-to-workstation traffic

File-sharing or remote desktop sessions between two user machines are rare in most organizations and common in intrusions.

This stage is where network visibility matters most. Endpoint agents see what happens on managed hosts. Traffic between hosts shows the movement itself, including to systems that cannot run an agent.

Our guide to lateral movement detection covers these techniques in depth.

Stage 5: Data Collection and Exfiltration

Data theft usually happens in the last days or hours before encryption. The operator identifies valuable file shares and databases, copies the contents to one staging location, compresses them into archives, and uploads the archives to cloud storage or a server they control.

Operators favor command-line synchronization tools that copy whole folders to cloud storage, along with ordinary file transfer clients. The tools are often renamed to look like system files and run from folders administrators rarely check.

Detection methods:

Archive tools on servers

Compression utilities running on file servers or database servers, especially with password and split-volume options, and large archives appearing in temporary or system folders.

Transfer tools where none belong

File synchronization or transfer programs on servers. Check the original file name recorded in the program’s metadata, since the file on disk may have been renamed.

Upload volume

A server whose outbound traffic jumps from megabytes to gigabytes. Compare each host with its own history, and watch the ratio of data sent to data received.

Cloud storage destinations

Sustained connections from servers to consumer cloud storage and file-sharing services the organization does not use.

Mass file reads

One account opening thousands of files across shares in a short period. File access auditing (event 4663) or a file server’s own audit log records it.

Database exports

Large queries or dumps outside reporting schedules.

Firewall and proxy logs are the main evidence that data left. They are also the logs most often missing when an investigation needs them, because retention on the devices is short.

Stage 6: Preparation for Encryption

The final preparations are the loudest part of the intrusion and the last chance to stop it. The operator removes anything that would block encryption or allow recovery.

ActionWhat it doesHow it shows up
Deleting volume shadow copiesRemoves local restore points.Shadow copy administration commands run with delete options, or the equivalent through management interfaces.
Disabling Windows recoveryStops automatic repair after encryption.Boot configuration commands that turn recovery off.
Deleting backup catalogs and jobsRemoves the route to a restore.Backup console audit entries, and backup administration commands on servers.
Disabling security softwareStops detection and blocking.Protection disabled or exclusions added (Microsoft Defender events 5001 and 5007), agents that stop reporting, a vulnerable driver being loaded.
Clearing event logsDestroys evidence.Security log cleared (event 1102) and System log cleared (event 104).
Stopping servicesReleases locked database and mail files so they can be encrypted.Many database, mail, and backup services stopped in sequence.
Staging the encryptorPlaces the program where every system can run it.A new executable on a domain controller share, or a new Group Policy object or scheduled task (events 5136 and 5137).
Preparing the hypervisorReadies virtual machines for encryption.SSH enabled on virtualization hosts, password changes, and virtual machines powered off in bulk.

Almost none of these actions happen in normal operation. Each one justifies an immediate response, and automatic containment where the organization allows it.

Security agents going silent on several hosts at once is a signal in itself. Monitoring should alert on missing telemetry as well as on events.

Stage 7: Encryption and Extortion

Deployment is usually pushed to every system at once, through Group Policy, a software deployment tool, or remote execution from a domain controller. Operators prefer nights, weekends, and holidays.

Encryptors are built for speed. Many encrypt only part of each large file, which is enough to make it unusable. Virtual machines are encrypted from the hypervisor by powering them off and encrypting their disk files, which takes many servers down with one action.

Detection methods:

File change rate

One process modifying or renaming hundreds of files a minute, across many folders.

Decoy files

Files planted in shares that no legitimate process should touch. Any change to one is an alarm.

New extensions and notes

The same new file extension appearing everywhere, and identical text files created in each folder.

Encryption over the network

One host writing to file shares on many servers in sequence.

Hypervisor events

Virtual machines powered off together outside a maintenance window.

Detection at this stage triggers automatic isolation. A person reading an alert is too slow once encryption has started.

Visibility You Need

Detection is limited by what is collected. The table shows which sources cover which stages, and the gaps that most often leave an intrusion unseen.

SourceWhat to collectStages coveredCommon gap
Endpoint telemetryProcess starts with command lines, file, registry, driver, and network events from every server and workstation.1 to 7Servers left without an agent, including domain controllers and backup servers.
Domain controller logsLogons, privileged logons, account and group changes, Kerberos tickets, directory changes and replication.2 to 6Advanced audit policy never enabled, so the key events are not written.
Remote access and firewall logsVPN authentication, administrator access to devices, allowed outbound connections with volumes.1, 2, 5Kept only on the device and overwritten within days.
Network trafficConnections between internal systems, DNS queries, and outbound sessions.2, 4, 5, 7No monitoring of internal traffic, only the internet edge.
Backup and hypervisor logsAdministrator logons, job and retention changes, virtual machine power events, SSH status.3, 6, 7Not sent to central logging at all.
Cloud identity logsSign-ins, authentication method changes, and application grants.1, 3Short default retention.

Two further points decide whether the evidence survives. Logs must be stored outside the domain the attacker controls, or they are encrypted with everything else. Retention must exceed the attacker’s dwell time, or the first weeks of the intrusion are gone.

Detection Priorities

No organization detects everything. The following detections give the most warning for the least noise, in the order worth building them.

1
Credential dumping on any hostRare in normal operation and present in almost every intrusion.
2
Unapproved remote access and tunneling toolsThe most common persistence method, and simple to check against an approved list.
3
Shadow copy deletion and backup tamperingNear-certain evidence that encryption is imminent.
4
Security tool tampering and silent agentsThe operator clearing the way.
5
Remote access anomaliesFirst-time sources, dormant accounts, and logons without a second factor.
6
Internal scanning and new administrative pathsMovement toward servers and domain controllers.
7
Large uploads from serversData theft in progress.
8
New privileged accounts and Group Policy changesControl of the directory.

A single signal may be an administrator doing their job. Two or more on the same host or account within a day should be treated as an intrusion until proven otherwise.

When a Detection Fires

Speed matters more than certainty. Containing one server for an hour costs little. Waiting for proof can cost the network.

1
Contain the sourceIsolate the host through the endpoint tool, and disable the account involved.
2
Cut remote accessDisable the VPN session and reset the account’s credentials. Block the external addresses seen.
3
Protect the recovery pathCheck backups and take them off the network if there is any sign of tampering.
4
Preserve evidenceLeave affected systems powered on, and export remote access, domain controller, and firewall logs before they roll over.
5
ScopeSearch every system for the same tools, accounts, and destinations. Assume the first host found is not the first host compromised.
6
Call for helpBring in incident responders, the insurer, and legal counsel early.

If encryption has already begun, isolate first, protect backups, and keep systems powered on where possible so memory evidence survives.

Recovery and Reporting

Recovery restores systems. It also has to remove the attacker, or the same operator returns.

Reset identity

Treat every credential in the directory as stolen. Reset administrator, service, and user passwords, and reset the Kerberos ticket-granting account twice so forged tickets stop working.

Restore in dependency order

Identity and core network services first, then security tooling and logging, then backup infrastructure, then business systems.

Trust data, rebuild systems

A system image taken during the attacker’s dwell time may contain their tools. Restore data onto clean builds where possible.

Protect backups for next time

Immutable copies that an administrator cannot delete, separate credentials, and one copy offline.

Confirm the attacker is out

No remaining persistence across the fleet, no use of reset accounts, and no communication with the attacker’s infrastructure.

Decisions about payment belong to executives, with legal counsel and the insurer. Payment does not guarantee working decryption or the deletion of stolen data, and government agencies including the Australian Signals Directorate advise against it.

In Australia, the Cyber Security Act 2024 requires a business with annual turnover above AUD 3 million, and entities responsible for critical infrastructure assets, to report a ransomware or cyber extortion payment within 72 hours of making it. The report is submitted through the Australian Signals Directorate. The obligation has applied since May 30, 2025. An eligible data breach under the Privacy Act must also be notified to the Office of the Australian Information Commissioner and affected individuals.

Ransomware Detection and Response With ThreatDefence

ThreatDefence combines SIEM, endpoint visibility, network detection and response, identity threat detection, and deception in one platform, so the stages described here are monitored from one place. Our 24x7 SOC investigates detections at any hour and contains confirmed threats under agreed authority, including isolating hosts and disabling accounts.

When an incident is underway, our responders deploy the same toolset to search every endpoint, account, and network path for the attacker’s footholds, and our SOC monitors the environment while systems are restored. An incident response retainer and a readiness review are available before an incident.

Response actions in the ThreatDefence portal: revoke sessions, reset password, isolate endpoint and block address, each with its operating mode, status and rollback

Experiencing a breach?

Our incident response team answers 24x7, with or without a retainer.

Talk to Our Experts

Discuss ransomware detection, incident response retainers, and 24x7 monitoring for your organization.

    I'm an MSP, MSSP, or reseller

    By submitting this form, you accept the terms in our privacy policy.

    Frequently Asked Questions

    What are the stages of a ransomware attack?

    A ransomware attack typically moves through initial access, establishing a foothold, credential theft, discovery and lateral movement, data theft, preparation, and encryption. The stages before encryption can take hours or weeks, and each one leaves evidence that can be detected.

    How can ransomware be detected before encryption?

    By detecting the attacker’s preparation. The strongest signals are credential dumping, unapproved remote access tools, internal scanning, large uploads from servers, security tools being disabled, and shadow copies or backups being deleted. These occur before any file is encrypted.

    How do attackers usually get in before deploying ransomware?

    Common routes include remote access without multi-factor authentication, unpatched internet-facing devices, exposed remote desktop services, phishing, and credentials bought from other criminals. The investigation should confirm the route, since it must be closed before recovery.

    How long are attackers in a network before ransomware is deployed?

    It varies from hours to weeks. Some operators steal data and encrypt within a day of first access. Others spend weeks mapping the network. Monitoring has to work at any hour, since the final stages often run overnight or at weekends.

    What is double extortion ransomware?

    Double extortion is a ransomware attack where data is stolen before systems are encrypted. The attacker demands payment for the decryption key and threatens to publish the data. Restoring from backup solves the first problem and leaves the second.

    Can endpoint protection alone stop ransomware?

    Not reliably. Operators disable or uninstall endpoint protection before encrypting, and they work through systems that cannot run an agent, such as hypervisors and network appliances. Network, identity, and backup monitoring cover what endpoint tools miss.

    Should infected computers be shut down?

    No, in most cases. Disconnecting a system from the network stops the spread while preserving memory, which can hold encryption keys and attacker tools. Shut down only where encryption is still running and the system cannot be isolated any other way.

    Can ransomware spread to backups?

    Yes. Attackers look for backup servers, steal the credentials they hold, and delete or encrypt restore points before deploying ransomware. Backups held offline, in immutable storage, or under separate credentials are much harder to reach.

    Do we have to report a ransomware attack in Australia?

    It depends on what happened. An eligible data breach must be notified under the Privacy Act. Regulated sectors have further duties. A ransomware payment by a business with turnover above AUD 3 million must be reported within 72 hours. Voluntary reporting to the Australian Signals Directorate is encouraged in every case.

    Can encrypted files be recovered without the decryption key?

    Sometimes. Free decryptors exist for some ransomware families, and partially encrypted databases or virtual disks can occasionally be repaired. Most organizations rely on backups and other copies of the data. Keep the encrypted files in case a tool is published later.