How breaches really happen
Most breaches start in ordinary ways: an email someone trusted, a password reused from another site, a server nobody patched. From there they move through a few predictable steps. This lesson shows you those steps, the traces each one leaves, and where a defender can break the chain.
By the end you can
- Walk through the five stages of an attack chain and name the matching MITRE ATT&CK tactics
- Spot the four warning signs of a phishing message, and explain why fast reporting matters more than blame
- Recognise credential stuffing in login data and write a query that finds it
- Explain how ransomware with double extortion works and which controls break it
- Stop payment-change fraud with a call-back rule
The everyday picture
Picture a thief who wants the cash office of a big grocery store. He can't walk straight to the safe. First he needs a way in: a delivery door propped open, or a staff badge someone left on a café table. Then he needs somewhere to wait without being noticed, maybe behind the pallets in the stockroom. His badge only opens the shop floor, so next he needs the manager's keys. With the keys he can open doors he couldn't before, all the way down the office corridor. Only then does he reach the safe.
Every one of those steps is a chance to catch him: a delivery door that closes by itself, a stock clerk who asks who he is, keys kept in a locked box, an alarm on the office corridor, a safe with a time lock. The store does not need to win at every step. It needs to win at one. Digital attacks work the same way, and good security teams plan their defences around that fact.
The attack chain, step by step
In Thinking like an attacker you listed what Mangrove Market has worth protecting and who might come for it. This lesson follows a threat as it moves. Security people call that sequence an attack chain. The idea was popularised as the "cyber kill chain" in a 2011 paper by researchers at Lockheed Martin. Many versions exist; this five-stage one is enough to reason with:
- Initial access. The first way in: a phishing message, a stolen or reused password, an internet-facing server with a known flaw that was never patched, or a supplier who already has a connection into your network.
- Foothold. Staying in. The attacker makes sure their access survives a reboot or a password change: a program that starts with the computer, a new account, a hidden mailbox rule, a saved login token.
- Privilege. Getting more power. A normal staff account can do little. The attacker hunts for admin rights: a password saved in a script, an admin who once logged in on the same laptop, a local flaw that lets a normal user act as an admin. This is privilege escalation.
- Spread. Using those rights to reach other machines, from one laptop to the file server and from the file server to the backup server. This is lateral movement.
- Action on objective. The reason for the whole attack: steal customer data, encrypt systems for a ransom, redirect payments, or quietly use your servers for the attacker's own work.
MITRE ATT&CK is the shared vocabulary defenders use for these steps. It is built from reports of real incidents. It groups attacker behaviour into tactics, the goal at that moment, and techniques, the method used to reach it. Every technique has an ID, so a detection rule, an incident report and a threat report can all point at the same thing. The five stages map onto its tactics roughly like this:
| Stage | ATT&CK tactics | Example technique |
|---|---|---|
| Initial access | Initial Access | Phishing (T1566), Valid Accounts (T1078) |
| Foothold | Persistence, Command and Control | Boot or Logon Autostart Execution (T1547) |
| Privilege | Privilege Escalation, Credential Access | OS Credential Dumping (T1003) |
| Spread | Discovery, Lateral Movement | Remote Services (T1021) |
| Action on objective | Collection, Exfiltration, Impact | Exfiltration Over Web Service (T1567), Data Encrypted for Impact (T1486) |
Real attacks are messier than a neat line. Some skip stages: a fraudster inside one mailbox may never need admin rights. Some loop back, spreading to a new machine and then hunting for better passwords there. The model still pays off, because it gives the defender two habits. First, put a control at every stage, so that when one fails, the next one still has a chance. This is called defence in depth. Second, look for the early stages. The time between the first click and the ransom note is often days and sometimes weeks. Every hour of that window is a chance to find the attacker while the damage is still small.
Why do the first steps so often involve a person? Verizon's yearly DBIR has found for years that a human element, someone tricked by a message, a reused or stolen password, or a plain mistake, is involved in most breaches. In recent editions that share has been well over half. That is a reason to design systems that expect people to be fooled sometimes. It is never a reason to blame the person who was.
Quick check
An attacker who got into a store manager's laptop adds a program that starts every time the laptop boots and connects back to the attacker's server. Which stage is that?
The attacker is already in, so this is not initial access. A program that restarts with the machine keeps the access alive after a reboot or a password change, which is the foothold (ATT&CK calls it Persistence). Spread would mean reaching another machine, and nothing has been stolen or damaged yet.
Phishing: four warning signs, and why reports beat blame
Phishing is a message that pretends to come from someone you trust. It arrives by email, text message, chat, a phone call, even a QR code on a poster. It usually wants one of three things: your password typed into a fake sign-in page, a file opened on your computer, or a payment or favour done for the attacker. A message aimed at one named person with details about their job is called spear phishing.
You cannot memorise every trick, but nearly every phishing message shows at least one of four signs:
- The sender. The display name says one thing and the address says another. Look at the domain after the @ sign. Look-alike domains swap letters (rn for m), add words (mangrove-support) or use a different ending. Remember that a real address can send a fake request too, if the attacker controls that mailbox.
- Urgency or pressure. "Today", "or your account will be closed", "the CEO needs this now", "keep this between us". Pressure is there to stop you from checking.
- The link destination. The words of a link are not where it goes. On a computer, hover over it; on a phone, press and hold. Find the real site name, which is the part just before the first single slash. In
https://partner.mangrove.example.verify-account.example/loginthe site isverify-account.example, whatever comes before it. - An unusual request. Anything outside the normal way of working: pay a new bank account, buy gift cards, approve a sign-in prompt you didn't start, read out a code that was sent to your phone.
Here is how those signs look on a message that reached Mangrove store staff. The table shows the warning signs, not the whole message:
| What the message shows | Warning sign | What to check |
|---|---|---|
| From "Mangrove Payroll" <payroll@mangrove-hr-portal.example> | Sender: the name says Mangrove, the domain is not Mangrove's | Read the domain, not the name |
| "Confirm your salary account by 5 pm today or this month's pay is held" | Urgency plus a threat | Real teams give you time and other ways to check |
| A button "View payslip" that opens a sign-in page on another domain | Link destination | Hover or long-press and read the real site name |
| "Enter your password and the 6-digit code we just sent you" | Unusual request | No real team ever asks for a sign-in code |
Now the part that matters most. Attackers send the same message to many people at once. The first report lets the security team search every inbox and pull out the other copies, block the sender and the fake site, and see who clicked. If someone did type a password, a report within minutes means the password is reset and every session is signed out before the attacker uses it. A report three days later means investigating an intrusion instead.
People only report quickly if reporting is safe. If clicking gets you named in a meeting, people hide their clicks, and the security team loses the one signal it most needs. So good teams put a one-click report button in the mail app, answer every report with a thank-you within minutes, never punish a click, and measure how many people report and how fast, rather than who clicked. Practice phishing tests are fine when they teach and harmful when they shame. And because some messages will always fool someone, the systems behind them should limit the damage: phishing-resistant sign-in such as passkeys refuses to work on a fake site at all. You will see why in Identity: passwords, MFA and passkeys.
Quick check
A message from "Partner Support" has a button labelled partner.mangrove.example. When you long-press it, the real link is https://partner.mangrove.example.verify-account.example/login. Which site would it open?
Domain names are read from the right. Everything before verify-account.example is a label its owner chose, so anyone who owns that domain can put "partner.mangrove.example" in front of it. The browser always goes to the same place; the familiar words at the start are the trick.
Stolen passwords at scale: credential stuffing
Most people reuse passwords. When any website is breached, its list of email addresses and passwords tends to end up traded or published. Attackers then feed those pairs into automated tools that try them on other sites' login pages. This is credential stuffing, listed in ATT&CK as T1110.004. It is easy to confuse with two cousins, and the difference decides how you detect it:
- Brute force: many passwords against one account. Locking the account after a few failures stops it.
- Password spraying: one or two common passwords, such as a season and a year, against many accounts.
- Credential stuffing: real email and password pairs, a different password for every account, one or two tries each.
Stuffing works because each pair is correct somewhere. Only a small fraction of people reused that exact password on your site, but a list with millions of pairs still gives an attacker thousands of working accounts. Per-account lockout does not help, because each account sees a single failure and then nothing. To catch stuffing, you look across accounts. These are the signals defenders watch:
- Many accounts, few tries each. One IP address, or one device fingerprint, tries dozens of different accounts with one or two attempts per account. A real person types into one or two accounts.
- Many IP addresses. Attackers spread the traffic over hundreds or thousands of addresses so that no single one stands out. So watch the totals as well as each address.
- The success rate drops, then the successes look odd. If the Partner app normally sees about 9 in 10 logins succeed and one night sees 3 in 10 with ten times the traffic, something is guessing. The few successes that night come from new devices, new countries or accounts that never failed before.
- Unknown usernames and what follows a login. Many attempts for accounts that don't exist, then password resets, changed phone numbers, changed bank details and complaints a few days later.
The controls work at different points. MFA makes a correct password alone useless. Checking new passwords against lists of known-breached ones stops reuse at sign-up; NIST SP 800-63B requires services to compare new passwords against a blocklist that includes passwords from previous breaches. Rate limits per IP address, per account and across the whole login slow the tool down. Bot checks can be shown to suspicious attempts only. An alert on the overall success rate catches what per-IP rules miss. And telling users "a new device signed in to your account" turns every customer into a sensor.
Quick check
Overnight, the Partner app sees about 6,000 failed logins spread over 5,000 different accounts and 900 IP addresses. The lockout rule (5 failures on one account) fired zero times. What does this pattern point to?
Brute force hammers a few accounts and would trip the lockout. Forgotten passwords happen one owner at a time and come from their usual devices, not 900 addresses at night. A broken page would fail every login, including the regulars. About one failure per account across thousands of accounts is the shape of stuffing.
Ransomware and double extortion
Ransomware encrypts files and systems so the owner cannot use them, then demands payment for the key. Most serious ransomware today is run by people at keyboards, who walk the whole attack chain over days or weeks. They get in through a phishing message, a stolen remote-access password or an internet-facing device with a known flaw. They gain admin rights. They find the backups and delete or encrypt them. Only then do they encrypt as many machines as they can at once, often on a weekend or a festival night when fewer people are watching.
Most groups now add double extortion: before they encrypt, they copy data out, and the note says "pay, or we publish it". Using the words from Thinking like an attacker, a good backup restores availability, but it cannot undo the loss of confidentiality. Some groups now skip encryption and only steal and threaten. Paying does not reliably fix either problem: keys sometimes fail, stolen data has been published or sold anyway, and payments fund the next attack. Government agencies such as CISA and the FBI advise against paying.
The defence is the attack chain again, with a control at every link:
- MFA on email, remote access and every admin account, so a stolen password is not enough to get in or to climb.
- Patching, internet-facing systems first. VPN gateways, firewalls and remote-access tools are prime targets. CISA's Known Exploited Vulnerabilities catalog lists flaws that are being used in real attacks, which makes it a good order for patching.
- Least privilege. Admins use a separate admin account only for admin work, never to read email. No shared local admin password on every laptop.
- Segmentation. Tills, store networks, office laptops, warehouse servers and backups sit in separate network zones, so one infected laptop can't reach the backup server. Networks, endpoints and the cloud goes deeper.
- EDR on every computer and server. It flags things like password theft from memory or one program rewriting thousands of files, and it lets the security team cut a machine off the network with one click.
- Offline or immutable backups that you have restored recently. A common rule is 3-2-1: three copies, on two kinds of storage, one away from the main site, with at least one copy that an attacker with admin rights can't delete. A backup you have never restored is only a hope.
Think first: Mangrove's nightly backup job writes to a server on the same network and logs in with a domain admin account. Why would an attacker love this setup?
Because once they hold domain admin, which is their goal at the privilege stage anyway, the backups are just another server they can reach and wipe. The same account that protects the data can destroy it. Put backups in their own zone, use a separate account that can only write new backups, and keep one copy offline or immutable.
Payment-change fraud: the breach that needs no malware
Business email compromise (BEC) skips most of the chain. The attacker either registers a look-alike domain or takes over a real mailbox, usually through phishing. With a real mailbox they often add a rule that forwards or hides certain emails, then sit and read. When an invoice is due, they send one short message from inside the real conversation: "our bank details have changed, please pay this account". No malware, no admin rights, and the request arrives at exactly the right time from the right person. The FBI's Internet Crime Complaint Center has for years reported business email compromise among the most costly crimes reported to it.
Spam filters and email authentication help at the edges. SPF, DKIM and DMARC make it harder to fake your exact domain, but they do nothing against a look-alike domain or a real mailbox in the wrong hands. The control that works is a process rule: any change to where money goes is confirmed by calling a number you already had, never one from the message. Add a second approver and a short waiting period for bank detail changes, keep payments inside your own app where you can, and alert on new mailbox rules that forward mail to outside addresses.
Build it
Set up a credential-stuffing alarm for the Partner app login and a call-back rule for payment changes.
Record every login attempt
You can't detect what you don't log. Store one row per attempt, successful or not, with the account (empty when the username doesn't exist), the IP address, the result and the time. Never store the password that was tried.
SQLCREATE TABLE login_event ( id bigint PRIMARY KEY, account_id int, -- NULL when the username does not exist ip text NOT NULL, ok boolean NOT NULL, -- true = signed in at timestamp NOT NULL ); CREATE INDEX ON login_event (at); -- every detection looks at a time windowWatch the overall success rate
Per-IP rules miss traffic spread over thousands of addresses, so start with the total. Group attempts into 10-minute buckets and compute the share that succeeded.
SQLSELECT date_bin('10 minutes', at, TIMESTAMP '2026-01-01') AS bucket, count(*) AS attempts, round(100.0 * count(*) FILTER (WHERE ok) / count(*), 1) AS success_pct FROM login_event WHERE at >= now() - interval '24 hours' GROUP BY bucket ORDER BY bucket;Outputbucket attempts success_pct 2026-10-18 01:40:00 41 90.2 2026-10-18 01:50:00 38 89.5 2026-10-18 02:00:00 2,950 11.3 <- 70 times the traffic, an eighth of the success rate 2026-10-18 02:10:00 3,120 9.8Find the addresses behind it
Then look per IP address: many distinct accounts, few successes. You will write this query yourself in the Practice section below. Keep the threshold loose at first and tune it against a few weeks of normal traffic; shared addresses such as a store's Wi-Fi can look busy without being hostile.
Decide what the alarm does
Write the response down before the first alert, so nobody has to invent it at 2 am.
Markdown## Alert: Partner app login success rate below 50% for 2 buckets in a row 1. On-call checks the per-IP query for the same window. 2. Turn on the bot check for logins from the flagged addresses (not for everyone). 3. List accounts that signed in successfully from flagged addresses. 4. For those accounts: sign out all sessions, force a password reset, tell the shop owner by SMS and in the app, and watch for bank or phone changes. 5. Open an incident ticket; review thresholds the next working day.Add the call-back rule for money
The cheapest control in this lesson, and the one that stopped the fraud in the example.
Markdown## Rule: changes to where money goes - Bank details for a partner shop or supplier change only after a call to a phone number already on file. Never use a number from the email or message. - A second person approves the change. Payments to new details wait 2 working days. - The old contact gets an automatic notice that the details changed. - Partner app invoices say: "Mangrove never asks you to pay outside this app."
Bring it to your team
Questions to ask the next time security comes up in a planning or design review.
- If someone clicks a phishing link at 6 pm on a Friday, who do they tell, and how fast does someone answer?
- Which accounts can sign in from the internet today without MFA?
- Would we notice if a mailbox started forwarding mail to an outside address?
- When did we last restore a backup, and could an attacker with admin rights delete every copy?
- What happens when someone asks to change where money goes, and who approves it?
- Do we watch the overall login success rate, or only per-account lockouts?
Red flags
- Phishing-test league tables that name the people who clicked.
- Backups on the same network and the same admin accounts as the servers they protect.
- Admins reading email with their admin account.
- Bank details changed on the strength of an email.
- "We have antivirus" as the whole answer to ransomware.
Practice
Find the credential-stuffing addresses
The table login_event(id, account_id, ip, ok, at) holds Partner app login attempts. Between 02:00 (included) and 03:00 (not included) on 2026-10-18, find every IP address that tried at least 5 different accounts and where less than 20% of its attempts succeeded. Return ip, accounts_tried (distinct accounts) and failures (failed attempts). Watch for a busy address that is not an attacker, and for attempts outside the window.
CREATE TABLE login_event (id int PRIMARY KEY, account_id int, ip text, ok boolean, at timestamp); INSERT INTO login_event VALUES (1, 101, '203.0.113.7', false, '2026-10-18 02:01'), (2, 102, '203.0.113.7', false, '2026-10-18 02:02'), (3, 103, '203.0.113.7', false, '2026-10-18 02:03'), (4, 103, '203.0.113.7', false, '2026-10-18 02:04'), (5, 104, '203.0.113.7', true, '2026-10-18 02:05'), (6, 105, '203.0.113.7', false, '2026-10-18 02:06'), (7, 106, '203.0.113.7', false, '2026-10-18 02:07'), (8, 201, '198.51.100.23', false, '2026-10-18 02:10'), (9, 202, '198.51.100.23', false, '2026-10-18 02:11'), (10, 203, '198.51.100.23', false, '2026-10-18 02:12'), (11, 204, '198.51.100.23', false, '2026-10-18 02:13'), (12, 205, '198.51.100.23', false, '2026-10-18 02:14'), (13, 301, '192.0.2.10', true, '2026-10-18 02:20'), (14, 302, '192.0.2.10', true, '2026-10-18 02:21'), (15, 303, '192.0.2.10', true, '2026-10-18 02:22'), (16, 304, '192.0.2.10', true, '2026-10-18 02:23'), (17, 305, '192.0.2.10', true, '2026-10-18 02:24'), (18, 401, '192.0.2.44', false, '2026-10-18 02:30'), (19, 401, '192.0.2.44', false, '2026-10-18 02:31'), (20, 401, '192.0.2.44', true, '2026-10-18 02:32'), (21, 501, '198.51.100.99', false, '2026-10-18 03:10'), (22, 502, '198.51.100.99', false, '2026-10-18 03:11'), (23, 503, '198.51.100.99', false, '2026-10-18 03:12'), (24, 504, '198.51.100.99', false, '2026-10-18 03:13'), (25, 505, '198.51.100.99', false, '2026-10-18 03:14'), (26, 601, '203.0.113.80', false, '2026-10-18 02:40'), (27, 602, '203.0.113.80', false, '2026-10-18 02:41'), (28, 603, '203.0.113.80', false, '2026-10-18 02:42'), (29, 604, '203.0.113.80', false, '2026-10-18 02:43');
-- IPs with 5+ distinct accounts and under 20% success, 02:00 to 03:00 on 2026-10-18
SELECT ip, count(*) AS accounts_tried
FROM login_event
GROUP BY ip;
[{"ip": "203.0.113.7", "accounts_tried": 6, "failures": 6}, {"ip": "198.51.100.23", "accounts_tried": 5, "failures": 5}]
Show a solution
SELECT ip,
count(DISTINCT account_id) AS accounts_tried,
count(*) FILTER (WHERE NOT ok) AS failures
FROM login_event
WHERE at >= '2026-10-18 02:00' AND at < '2026-10-18 03:00'
GROUP BY ip
HAVING count(DISTINCT account_id) >= 5
AND avg(CASE WHEN ok THEN 1.0 ELSE 0 END) < 0.2;203.0.113.7 made 7 attempts on 6 accounts (one account twice), so count(*) would overstate the accounts. 192.0.2.10 tried 5 accounts but every one succeeded: that is a shared address such as a store's Wi-Fi, not an attacker. 198.51.100.99 is outside the window and 203.0.113.80 tried only 4 accounts.
Break the chain in a ransomware timeline
Read this timeline from a Mangrove distribution centre (DC). For each event, name the attack-chain stage and one control that would have stopped or detected it. Then choose the single control you would fund first and say why in two sentences.
- Day 1: a shift supervisor opens an attachment from a "revised delivery schedule" email on the shared DC office PC.
- Day 1: a program from the attachment now starts with the PC and contacts a server abroad every hour.
- Day 3: the attacker finds an IT admin password saved in a script on a shared drive.
- Days 4 to 9: with that password they sign in to the DC warehouse servers and the backup server, and copy supplier contracts out.
- Day 10, Saturday 2 am: backups deleted, warehouse servers encrypted, and a note threatening to publish the contracts.
- Each event gets the right stage: initial access, foothold, privilege, spread, action on objective
- Each control fits its stage (for example, not "backups" for the phishing email)
- You notice the data was copied before the encryption, so backups alone don't solve this incident
- Your first-funded control is justified by how many stages it covers or how early it acts
Show a model answer
1. Initial access Report button + attachment filtering; EDR blocks the program from running
2. Foothold EDR alert on a new autostart program and hourly calls to an unknown server
3. Privilege No passwords in scripts (a secrets vault); separate admin accounts with MFA
4. Spread Segmentation: the office PC cannot reach warehouse or backup servers;
alert on large uploads to unknown destinations
5. Objective Offline or immutable backups, restored in a test this quarterThe contracts were copied out on days 4 to 9, so even a perfect restore leaves the threat to publish them: this is double extortion. I would fund EDR on every DC PC and server first. It acts at stages 1, 2 and 4, gives the team nine days of warning in this timeline, and can isolate the PC with one click. Segmentation is a close second because it would have kept the backup server out of reach.
Check yourself
Mangrove can fund only one new control this quarter. Its biggest worry is an attacker who phishes one store manager and ends up encrypting every store's back-office server. Which choice breaks that chain at the most stages?
The MFA and admin-account change acts at initial access and again at privilege, two links in the chain. A video helps a little at one stage and fades. A head-office firewall doesn't see a phished password used from outside. Insurance pays for the damage after the chain has finished; it breaks no link.
The Mangrove app already locks a customer account after 5 wrong passwords. The security lead says this does nothing against credential stuffing. Why?
Each account sees one guess, the leaked password, so the counter never fills. That is why detection has to look across accounts: distinct accounts per address and the overall success rate. Lockout still matters against brute force on a single account.
After a ransomware attack, Mangrove restores every server from a clean offline backup within a day. The attackers then email: "Pay, or the customer list goes online." What explains why the restore did not end the incident?
The restore worked: the servers are running. The threat is about data the attackers took during the spread and objective stages. Handling it means finding what left, telling affected people and regulators as required, and closing the way out. A backup only answers the availability half.
Flashcards
Key takeaways
- Breaches move through stages: initial access, foothold, privilege, spread, action on objective. Put a control at each, and look hard at the early ones.
- Phishing shows four signs: sender, urgency, link destination, unusual request. Fast, blame-free reports let the team pull every copy and reset passwords in time.
- Credential stuffing hides from per-account lockout. Detect it across accounts: many accounts per address, low success, a falling overall success rate.
- Ransomware is a human-run chain that ends in theft and encryption. MFA, patching, least privilege, segmentation, EDR and tested offline backups each break a link.
- Payment-change fraud needs no malware. A call-back rule on a known number stops it.
Sources and further reading
- Enterprise tactics, MITRE ATT&CK
- Brute Force: Credential Stuffing (T1110.004), MITRE ATT&CK
- Credential Stuffing Prevention Cheat Sheet, OWASP
- StopRansomware, CISA (including the joint Ransomware Guide)
- Known Exploited Vulnerabilities Catalog, CISA
- NIST SP 800-63B, Digital Identity Guidelines: Authentication, NIST
- Data Breach Investigations Report, Verizon, yearly