Dwell time
Attackers once hid for a year; detection cut it to two weeks
Dwell time fell from 416 days (2011) to 14 (2025); 52% of intrusions are now found internally.
How long does an attacker stay hidden? In 2011, Mandiant’s median was four hundred and sixteen days: more than a year inside before anyone noticed. By 2016, about a hundred days. By 2023, ten. In 2025, fourteen. And more victims now catch intruders themselves: just over half, up from forty-three percent a year earlier. The quiet ones, spies, still stay for months. That gap is what detection is for.
Logging
Each log source answers one question; together they tell the story
Collect network, DNS, authentication, endpoint, application and cloud audit logs, synchronised by NTP and protected from tampering.
Detection starts with records. Each source answers one question. Firewalls and flow records: who talked to whom, and how much. DNS: which names were looked up, often the first sign of malware calling home. Authentication: who signed in, from where, and how. Endpoints: what actually ran. Applications: requests and errors. Cloud audit logs: every change to the infrastructure. They only help if the clocks agree, they are kept long enough, and an attacker cannot delete them.
Log management · Going deeper
Formats, flows versus packets, key Windows events and retention
Know syslog, NetFlow versus packet capture, Windows event IDs 4624 and 4625, retention and log integrity.
Know syslog, NetFlow versus packet capture, Windows event IDs 4624 and 4625, retention and log integrity. Syslog the standard for sending log messages from network devices and Linux systems to a central collector. NetFlow and IPFIX summaries of each connection: addresses, ports, bytes, time. Cheap to keep for months. Packet capture the full content of traffic. Rich evidence, very large, kept for days at most and useless for encrypted payloads. Windows Security log event 4624 is a successful sign-in, 4625 a failed one, 4720 a new account, 1102 the log being cleared. Metadata email headers, file timestamps and authorship, mobile location: often enough to reconstruct events. Keeping logs trustworthy.
- Syslog the standard for sending log messages from network devices and Linux systems to a central collector.
- NetFlow and IPFIX summaries of each connection: addresses, ports, bytes, time. Cheap to keep for months.
- Packet capture the full content of traffic. Rich evidence, very large, kept for days at most and useless for encrypted payloads.
- Windows Security log event 4624 is a successful sign-in, 4625 a failed one, 4720 a new account, 1102 the log being cleared.
- Metadata email headers, file timestamps and authorship, mobile location: often enough to reconstruct events.
Keeping logs trustworthy
SIEM
A SIEM joins four quiet signals into one alert worth waking for
A SIEM collects, normalises and correlates logs; SOAR automates the first response steps.
Here is why logs are collected in one place. At eleven minutes past two, j.lee signs in to the VPN from a new country, after nine MFA pushes. Eight minutes later, the account lists every admin group in the directory. Then j.lee’s laptop connects to forty servers in two minutes. And at two forty-one, three gigabytes go to a file-sharing site nobody uses. Each alone is low priority. The SIEM joins them by user, host and time, and raises one high alert: a likely account takeover, with data leaving.
Security operations · Going deeper · 1 of 2
SIEM, SOAR and UEBA, and how a security operations centre works
A SOC runs the SIEM, triages alerts in tiers and uses SOAR playbooks; UEBA adds behaviour baselines.
A SOC runs the SIEM, triages alerts in tiers and uses SOAR playbooks; UEBA adds behaviour baselines. SIEM collects logs, normalises them into common fields, correlates with rules, stores them for search and reports, and shows dashboards. SOAR security orchestration, automation and response: playbooks that enrich an alert, ask the user, disable an account or isolate a host automatically. UEBA user and entity behaviour analytics: learns normal for each user and machine and scores deviations. Threat intelligence feeds known-bad IPs, domains and hashes matched against logs: cheap, but only as good as their freshness. Inside a SOC. Analysts work in tiers: tier 1 triages alerts, tier 2 investigates, tier 3 hunts and handles major incidents. Measures that matter are mean time to detect (MTTD) and mean time to respond (MTTR). Many companies outsource part of this to a managed detection and response (MDR) provider.
- SIEM collects logs, normalises them into common fields, correlates with rules, stores them for search and reports, and shows dashboards.
- SOAR security orchestration, automation and response: playbooks that enrich an alert, ask the user, disable an account or isolate a host automatically.
- UEBA user and entity behaviour analytics: learns normal for each user and machine and scores deviations.
- Threat intelligence feeds known-bad IPs, domains and hashes matched against logs: cheap, but only as good as their freshness.
Inside a SOC
Analysts work in tiers: tier 1 triages alerts, tier 2 investigates, tier 3 hunts and handles major incidents. Measures that matter are mean time to detect (MTTD) and mean time to respond (MTTR). Many companies outsource part of this to a managed detection and response (MDR) provider.
SIEM · Going deeper · 2 of 2
Abnormal only stands out once you know what normal looks like
A baseline of normal behaviour lets anomaly detection and UEBA flag what no rule names.
Some attacks match no known signature. You catch them by knowing normal. This file server sends out about a gigabyte a day, every day, for weeks. From that history you set a line: three standard deviations above the mean. Anything above it is unusual. On day twenty-seven, at three in the morning, it sends thirty-eight gigabytes. More than thirty times normal. No rule said “watch for thirty-eight gigabytes”. The baseline did.
Vulnerability scanning
Give a scanner credentials, and it sees what is really installed
Non-credentialed scans show the outside view; credentialed scans read installed software and find missing patches accurately.
Scanners look for weaknesses before attackers do. A non-credentialed scan probes from the network, like an outsider. It sees open ports, service banners, TLS settings, and logins it can guess. A credentialed scan logs in. It reads every installed package and version, so it knows exactly which patches are missing, and sees local settings and accounts. It finds far more, with fewer false positives. Just guard that scan account as carefully as an admin account.
Running scans · Going deeper
Scan types, false positives and what to do with results
Know agent-based and network scans, false positives, CSPM, and the scan, verify, prioritise, fix, rescan loop.
Know agent-based and network scans, false positives, CSPM, and the scan, verify, prioritise, fix, rescan loop. Network scan from a central scanner across address ranges; finds unknown devices too. Agent-based scan software on each host reports continuously, including laptops that are rarely on the office network. Web application scan a DAST tool crawls and tests a running site for injection, XSS and misconfiguration. Cloud configuration (CSPM) checks cloud accounts for public storage, open security groups and missing logging. Container and code scans images and dependencies are scanned in the build pipeline. From report to fix. A false positive reports a flaw that is not there; a false negative misses a real one. Credentialed scans reduce both.
- Network scan from a central scanner across address ranges; finds unknown devices too.
- Agent-based scan software on each host reports continuously, including laptops that are rarely on the office network.
- Web application scan a DAST tool crawls and tests a running site for injection, XSS and misconfiguration.
- Cloud configuration (CSPM) checks cloud accounts for public storage, open security groups and missing logging.
- Container and code scans images and dependencies are scanned in the build pipeline.
From report to fix
Penetration testing
A penetration test proves what an attacker could really do
A penetration test follows rules of engagement with written permission; environments are known, partially known or unknown.
A scan lists what might be wrong. A penetration test proves what an attacker could do with it. It starts with a plan: the scope, the rules of engagement, and written permission. Without that, the same work is a crime. Then reconnaissance, from public sources and then active scanning. Exploitation to get a foothold. Post-exploitation: escalating and moving deeper, within scope. And finally a report with evidence and fixes, and a clean-up. Testers may get full knowledge of the environment, some, or none, mimicking an insider or an outsider.
Testing and exercises · Going deeper · 1 of 2
Red, blue and purple teams, bug bounties and tabletop exercises
Red teams attack, blue teams defend, purple teams learn together; bug bounties pay outside researchers.
Red teams attack, blue teams defend, purple teams learn together; bug bounties pay outside researchers. Red team a long, stealthy campaign against the whole organisation, people and buildings included, to test detection and response, not just find flaws. Blue team the defenders: SOC, incident response, engineering. Purple team red and blue working side by side, replaying techniques and tuning detection after each one. White team referees an exercise and sets its rules. Bug bounty outside researchers are paid for valid findings under published rules; a vulnerability disclosure policy offers safe harbour without pay. Vulnerability scan. Automated, broad, frequent. Lists likely weaknesses. Penetration test. Human-led, scoped, periodic. Proves impact. Red team. Goal-based, stealthy, rare. Tests detection and response.
- Red team a long, stealthy campaign against the whole organisation, people and buildings included, to test detection and response, not just find flaws.
- Blue team the defenders: SOC, incident response, engineering.
- Purple team red and blue working side by side, replaying techniques and tuning detection after each one.
- White team referees an exercise and sets its rules.
- Bug bounty outside researchers are paid for valid findings under published rules; a vulnerability disclosure policy offers safe harbour without pay.
Vulnerability scan
Automated, broad, frequent. Lists likely weaknesses.
Penetration test
Human-led, scoped, periodic. Proves impact.
Red team
Goal-based, stealthy, rare. Tests detection and response.
Penetration testing · Going deeper · 2 of 2
Hunters assume someone is already inside, and go looking
Threat hunting is hypothesis-driven: search for an ATT&CK technique, then turn findings into detections.
Alerts only fire for what you thought of in advance. Hunting fills the gap. Start with a hypothesis: attackers with stolen credentials hop between workstations using remote desktop. Search for it: every workstation-to-workstation RDP session in ninety days of logs. Find or rule out: two machines. One an admin’s approved test. One not, and now under investigation. Then improve detection: a new SIEM rule, so next time it is an alert, not a hunt.
Lesson complete
You finished “Detecting attacks”
Nicely done.