Dwell time is how long an attacker is inside your environment before you detect them. The clock starts at the moment of compromise, such as a phished account, an exploited server or a malicious package installed on a laptop. It stops when your security team notices. Some organisations keep counting until the attacker is contained or removed, and it is worth deciding which definition you use before you start measuring.
It matters because nearly everything that makes an incident expensive happens during dwell time. Reconnaissance, credential theft, lateral movement and data theft all take place before anyone is looking. Encryption and the ransom note usually come at the end. By then the attacker has done most of the damage they set out to do.
How dwell time is measured
A simple timeline has four points:
- Initial compromise: the first malicious action that succeeded.
- Detection: the first point at which someone on your side, a person or a system, recognised it as malicious.
- Containment: the attacker's access is cut off. Accounts are disabled, devices isolated, sessions revoked.
- Eradication: every foothold has been found and removed.
Dwell time usually means compromise to detection. Detection to containment is your response time. Together they give the total window the attacker had.
The hard part is point one. You rarely know when an intrusion started until the investigation works backwards from the first alert. That is why dwell time is normally calculated after an incident, during the investigation, and why the logs you keep decide how accurately you can measure it. If you only keep 30 days of sign-in logs and the attacker arrived 45 days ago, your dwell time figure will be wrong. So will your understanding of what they reached.
Dwell time, MTTD and MTTR
Dwell time is closely related to two metrics most security teams already track:
- Mean time to detect (MTTD) is usually measured from the first alert or signal to the point an analyst confirms it is real. It describes how fast your team works once something has fired.
- Mean time to respond (MTTR) covers confirmation to containment.
Dwell time is the bigger picture. It includes all the time before any alert fired. A team can have an excellent MTTD and still have a long dwell time if most attacker activity never produced an alert. Our guide to SOC metrics covers MTTD and MTTR in more detail.
What happens during dwell time
A recent example shows the pattern. In a GodDamn ransomware intrusion documented by researchers, the attackers were inside for five days before encryption:
- Day 1: a remote access tool installed from a user's Music folder, and a kernel driver dropped to disable security software.
- Days 1 to 2: fourteen credential-theft tools and a network scanner.
- Day 3: lateral movement with PsExec, with the remote access tool installed as a service on each new host.
- Day 5: at least ten hosts under the attacker's control, then encryption on a separate network segment.
Every one of those steps was a chance to detect the intrusion. Each one also made the eventual incident bigger: more credentials to reset, more hosts to rebuild, more data potentially gone. We cover the technical detail and the hunting queries in our write-up of the GodDamn EDR killer.
The same is true of data theft. In double extortion ransomware, data is copied out before anything is encrypted. If you only detect the encryption, the theft has already happened.
Why dwell time gets long
Long dwell times rarely come from one failure. The usual causes are:
- Nobody is watching at the time. Attacks that start on a Friday evening or overnight can have a full weekend before office-hours monitoring sees them.
- Blind spots. Hypervisors, network appliances, cloud control planes and developer laptops often send fewer logs, or none, to the security team. Attackers know which parts of an estate are watched least.
- Trusted tools. Remote management software, admin tools and valid credentials look like normal IT activity. An attacker using a real account and a real remote tool may raise no alerts at all.
- Alert fatigue. The signal fired but was closed as noise, or sat in a queue behind hundreds of others.
- Short log retention. Without history you can't find the first step, so you contain the visible part and miss the rest.
- No hunting. If you only respond to alerts, anything that didn't trigger one stays hidden until the attacker chooses to reveal it.
How to reduce dwell time
Watch around the clock
Attackers don't keep office hours. A 24/7 security operations centre, in-house or managed, turns a weekend of unobserved activity into an alert investigated within minutes.
Close the blind spots
Get the systems attackers favour into your detection platform: identity sign-ins and audit logs, servers and endpoints, hypervisors, firewalls and VPNs, and cloud activity. A short list of high-value sources is worth more than a long list of noisy ones.
Detect behaviour, not just known malware
Many of the steps above use legitimate tools. Detections for behaviour catch them where signatures can't. Examples include a remote access tool running from a user folder, several password-recovery tools on one machine, or a new kernel driver followed by a security agent going quiet.
Hunt
Threat hunting assumes an attacker may already be inside and goes looking, starting from current threat intelligence. It is the main way to find intrusions that produced no alerts.
Use deception
Honeytokens, decoy accounts and canary files have no legitimate use. Anyone who touches them is very likely an attacker, so they give high-confidence alerts early in an intrusion.
Keep logs long enough
Retain the logs that matter most, such as identity, endpoint and network, for months rather than weeks. Then you can find the start of an intrusion and measure dwell time honestly.
Check whether you're already compromised
If you have never looked, a compromise assessment establishes whether an attacker is already present. It resets the clock on any dwell time you don't know about.
How to measure your own dwell time
- For each confirmed incident, record the earliest malicious activity found during the investigation, the time of first detection and the time of containment.
- Note how it was detected: an alert, a hunt, a user report or a third party. Incidents found by outsiders usually have the longest dwell times.
- Track the median rather than the average, so one long-running intrusion doesn't hide the trend.
- Review the longest cases. Ask which earlier signal you could have caught and what log or detection would have caught it. Then build it.
Frequently asked questions
What is a good dwell time?
Shorter than the time an attacker needs to reach their goal. For ransomware crews that can be a few days or less, so the aim is to detect intrusions in hours, at the first stages such as initial access, credential theft or the first lateral move. The trend matters more than a single number: your median should fall over time.
Is dwell time the same as time to detect?
Not quite. Dwell time runs from the attacker's first successful action to detection. Mean time to detect is often measured from the first alert. Dwell time includes the period when no alert had fired at all, which is usually the larger part.
Does dwell time include the time to contain the attacker?
It depends on the definition. The common definition stops at detection. Some organisations measure through to containment or eradication, because the attacker is still active until then. Pick one definition and use it consistently.
Why does ransomware sometimes have a very short dwell time?
Some crews have automated and sped up their intrusions, moving from access to encryption in days or hours. That makes early detection more important, not less. There are fewer chances to catch them, and each one counts.
Can EDR alone reduce dwell time?
EDR is essential, but it only helps if someone acts on what it sees, and attackers increasingly target it directly. Pair it with identity and cloud monitoring, 24/7 response and regular hunting. Our explainer on BYOVD attacks covers how attackers switch EDR off.
How Wizard Cyber helps
Our SOCs are staffed 24/7, with Microsoft Sentinel and Defender at the core of the managed service. CYBERSHIELD AI investigates each incident as it arrives, with an average time to verdict of 3 minutes 30 seconds, and a senior analyst signs off by default. Threat hunting is included on our Complete and Command packages. To see how it would shorten the window on your estate, book a demo.