The idea
Nell looks after production and the computers at Thistledown Press, a small publisher. On one night in October somebody copied its big autumn book, two weeks before it went on sale. The incident is closed, and the publisher asks where exactly they got hacked. Lay out what that night left behind in the order it happened, and find every point where it could have been stopped.
Steps
-
One night, found backwards
Corin, the publisher, asks where Thistledown got hacked. His question expects one place and one moment.
A break-in is rarely one moment. It is a run of stages, each a separate job the intruder has to get done, from looking the target over to taking what they came for. Defenders call that run a kill chain. The chain is the intruder's, and breaking it is the defender's job.
The lab has put the night's evidence back where it was found. Start with Nell's notes on
editorPc, her desk.editorPc:~# cat /home/nell/review/what-we-found.txt
-
Stage 1, reconnaissance: a reader who tried the doors
The oldest trace is not from the night at all. On Sunday 18 October, three days earlier, the outside address
203.0.113.58visited the press's website.Before an intruder touches anything, they look the target over: what it runs, who works there, what is worth taking. This first stage is reconnaissance. On a public website it leaves the same trace as any reader does. The web server writes one line per page asked for, with the visitor's address, the time, the page and a status number:
200for a page served,404for a page that does not exist.Pull that address's lines from the log on
website. Then fetch/team, the page it read twice.website:~# grep '203.0.113.58' /var/log/nginx/access.log editorPc:~# curl -s http://10.0.9.10/team
-
Stage 2, initial access: fourteen wrong, one right
Looking is free. The second stage is the first that needs something to give way: initial access, the moment the intruder is first inside a machine.
websitelets the freelancer who looks after its pages sign in from home over SSH, with the accountwebdesk. Every try is written to/var/log/auth.log:Failed passwordfor a wrong password,Accepted passwordfor the right one.Pull the same address from that log.
website:~# grep '203.0.113.58' /var/log/auth.log
-
Stage 3, foothold: a job nobody scheduled
A guessed password is a fragile way in. Nell changes it, and the intruder is outside again. So the third stage makes the way back in last. The plain name for it is a foothold, and reports also say persistence.
A machine keeps a list of scheduled jobs: programs it starts by itself at set times. On
websiteeach account's jobs are in a file named after the account, in the folder/etc/crontabs.List that folder with full dates. Then read the job, and the file the job starts. Nothing here can run: the investigators kept the real file, and the lab left a note in its place.
website:~# ls -l --full-time /etc/crontabs website:~# cat /etc/crontabs/webdesk website:~# cat /var/tmp/.site-refresh
-
Stage 4, privilege escalation: the rule that allowed everything
So far the intruder is
webdesk, an account for changing web pages. An ordinary account can't read other accounts' files or change the machine itself. The administrator account,root, can do all of it. Getting from the first to the second is the fourth stage, privilege escalation.On this machine a program named
sudolets an account run one command as the administrator, if a rule allows it.sudowrites each use to the sign-in log, and its rules are files in/etc/sudoers.d.Pull the
sudolines from the log. Then read the rule forwebdesk.website:~# grep 'sudo' /var/log/auth.log website:~# cat /etc/sudoers.d/webdesk
-
Stage 5, lateral movement: one password, two machines
The book was never on
website. The manuscripts are onbookServer, which can't be reached from the internet at all. So the intruder had to go from a machine it held to the machine it wanted. That sideways step is the fifth stage, lateral movement.bookServerkeeps the same kind of sign-in log. Staff sign in from their desks: Nell from10.0.9.30, Corin from10.0.9.31and Tamar from10.0.9.32.Pull every sign-in that worked, and read where each one came from.
bookServer:~# grep 'Accepted' /var/log/auth.log
-
Stage 6, objective: 412 MB at three in the morning
Five stages in, nothing has been taken. The last stage is the reason for the others, the objective: here, a copy of a book that is not out yet.
Two machines saw it.
bookServerhas its file log switched on: it wrote down every folder the session listed (opendir), every file it opened (open), and at eachclosehow many bytes were read.officeRouterkeeps a line for each call from the office to the outside: who called whom, and how much was sent.Read the 02:00 hour of that night on
bookServer. Then read the router's list.bookServer:~# grep 'Oct 21 02' /var/log/auth.log officeRouter:~# cat /var/log/connections.log
Run these steps on real machines
Keep reading
- Lockheed Martin: Gaining the Advantage, the short guide to the original seven steps, with what a defender can do at each article
- Microsoft: what the cyber kill chain is, stage by stage, and where the model falls short article
- CrowdStrike: the kill chain's phases in plain words, and why intruders skip or combine them article
- Paul Pols: the Unified Kill Chain, a longer list of stages that covers what happens after the way in article