Ransomware is a type of attack in which the criminal encrypts the victim's data and demands payment to release it, often with the added threat of leaking the information. It has become one of the costliest threats for companies of every size, because it combines business disruption with the risk of data exposure. What few people realize is that encryption is the last act of a sequence that began days or weeks earlier.
Against ransomware, defense needs to prevent initial access, contain the damage once the attack starts and recover operations with backups that survive the attack. The focus here is defensive and realistic: no measure eliminates the risk completely, but a combination of controls greatly reduces the attack's chance of success and the impact of an incident.
How the attack unfolds
Encrypting the data is the ending. A ransomware attack usually starts well before that, with initial access gained through phishing, a leaked credential or the exploitation of an exposed, outdated service. From there, the attacker moves through the network, tries to escalate privileges, locates the high-value data and the backups, and only then triggers the encryption. The time between access and encryption is the window in which detection can still contain everything.
Many modern operations use double extortion: before encrypting, the attacker copies the data out and threatens to publish it. That changes the logic of defense, because having backups is no longer enough. You can restore all the data and the leak is still a risk. This is why preventing access and detecting the attack early carry even more weight.
Prevention: closing the entry points
The prevention that pays off most targets the initial access vectors. Since many attacks start through identity or an exposed service, that is where controls make the biggest difference. A second authentication factor, patching known vulnerabilities and reducing the exposed surface block most attempts before they progress.
- A second authentication factor on remote access and administrator accounts
- Fast patching of exposed services and known vulnerabilities
- A smaller exposed surface: nothing public without a need
- Least privilege and segmentation to limit lateral movement
- Phishing awareness, since phishing is the main way in
- Endpoint protection that detects malicious behavior
Detection: the window before encryption
Between initial access and encryption there is an interval, sometimes days or weeks long, in which the attacker moves around, escalates privileges and looks for the backups. That interval is the biggest opportunity for defense, and if you only notice the attack once the files are already encrypted, you have lost the best chance to contain it. Some typical signs of this phase:
- Unexpected creation of privileged accounts or access keys
- Use of legitimate administration tools outside the team's usual patterns
- Internal network scanning and repeated authentication attempts
- Unusual access to backup servers and file repositories
- Endpoint protection or log collection being disabled
- Abnormal volumes of data reads or outbound data, a sign of exfiltration
Detection depends on visibility and on someone looking at it. Endpoint protection with behavioral analysis, centralized logs and detection use cases turn these signs into alerts. Without them, the clues are there, but nobody sees them in time. This is where a detection and response service makes the biggest difference.
Containment during the incident
When the attack is detected in progress, the speed of containment determines how much damage is done. The immediate goal is to isolate what is compromised, so encryption and lateral movement do not spread. That requires a plan decided in advance, because in the middle of the incident there is no time to improvise who does what.
- Isolate compromised systems from the network instead of shutting them down indiscriminately
- Revoke credentials and sessions suspected of compromise
- Preserve evidence to understand the vector and the extent
- Activate the response plan with defined owners and contacts
- Assess the obligation to notify, including the ANPD (Brazil's National Data Protection Agency) when personal data is involved
Shutting machines down in a hurry can destroy evidence and get in the way of recovery. In general, isolating from the network is better than powering off, because it preserves the system's state for analysis. That decision needs someone with authority and a view of the whole picture, which is one more reason to have an incident response plan defined before you need it.
Recovery and the role of backups
Recovering without paying depends on having backups the attacker cannot reach. Modern ransomware looks for and deletes accessible backups before encrypting, so a backup connected to the same network and protected by the same credentials tends to go down with everything else. What holds up is an isolated, immutable backup whose restore has been tested.
- Keep isolated copies with no direct access from the production network
- Use immutable retention, which prevents deletion within a set period
- Test restores for real instead of just trusting that the backup exists
- Store copies outside the main environment, following the separation principle
- Document the expected recovery time for critical systems
Paying the ransom is not a recommended solution. Nobody guarantees the data will be recovered, the payment funds new criminal operations and, with double extortion, the risk of a leak remains. Reliable recovery comes from protected backups and a rehearsed plan, not from negotiating with the attacker.
Preparing the response before the incident
In the middle of an attack there is no time to decide who does what. The choices that reduce damage have to be made in advance: who coordinates, who has the authority to isolate systems, who to call for forensic analysis and legal support and how to communicate with affected parties. With a written, rehearsed response plan, containment happens in an orderly way; without one, it turns into expensive improvisation.
- Defined roles and owners, with a clear incident coordinator
- External contacts ready: forensic support, legal support and, if you have it, insurance
- Decision criteria for isolating systems, preserving evidence and triggering recovery
- An internal and external communication plan, without unnecessary exposure
- Assessment of the legal obligation to notify, including the ANPD under the LGPD (Brazil's General Data Protection Law)
Rehearsing with simulations
A plan that has never been exercised usually fails on first contact with reality. In tabletop exercises, the team walks through a ransomware scenario step by step and finds the gaps before they get expensive: a supplier's phone number that changed, a decision nobody knows who owns, a dependency that was forgotten. Repeating the exercise regularly keeps the response sharp and the plan up to date as the environment changes.
Practical checklist
- Enable a second factor on remote access and administration
- Quickly patch exposed services and known vulnerabilities
- Reduce the exposed surface and apply least privilege
- Segment the network to limit lateral movement
- Train the team to recognize phishing
- Keep backups isolated, immutable and tested
- Have a response plan with owners and contacts
- Define the criteria for isolation and evidence preservation
- Assess your incident notification obligations
- Rehearse recovery of critical systems
- Monitor for signs of lateral movement and data exfiltration
- Rehearse the response plan with tabletop exercises
- Keep forensic and legal support contacts ready
Best practices
- Prioritize preventing initial access, where defense pays off most
- Treat early detection as your chance to contain the attack before encryption
- Prefer isolating systems from the network over shutting them down indiscriminately
- Keep backups out of reach of the production network
- Test restores before you need them in an incident
- Invest in visibility to detect the phase before encryption
- Prepare and rehearse the response plan before you need it
- Do not treat paying the ransom as a recovery plan
Common mistakes
- Relying only on antivirus and prevention, without detection
- The attacker moves around for days without triggering an alert, until encryption.
- Backups connected to the network with the same credentials
- The attack deletes the backup along with everything else and recovery becomes impossible.
- Never testing restores
- You find out, in the middle of the incident, that the backup does not restore as expected.
- Not having a response plan defined in advance
- Decisions are improvised, the damage grows and evidence is lost.
- Paying the ransom as the first way out
- The money goes out with no guarantee of recovery, and the risk of a leak remains.
- A response plan that is written but never rehearsed
- Contacts and decisions fail the first time the incident is real.
Authorship and review
Cesar Gargiulo
CEO and founder of GUARDIASEC. Technical and editorial lead for the content published in this library.
Published on . Found a technical error? Write to [email protected] and we will correct it and keep a record of the change.