Malware Dwell Time: What It Is & Why It Matters
In this article
Malware dwell time is the length of time a threat actor remains undetected inside a network after an initial compromise, and it matters because it directly determines how much data can be stolen, how deep the attacker can spread, and how costly the eventual cleanup will be. In practical terms, it is the window between “when they got in” and “when you found out.” Reducing that window is one of the most important goals in modern cybersecurity, and understanding how dwell time is measured, what typical values look like, and what factors influence it can help organizations prioritize their defenses.
Background: Where the Metric Comes From
The concept of dwell time emerged from incident response (IR) work in the early 2010s, when security teams began noticing that many breaches were discovered months after the initial intrusion. Before that, most organizations focused on preventing malware from getting in, but the rise of advanced persistent threats (APTs) and targeted attacks showed that prevention alone was insufficient. Attackers were getting past perimeter defenses and then quietly operating inside networks for weeks or months.
Mandiant, a well-known incident response firm, popularized the metric in its annual M-Trends reports. The company defined dwell time as the number of days between the first evidence of compromise (the earliest date an attacker was present) and the date the incident was discovered. For years, Mandiant’s global median dwell time hovered around 100–200 days, with a notable drop to 24 days in 2021 before rising again to 16 days in 2022 (that figure was later revised upward). Other vendors and research groups publish their own numbers, but the definition is broadly consistent: it is the time from initial compromise to detection.
Why does this matter? Because the longer an attacker stays undetected, the more time they have to move laterally across the network, escalate privileges, locate sensitive data, and exfiltrate it in small, stealthy chunks. A breach that is detected in hours might result in minimal damage, while one that goes unnoticed for months can lead to massive data loss, ransomware deployment, or long-term espionage.
How Dwell Time Is Measured
Measuring dwell time requires forensic evidence. When an incident is discovered, investigators look for the earliest sign of malicious activity on the compromised systems. This could be:
- A suspicious log entry from a phishing email that was opened
- A malicious file dropped in a temporary folder
- An unusual PowerShell command executed on a server
- A new user account created by the attacker
- A connection to a command-and-control (C2) server
The date of that earliest evidence is the “initial compromise” date. The date the incident was discovered is usually the day the security team confirmed malicious activity, not the day the initial alert fired. The difference between those two dates is the dwell time. It is important to note that dwell time is a retrospective measurement; you cannot know it until after the incident is fully investigated.
Dwell time is typically reported as a median, not an average, because a few extremely long-lived intrusions can skew the mean. For example, if one attacker stays hidden for 1,000 days and nine others are caught in 10 days, the average is 109 days, but the median is 10 days. The median gives a better sense of what a typical incident looks like.
Typical Dwell Time Numbers
Industry reports provide a rough benchmark, though numbers vary by region, industry, and attack type. According to Mandiant’s M-Trends 2022 report, the global median dwell time was 16 days, a dramatic drop from 24 days in 2021 and 56 days in 2020. However, that low number was partly due to the prevalence of ransomware, which is often detected quickly because the encryption itself triggers alerts. When ransomware is excluded, the median dwell time was much higher—around 62 days in 2022.
Other sources report different figures. For example, a 2022 study by Sophos found that the median dwell time for ransomware attacks was 9 days, but for other types of intrusions it was 37 days. IBM’s Cost of a Data Breach Report typically includes a related metric called “time to identify and contain,” which has averaged around 277 days in recent years (including the time to contain). These numbers are not directly comparable because they measure slightly different things, but they all point to the same conclusion: many breaches go undetected for weeks or months.
It’s also worth noting that dwell time varies by industry. Highly regulated sectors like finance and healthcare often have shorter dwell times because they invest more in monitoring and have compliance requirements that force faster detection. Smaller organizations, which may lack dedicated security teams, often have longer dwell times simply because they have fewer eyes on their logs.
Why Dwell Time Is So Hard to Reduce
Reducing dwell time is not just about buying better antivirus software. Attackers deliberately design their malware to be stealthy. They use living-off-the-land techniques (using built-in system tools like PowerShell and WMI) to avoid creating new files that might be flagged. They encrypt their command-and-control traffic to look like normal HTTPS. They operate during business hours to blend in with legitimate user activity. And they often target endpoints that are not well monitored, such as laptops that are rarely on the corporate network.
Another challenge is alert fatigue. Security teams are bombarded with thousands of alerts per day, and many are false positives. Distinguishing a real intrusion from a noisy system update is difficult, especially when the attacker is careful to mimic normal behavior. Even with a security information and event management (SIEM) system, correlation rules need to be tuned to the specific environment, which takes time and expertise.
Finally, many organizations lack the staff to perform proactive threat hunting. Instead of actively searching for signs of compromise, they wait for alerts to fire. This reactive approach naturally leads to longer dwell times because the attacker is not triggering obvious alarms.
How to Reduce Dwell Time in Your Organization
There is no single silver bullet, but a combination of practices can significantly shrink the window of undetected access. Here are the most effective steps, in rough order of priority:
- Deploy endpoint detection and response (EDR) tools. EDR goes beyond traditional antivirus by continuously monitoring endpoint activity and providing visibility into processes, file changes, and network connections. It can detect behaviors that indicate an intrusion, such as credential dumping or unusual lateral movement.
- Implement 24/7 monitoring. If you don’t have a security operations center (SOC), consider a managed detection and response (MDR) service. Attackers don’t work 9-to-5, and neither should your detection.
- Use threat hunting proactively. Regularly search for indicators of compromise (IOCs) that might not trigger automated alerts. Look for anomalies like unexpected scheduled tasks, new admin accounts, or unusual outbound connections.
- Segment your network. If an attacker compromises one system, segmentation limits their ability to move laterally. This doesn’t reduce dwell time directly, but it reduces the impact of a long dwell time.
- Keep logs for at least 12 months. When an incident is discovered, you need historical data to determine the initial compromise date. If you only keep logs for 30 days, you may never know how long the attacker was present.
- Test your detection capabilities. Run red team exercises or tabletop simulations to see how long it takes your team to detect a simulated intrusion. This will reveal gaps in your monitoring coverage.
It’s also important to have a clear incident response plan. When a potential breach is identified, the response team needs to act quickly to contain and eradicate the threat. Delays in response can extend the dwell time even after the initial detection.
Common Misconceptions About Dwell Time
One common misconception is that dwell time is the same as “time to detection.” While they are related, dwell time is specifically the time from the attacker’s first action to the time you confirm the intrusion. Time to detection might start from when a specific alert fires, which could be days or weeks after the initial compromise. Dwell time is a broader measure that includes the entire undetected period.
Another misconception is that a low dwell time means the attack was unsuccessful. An attacker can still steal data in a few days, especially if they target a misconfigured cloud storage bucket or an unsecured database. Dwell time is just one metric; it doesn’t tell you the impact of the breach.
Finally, some people assume that dwell time only applies to sophisticated nation-state actors. In reality, even commodity malware like banking trojans can remain undetected for weeks. The attacker doesn’t need to be highly skilled; they just need to avoid triggering basic defenses.
Comparing Dwell Time to Other Security Metrics
Dwell time is often discussed alongside two other metrics: “time to detect” (TTD) and “time to respond” (TTR). Time to detect is the time from the initial compromise to the moment the security team becomes aware of a potential issue. Time to respond is the time from detection to containment and eradication. Together, these three metrics give a complete picture of an organization’s incident response capability.
Another related metric is “mean time to contain” (MTTC), which is often reported by IBM. MTTC includes the time to detect and the time to contain, providing a single number that reflects the entire incident lifecycle. Dwell time is a subset of that, focusing only on the undetected phase.
It’s also useful to compare dwell time with “time to exfiltration.” Some attackers steal data early and then linger for other purposes, such as establishing persistence. In that case, the dwell time might be long, but the actual data loss occurred quickly. Understanding these nuances is important for risk assessment.
Frequently Asked Questions
What is a “good” dwell time?
There is no universal standard, but many security professionals consider a median dwell time of 30 days or less to be acceptable, and under 10 days to be excellent. However, the ideal is zero—detecting the intrusion at the moment it happens. In practice, organizations that consistently detect intrusions within hours are in the top tier of security maturity.
How do attackers hide for so long?
Attackers use several techniques: they blend in with normal traffic, use legitimate administrative tools, disable logging, and avoid creating new files. They may also target systems that are not well monitored, such as development servers or remote employee laptops. Once they have administrative credentials, they can often disable security software.
Does dwell time differ between ransomware and other malware?
Yes, significantly. Ransomware attacks are usually detected quickly because the encryption itself is noisy and disruptive. The median dwell time for ransomware is often under 10 days, whereas for data theft or espionage, it can be months. This is why ransomware statistics often show lower dwell times than general breach reports.
Can a small business reduce dwell time without a big budget?
Yes, to a degree. Free or low-cost tools like Microsoft Defender for Endpoint, combined with centralized log collection and basic alerting, can help. Outsourcing monitoring to a managed security service provider (MSSP) is also cost-effective. The key is to ensure that someone is actually reviewing alerts and investigating anomalies, even if that person is not a dedicated security analyst.
Is dwell time the same as “time to containment”?
No. Dwell time ends when the intrusion is discovered, not when it is contained. Time to containment is longer because it includes the investigation and eradication phases. A short dwell time does not guarantee a quick containment; the response phase can still take days or weeks.
How can I calculate my organization’s dwell time?
You can only calculate it after an incident. During the forensic investigation, look for the earliest evidence of compromise and compare it to the discovery date. If you don’t have enough logs, you may need to estimate based on the earliest activity you can find. For a forward-looking metric, track your median dwell time across past incidents to identify trends.