The first hour of a forensic investigation
Preserve first, analyse later, write everything down
A beginner guide to digital forensics and incident response (DFIR): what the field is, why you preserve before you touch, the order of volatility, forensic images and hashes, chain of custody, timelines, documentation, and when to ask for help.
beginner level, 16 minutes, 18 slides.
The first hour of a forensic investigation
Welcome. A beginner guide to digital forensics and incident response (DFIR): what the field is, why you preserve before you touch, the order of volatility, forensic images and hashes, chain of custody, timelines, documentation, and when to ask for help. This talk runs about 16 minutes.
Do no harm to the evidence
NIST SP 800-86 gives practical guidance on performing computer and network forensics, and presents forensics from an IT view, not a law enforcement view.
Imagine arriving at a scene where something has gone wrong and everything you touch might change the story. That is the first hour of a digital investigation. NIST's guide to forensics in incident response is meant to help organisations investigate security incidents and troubleshoot operational problems, and it says plainly that it presents forensics from an IT point of view, not a law enforcement one. In this talk we cover the habits that protect evidence in that first hour. You do not need special tools to understand them, only discipline.
What DFIR means
DFIR stands for digital forensics and incident response. Incident response deals with the attack as it happens. Forensics finds out what happened, from evidence. Our own plain definitions.
The four phases of the forensic process in NIST SP 800-86.
- Collection: Identify, label, record, collect; preserve integrity
- Examination: Extract relevant information, protect integrity
- Analysis: Answer the questions that started it
- Reporting: Present results and recommend improvements
DFIR combines two jobs. Incident response is dealing with an attack as it unfolds. Forensics is working out what happened, using evidence. NIST describes the forensic process in four phases. In collection, data is identified, labelled, recorded and collected, and its integrity is preserved. In examination, tools pull out the relevant information while still protecting integrity. Analysis turns that into answers to the questions that started the work. Reporting presents the results and recommends improvements. Notice that the first phase is about collecting safely, not about clever analysis. That is where this hour lives.
Preserve before you touch
- Minimise changes to the data as you collect it, including file and directory access times.
- Collection first, analysis later.
- Do not shut down until you have completed evidence collection.
- Do not trust the programs on the system; run your tools from protected media.
- Do not run programs that modify the access time of all files, such as tar or xcopy.
RFC 3227 principle: When confronted with a choice between collection and analysis you should do collection first and analysis later.
The golden rule is preserve before you touch. RFC 3227, an internet best-practice document on evidence collection, says to minimise changes to the data, including something as small as file access times. It says do collection first and analysis later, and do not shut the machine down until collection is finished, because much evidence may be lost. It also warns not to trust the programs on the system and not to run tools like tar that change the access time of every file. Think of walking through a muddy crime scene in clean overshoes: every footprint you add makes the story harder to read.
Order of volatility
Volatile means it disappears quickly, for example when power is lost. Collect the most volatile evidence first. This is RFC 3227's example order for a typical system.
- Registers, cache. Gone in an instant
- Routing table, ARP cache, process table, kernel statistics, memory. Changes constantly
- Temporary file systems. Often cleared on restart
- Disk. Persists, but can still be changed
- Remote logging and monitoring data. Relevant to the system in question
- Physical configuration, network topology. Slow to change
- Archival media. Least volatile
Try it: 10-minute drill: pick the evidence collection order on a live box
Some evidence vanishes in seconds, other evidence sits quietly for years. The order of volatility says to proceed from the volatile to the less volatile. RFC 3227 gives this example order: registers and cache first, then things like the routing table, process table and memory, then temporary file systems, then disk, then remote logging data, then physical configuration and network topology, and finally archival media. Picture melting ice cream next to a frozen pizza: you rescue the ice cream first. Memory is the ice cream. Try the drill in the lab to practise choosing the order.
Ask before you collect
Decide first
- Is evidence needed for legal or disciplinary use? Analyst or management decides, with policy and legal advisors
- Do you have the backing of your company's established procedures?
- Is there a real incident to justify looking?
Respect privacy
- Follow your company's and jurisdiction's privacy rules
- Do not collect from areas you normally have no reason to access, such as personal file stores, without sufficient indication of a real incident
- Keep collected data from anyone who would not normally see it
Not legal advice: NIST says SP 800-86 is not to be construed as legal advice. If law may be involved, involve the people who handle it.
Before you collect anything, stop and ask whether you are allowed to. NIST says that before data is collected, the analyst or management, following company policy and legal advisors, should decide whether evidence must be preserved for legal or internal disciplinary use. RFC 3227 adds privacy duties: respect your company's rules and local law, do not collect from areas like personal file stores without sufficient indication of a real incident, and make sure you have the backing of established procedures. The NIST guide itself says it is not legal advice. Doing it properly protects both the case and the people involved.
Collection steps in the RFC
- Where is the evidence?. List the systems involved and where evidence will be collected.
- What is relevant?. When in doubt, err on the side of collecting too much rather than not enough.
- Remove external avenues for change. Be careful: disconnecting from the network may trigger deadman switches that wipe evidence.
- Collect in volatility order. Use tools prepared in advance, run from protected media.
- Record clock drift. Note how far the system's clock is from the correct time.
- Document each step. Include the people involved, what they observed, and how they reacted.
Define: deadman switch: A mechanism that triggers an action, here wiping evidence, when it detects something has gone offline.
Here are the RFC's collection steps, condensed. Work out where the evidence is. Decide what is likely to be relevant, and when in doubt collect too much rather than too little. Remove external avenues for change, but note the warning: simply unplugging from the network may trigger deadman switches, which detect that a machine is offline and wipe evidence. Collect in volatility order with trusted tools. Record how far the clock has drifted. And document each step, including who was there and what they observed. Notice how many steps are about writing things down, not typing commands.
Forensic images and write blockers
Image and keep the original
- Make a bit-level copy of the system's media
- Label the original media and store it securely as evidence
- NIST: a bit stream image generates a bit-for-bit copy, so it can preserve file times
Work only on copies
- RFC 3227: make a bit-level copy of your evidence copy for analysis
- Your analysis will almost certainly alter file access times
- A write-blocker prevents a computer from writing to storage media connected to it
Own analogy: The original is the sealed master recording. You only ever play copies.
A forensic image is a bit-for-bit copy of a disk, including free space and slack space. NIST says that if evidence may be needed for prosecution or disciplinary action, take a bit stream image, label the original, store it securely, and do all later analysis on the copy. RFC 3227 goes one step further: make a copy of your evidence copy for analysis, because analysis will almost certainly change file access times. A write-blocker, NIST explains, is a tool that prevents a computer from writing to media connected to it. Think of the original as the sealed master recording, and play only copies.
Hashes prove the copy matches
NIST describes a message digest as a hash that uniquely identifies data, and has the property that changing a single bit in the data will cause a completely different message digest. Compare the digest of the original and the copy to check they are the same.
Record a digest of an image, then verify it later. File names are examples.
sha256sum case-2026-001-disk.img > case-2026-001-disk.img.sha256
sha256sum -c case-2026-001-disk.img.sha256- RFC 3227: consider generating checksums and cryptographically signing collected evidence, without altering it.
- The 2006 NIST guide names MD5 and SHA-1 as the most commonly used then; SHA-256 here is our own choice for a modern example.
A hash, which NIST calls a message digest, is a fingerprint of data. Change a single bit and you get a completely different fingerprint. So you record the fingerprint of the original, make the copy, compute the fingerprint of the copy, and compare. If they match, the copy is exact. The command on screen records a digest and later checks it. RFC 3227 suggests generating checksums and signing evidence, as long as you do not alter it. The older NIST guide mentions MD5 and SHA-1, while the example here uses SHA-256, our own modern choice.
Chain of custody
| Record for each item | Example entry |
|---|---|
| Where, when and by whom it was discovered and collected | Server room B, 09:12, A. Analyst |
| Where, when and by whom it was handled or examined | Lab workstation 3, 11:40, B. Examiner |
| Who had custody, during what period, and how it was stored | B. Examiner, 11:30 to 17:00, locked cabinet |
| When custody changed, when and how the transfer happened | Handed to C. Manager, 17:00, signed form |
Why it matters: NIST: follow a clearly defined chain of custody to avoid allegations of mishandling or tampering of evidence.
Chain of custody is the written story of who held the evidence and what they did with it. RFC 3227 lists four things to document: where, when and by whom the evidence was found and collected; where, when and by whom it was handled or examined; who had custody, for what period, and how it was stored; and when custody changed hands and how. The example entries here are invented. NIST says following a clear chain of custody helps avoid allegations of mishandling or tampering. It is like a library lending card: every borrower signs, so nobody can say where the book went.
Build a timeline
A timeline puts events from different sources in time order so you can see the story. NIST notes that if you need an accurate timeline of events, file times should be preserved.
| Time (UTC) | Source | Event (invented example) |
|---|---|---|
| 09:02:10 | Web server log | Request from 203.0.113.50 to /login |
| 09:02:44 | Auth log | Successful login for user demo |
| 09:05:31 | Proxy log | Download from files.example.com |
| 09:06:02 | Endpoint | New file written to the Downloads folder |
- Write times in one time zone, and record clock drift (RFC 3227).
- Tools exist that generate forensic timelines from event data (NIST).
Try it: Work an intrusion timeline like a team: import, search, tag and tell the story in Timesketch
A timeline lays events from several sources side by side in time order. A web server log, an authentication log, a proxy log and an endpoint record each know a piece of the story, and only together do they make sense. NIST notes that if you need an accurate timeline, file times should be preserved, which is another reason imaging beats casual copying. RFC 3227 tells you to record clock drift, so write all times in one time zone, such as UTC, and note any offset. The rows shown are invented. Notice how the story emerges within four minutes of ordinary-looking lines.
Write it down as you go
Record while working
- Each step you took, and when
- Who was present and what they observed
- Commands run and tools used
- The extent of clock drift
Keep apart in the report
- What you did
- What you saw
- What you think it means, with alternative explanations
- What you recommend improving
Where this comes from: RFC 3227: document each step, and make notes of who was there. NIST: carefully document findings and all steps taken; reporting may recommend improvements to policies, procedures and tools.
If it was not written down, it did not happen, at least as far as anyone reading your report is concerned. RFC 3227 says to document each step and to note who was there, what they were doing, what they observed and how they reacted. NIST says analysts should carefully document findings and all steps taken, and that the reporting phase can include recommendations to improve policies, procedures and tools. A good habit, which is our own advice, is to keep what you did, what you saw, and what you think apart. That lets a reader trust the facts even if they question your conclusions.
When to call for help
| Situation | Who to involve |
|---|---|
| Evidence might be used in legal or disciplinary action | Management and legal advisors, as NIST says to decide before collecting |
| You would need to look in personal areas or collect data you normally would not access | Whoever owns your company's procedures and privacy rules |
| You are not sure how to preserve something without changing it | A more experienced responder, before you touch it |
| The incident is spreading or affects many systems | Your incident response lead |
Stopping is allowed: Pausing to ask is not a failure. Guessing on the only copy of the evidence can be.
Knowing when to stop and ask is part of the skill. If evidence may be used in legal or disciplinary action, NIST says the analyst or management, with legal advisors, should decide before collection begins. If you would need to look in personal areas, RFC 3227 says you need real indication of an incident and the backing of company procedures. The last two rows are our own suggestions: ask a more experienced responder when you are unsure how to preserve something, and tell your incident lead when the problem is spreading. Pausing costs minutes. Guessing on the only copy can cost the whole case.
A sample first hour
- Minutes 0 to 10: stabilise and ask. Note the time, who found it, what was seen. Confirm you are authorised to collect. Stop other people from touching the system.
- Minutes 10 to 30: volatile first. Capture volatile data in order, using trusted tools from protected media. Record every command.
- Minutes 30 to 45: image and hash. Make a bit-level copy of the disk, hash original and copy, and label the original.
- Minutes 45 to 60: seal and hand over. Store the original securely, start the chain of custody form, and brief your lead.
Our own plan: These time slices are an illustration to practise with, not a standard. Your procedures and system will decide.
Let us tie it together with a sample hour. This plan is our own illustration, not a standard. In the first ten minutes, stabilise: note the time, who found it and what was seen, confirm you are authorised, and keep others away from the system. Next, collect volatile data in order, using trusted tools and recording each command. Then image the disk, hash the original and the copy, and label the original. In the last stretch, store the original securely, start the chain of custody form and brief your lead. Practise it, because procedures should be tested before a crisis.
Check your understanding
Check yourself: A server may be compromised. What should you do about shutting it down?
Answer: Do not shut down until evidence collection is complete. RFC 3227 says not to shut down until you have completed evidence collection, because much evidence may be lost.
Check yourself: Which should you collect first?
Answer: Memory and process table. RFC 3227's example order of volatility puts memory, the process table and similar data before temporary file systems, disk and archival media.
Check yourself: What does a matching hash of the original and the copy tell you?
Answer: The copy is an exact match of the original. NIST describes comparing message digests of original and copied data to make sure they are the same. It says nothing about malware or admissibility.
Three questions. Pause the video and answer before revealing. The first is about shutting down a suspect machine, the second about the order of volatility, and the third about what a hash comparison proves. Watch out for answers that sound sensible but destroy evidence, such as rebooting to clear things up. If any answer surprised you, go back to that slide. Then move on to the labs, where you practise choosing the collection order, keeping a hash-sealed log and building timelines, all on safe practice data.
Recap
- Preserve before you touch; collection first, analysis later.
- Collect from the most volatile to the least volatile.
- Image the media, hash it, and analyse only copies.
- Keep a chain of custody and document every step.
- Build timelines in one time zone and note clock drift.
- Ask management and legal advisors when evidence may be used formally.
NIST SP 800-61 Rev. 3 seeks to help organisations incorporate incident response recommendations throughout their cybersecurity risk management activities.
To recap the first hour. Preserve before you touch, and collect before you analyse. Collect from the most volatile data to the least. Make a bit-level image, hash it, and work only on copies. Keep a chain of custody and document every step, including the people. Put events on a timeline in a single time zone and note clock drift. And ask management and legal advisors when evidence may be used formally. Forensics sits inside the wider incident response work described in NIST SP 800-61 Revision 3. Now go and practise in the labs.
Practise this
- 10-minute drill: pick the evidence collection order on a live box
- Keep a timestamped, hash-sealed investigation log with tmux and script (and see what bash history quietly loses)
- Work an intrusion timeline like a team: import, search, tag and tell the story in Timesketch
- Triage a Plaso super-timeline in pandas and find the ten minutes that matter (Part 2)
Slides only get you so far. Pick one of these hands-on labs and do it today while it is fresh. Every lab is free.
Sources
- NIST SP 800-86, Guide to Integrating Forensic Techniques into Incident Response
- NIST SP 800-86 (full text, PDF)
- RFC 3227, Guidelines for Evidence Collection and Archiving
- NIST SP 800-61 Rev. 3, Incident Response Recommendations and Considerations
Every claim in this deck came from these pages, fetched and checked for this release. Read the originals.
Hands-on labs for this deck
- 10-minute drill: pick the evidence collection order on a live box
- Keep a timestamped, hash-sealed investigation log with tmux and script (and see what bash history quietly loses)
- Work an intrusion timeline like a team: import, search, tag and tell the story in Timesketch
- Triage a Plaso super-timeline in pandas and find the ten minutes that matter (Part 2)
Open the interactive deck or see all slide decks.
Related
- 10-minute drill: pick the evidence collection order on a live box
- Keep a timestamped, hash-sealed investigation log with tmux and script (and see what bash history quietly loses)
- Work an intrusion timeline like a team: import, search, tag and tell the story in Timesketch
- Triage a Plaso super-timeline in pandas and find the ten minutes that matter (Part 2)
- All slide decks
- Free cyber labs