Digital
Forensics
A complete practitioner's guide — from legal foundations and forensic methodology through memory, network, disk, mobile, and cloud forensics. Fifteen chapters covering the full discipline.
What Is Digital Forensics?
The discipline defined, its four goals, major branches, and why methodology matters as much as tooling
Digital forensics is the application of scientific methodology to the identification, preservation, analysis, and presentation of digital evidence. It sits at the intersection of computer science, law, and investigative practice — and the rigour it demands from all three domains simultaneously is what makes it one of the most technically and intellectually demanding specialisations in security.
The discipline emerged in the late 1980s and early 1990s as law enforcement began encountering computers as both tools of crime and repositories of evidence. Early digital forensics was largely ad hoc — investigators with computer knowledge doing their best without standardised methodology or dedicated tooling. The first significant legal recognition of digital evidence came through cases in the early 1990s, and the field has since matured into a recognised profession with certifications, standards bodies, peer-reviewed research, and expert witness protocols.
Digital forensics is the process of identifying, preserving, analysing, and presenting digital evidence in a manner that is legally admissible and scientifically reproducible, in support of criminal investigations, civil litigation, corporate investigations, or incident response.
The Four Goals
Every digital forensic investigation, regardless of context or complexity, pursues four sequential goals:
- Identify — locate and recognise potential evidence. This requires knowing where evidence might exist across different storage media, operating systems, applications, and network infrastructure. Identifying evidence that hasn't yet been collected is as important as analysing what you have.
- Preserve — protect evidence from alteration or destruction. Forensic soundness — the property of evidence that allows it to be verified as unmodified — is established during preservation. This is where write blockers, cryptographic hashing, and chain of custody documentation enter the process.
- Analyse — examine preserved evidence to reconstruct events, identify artefacts, attribute actions to individuals, and answer the questions driving the investigation. Analysis requires both technical knowledge and analytical discipline — the ability to reason from evidence rather than starting with a conclusion.
- Present — communicate findings clearly and accurately to an appropriate audience. In legal proceedings this means expert testimony. In corporate investigations it means a written report. In an IR context it may mean a verbal briefing to the CISO. Findings that cannot be communicated effectively are findings that cannot drive decisions.
Forensics vs Incident Response
Digital forensics and incident response are closely related but distinct disciplines. They are often performed by overlapping teams — particularly in smaller organisations — but they have different primary objectives that sometimes create tension.
Incident response is operationally focused. Its primary goal is containing damage, eradicating the threat, and restoring normal operations as quickly as possible. Evidence preservation is important to IR, but it is one consideration among many — speed of containment often takes precedence.
Digital forensics is investigatively focused. Its primary goal is establishing what happened, how, and by whom — with a standard of rigour sufficient for legal proceedings. It operates under more stringent evidence handling requirements and moves more deliberately than operational IR.
In practice, the initial response to a major incident is IR-led (contain, eradicate, recover) while forensics runs in parallel or follows immediately after (preserve, analyse, present). The key handoff point is evidence preservation — the IR team must not destroy forensic evidence in the process of containing the incident, which requires forensic awareness even in the operational response phase.
Branches of the Discipline
Digital forensics encompasses several distinct sub-disciplines, each with its own tooling, methodology, and specialist knowledge requirements:
- Disk / File System Forensics — examination of storage media: hard drives, SSDs, USB devices, optical media. Analysis of file systems (NTFS, ext4, APFS, FAT32), deleted file recovery, metadata analysis, timeline reconstruction.
- Memory Forensics — acquisition and analysis of volatile memory (RAM). Captures running processes, network connections, encryption keys, injected code, and credential material that exists nowhere on disk.
- Network Forensics — analysis of network traffic captures and logs. Reconstructs communications, identifies attack vectors, traces lateral movement, and can recover transmitted files and credentials.
- Mobile Device Forensics — extraction and analysis of evidence from smartphones and tablets. Encompasses iOS, Android, and legacy platforms; includes app data, location history, communications, and cloud account artefacts.
- Cloud Forensics — investigation of incidents involving cloud infrastructure. Navigates shared responsibility model constraints, cloud-native logging, and cross-jurisdiction evidence issues.
- Malware Forensics — analysis of malicious software. Combines static analysis (examining code without executing it) with dynamic analysis (observing behaviour in a controlled environment) to understand malware capabilities and origins.
- Database Forensics — investigation of database systems for evidence of data theft, modification, or destruction. Specialised and less commonly encountered outside financial crime and insider threat cases.
Admissibility Standards
Digital forensic evidence is only as valuable as its admissibility in the proceedings where it is used. Two competing legal standards govern the admissibility of expert testimony in US federal courts:
The Frye Standard (from Frye v. United States, 1923) holds that scientific evidence is admissible if the methodology used is generally accepted within the relevant scientific community. It is a community-consensus test.
The Daubert Standard (from Daubert v. Merrell Dow Pharmaceuticals, 1993) is the current federal standard and has been adopted by most US states. It gives judges a gatekeeper role and requires that expert testimony be based on: sufficient facts or data, reliable methodology, the methodology having been tested and subjected to peer review, a known or potential error rate, and general acceptance in the relevant scientific community. Daubert is stricter than Frye and places greater demands on expert witnesses to demonstrate the scientific rigour of their methods.
In the UK, the Criminal Procedure Rules and the ACPO (Association of Chief Police Officers) Principles — now superseded by the Digital Forensics Working Group guidelines — govern digital forensic practice. The four ACPO principles remain the most cited framework for UK practitioners: no action taken by law enforcement should change data held on a computer or storage media; a competent person must be able to explain the process used; an audit trail must be created; and the Investigating Officer is responsible for ensuring the law and these principles are adhered to.
Why Methodology Matters More Than Tools
A recurring mistake in early-career forensic analysts is tool-centrism — the belief that having the right software is the primary determinant of a good investigation. Tools change. EnCase was the industry standard; then FTK; now Autopsy, Magnet AXIOM, and X-Ways all have significant market share, and Volatility has become essential for memory work that didn't exist as a discipline a decade ago. An analyst whose skills are tied to a specific tool is perpetually behind.
Methodology — the systematic, documented, reproducible approach to evidence handling and analysis — is what gives forensic findings their legal and investigative value. A finding reached by impeccable methodology using open-source tools will survive courtroom scrutiny. A finding reached by sloppy methodology using the most expensive commercial platform on the market will not.
Digital forensic findings must be reproducible. Another qualified examiner, given the same evidence and the same methodology, must be able to reach the same conclusions. If a finding depends on a specific tool's quirk, an undocumented step, or the analyst's intuition, it is not forensically sound.
- Digital forensics pursues four goals in sequence: Identify, Preserve, Analyse, Present — skipping or rushing any phase compromises the investigation
- Forensics is investigatively focused; IR is operationally focused — both disciplines need forensic awareness during active incidents
- The major branches (disk, memory, network, mobile, cloud, malware) each require distinct tooling and specialist knowledge
- US federal courts use the Daubert Standard — forensic methodology must be testable, peer-reviewed, and have a known error rate
- Methodology is more durable and more important than tool proficiency — reproducibility is the standard by which forensic findings are judged
Legal & Ethical Foundations
Chain of custody, search and seizure law, authorisation, privacy, expert witness standards, and forensic ethics
Digital forensics is a legally-embedded discipline. Every decision a forensic examiner makes — what to collect, how to collect it, what to document, what to disclose — has potential legal consequences. An examiner who is technically brilliant but legally naive will produce findings that collapse under challenge, expose their organisation to liability, or — in criminal cases — result in evidence being excluded and investigations failing. This chapter provides the legal and ethical grounding that every forensic practitioner needs before touching evidence.
Chain of Custody in Depth
Chain of custody is the continuous, documented record of who had possession of evidence, when, and what they did with it. It is not a formality — it is the mechanism by which courts determine whether evidence is reliable.
A chain of custody failure occurs when there is a gap in the record: a period during which we cannot account for where the evidence was or who had access to it. Opposing counsel will argue that the gap represents an opportunity for tampering. Courts may exclude the evidence. Even if exclusion is not ordered, the gap will be used to undermine the weight of the evidence in the minds of a jury or judge.
A complete chain of custody record for digital evidence includes:
- Unique evidence identifier (number or label) assigned at the point of collection
- Description: device type, make/model, serial number, storage capacity, physical condition
- Date, time, and location of collection
- Name, role, and signature of the collecting examiner
- Hash values (MD5 and SHA-256 minimum) of any forensic images taken
- Storage location after collection — evidence bag number, locker location, or encrypted cloud storage with access logging
- Every subsequent transfer: receiving party, date/time, purpose, and signature
- Every access: who accessed it, when, for what purpose, and for how long
Unwitnessed collection — a single examiner collects evidence with no witness present. Standard practice requires two people at collection or video documentation.
Gap between collection and logging — evidence is collected and then not formally logged for several hours. The gap is exploitable.
Shared storage without access logging — forensic images stored in a shared folder with no log of who accessed them.
Working on the original — analysing the original device or image rather than a verified copy. Any modification to the original, even by forensic tools, breaks custody integrity.
Search and Seizure Law
The Fourth Amendment to the US Constitution protects individuals against unreasonable searches and seizures by government actors. For law enforcement digital forensics, this means a valid warrant is generally required to search digital devices — including content stored in the cloud. The key cases shaping digital search and seizure law:
- Riley v. California (2014) — Supreme Court held unanimously that police cannot search the digital contents of a cell phone during an arrest without a warrant. Established that the digital privacy interest in a smartphone is categorically different from physical items incident to arrest.
- Carpenter v. United States (2018) — Supreme Court held that accessing historical cell-site location information from a carrier without a warrant violates the Fourth Amendment. Extended Fourth Amendment protection to some third-party data.
- United States v. Warshak (2010) — Sixth Circuit held that email stored on a third-party server is protected by the Fourth Amendment. Influential in shaping how warrants for cloud content are obtained.
For corporate investigators — non-law-enforcement — the Fourth Amendment does not apply directly (it constrains government actors, not private parties). However, authorisation requirements still apply: investigators must have a legitimate legal basis for their investigation, typically derived from employment agreements, acceptable use policies, and HR/legal authorisation.
Authorisation Requirements
Before any forensic examination begins, the examiner must have clear, documented authorisation. The form of that authorisation depends on the context:
| Context | Required Authorisation | Key Considerations |
|---|---|---|
| Law enforcement criminal investigation | Search warrant signed by a magistrate or judge | Scope of warrant limits what can be searched — overbroad analysis of unrelated content is a Fourth Amendment violation |
| Corporate internal investigation | Written authorisation from senior management, HR, and legal counsel | Acceptable use policy must put employees on notice that devices may be monitored; BYOD devices may retain personal data requiring different handling |
| Civil litigation — e-discovery | Court order, litigation hold notice, or consent | Governed by FRCP Rules 26 and 34; proportionality principle applies |
| Consent-based examination | Written consent from the device owner | Consent must be voluntary and informed; can be withdrawn; scope must be defined |
Privacy Considerations
Digital devices — particularly personal smartphones and laptops — contain extraordinarily intimate records of a person's life: medical information, financial records, communications with attorneys, mental health data, religious practices, and sexual behaviour. Forensic examiners routinely encounter this material as a byproduct of examining devices for specific evidence. The ethical obligation to handle it appropriately is significant.
Scope limitation is the primary mechanism: forensic analysis should be limited to the evidence specified in the authorisation. An investigator authorised to examine financial records on a corporate laptop should not be reading personal medical files on the same device — even if they are technically visible during the examination.
GDPR implications for EU-based investigations: personal data collected during a forensic investigation is still subject to GDPR. Processing must have a lawful basis (typically Article 6(1)(f) — legitimate interests — or Article 9 for special category data). Data minimisation applies — collect only what is necessary for the specific investigative purpose. Retention periods apply — investigation data cannot be held indefinitely.
BYOD complications: when an employee uses a personal device for work, forensic imaging of that device captures both corporate data (the investigative target) and personal data (outside the authorisation scope). Some organisations address this with MDM (Mobile Device Management) that separates corporate containers from personal data; others require employees to consent to full device examination as a condition of BYOD participation. Neither approach eliminates the privacy tension.
Expert Witness Standards
When forensic findings are presented in legal proceedings, the examiner may be called as an expert witness. Expert witnesses occupy a unique position in law — unlike fact witnesses (who can only testify to what they directly observed), expert witnesses are permitted to offer opinions on matters within their expertise. This makes the qualification of the expert, and the reliability of their methodology, subject to judicial scrutiny.
Under Daubert, a forensic expert must be prepared to address:
- Their qualifications — education, training, certifications (EnCE, GCFA, GCFE, CCE), professional experience
- The specific methodology used — which tools, which settings, which procedures
- Whether the methodology has been tested and peer-reviewed
- The known error rate of the methodology and any tools used
- Whether the methodology is generally accepted in the forensic community
Expert witnesses in forensics are frequently challenged on cross-examination about tool reliability, alternative explanations for findings, whether the chain of custody was properly maintained, and whether the examiner maintained objectivity. Preparation for testimony requires anticipating these challenges and being able to address them with technical precision and composure.
Forensic Ethics
The ethical obligations of a forensic examiner are distinct from those of an investigator, lawyer, or IR analyst. The forensic examiner's primary obligation is to the evidence and to the truth — not to the party that retained them.
Objectivity is the central ethical requirement. A forensic examiner hired by the prosecution must follow the evidence wherever it leads — including to exculpatory findings that help the defence. A forensic examiner hired by a corporation must document findings accurately even if they are damaging to the organisation. The moment an examiner begins shaping findings to serve a predetermined conclusion, they have ceased to be a forensic examiner and become an advocate — a role that should be played by lawyers, not scientists.
Scope discipline — remaining within the authorised scope of the examination — protects both the investigation and the examiner. Examining data outside the authorised scope can result in evidence being excluded, in civil liability for privacy violations, and in professional disciplinary action.
- Chain of custody documentation must be continuous — any gap represents an exploitable tampering opportunity in legal proceedings
- Fourth Amendment constraints apply to government actors; corporate investigators must still have proper authorisation documented before examination begins
- BYOD devices present a genuine privacy conflict between corporate investigative needs and personal data — address this in policy before an incident occurs
- Expert witnesses under Daubert must demonstrate testable, peer-reviewed methodology with a known error rate — not just professional experience
- The forensic examiner's primary obligation is to the truth and the evidence — not to the retaining party
Forensic Methodology & Principles
Locard's Exchange Principle, order of volatility, forensic soundness, write protection, hashing, and documentation discipline
Before any evidence is touched, before any tool is launched, before any analysis begins — there must be methodology. The principles covered in this chapter are not bureaucratic formalities. They are the scaffolding that makes forensic findings trustworthy, reproducible, and legally defensible. An examiner who understands these principles deeply will make better decisions under pressure; one who treats them as checkbox compliance will eventually produce work that fails when it matters most.
Locard's Exchange Principle
Edmund Locard, the French criminologist, articulated in the early 20th century what is now known as his Exchange Principle: every contact leaves a trace. In physical forensics, this means a perpetrator leaves evidence at a crime scene and takes evidence away — fibres, fingerprints, DNA. The physical world cannot be touched without mutual exchange.
In digital forensics, the principle applies with equal force but different mechanics. Every action performed on a digital system leaves traces — in logs, in filesystem metadata, in registry keys, in memory. The attacker leaves traces. But so does the forensic examiner.
When a forensic examiner accesses a live system, they modify it: they update access timestamps on files they open; their tools write to disk; their network connections appear in logs. This is unavoidable for live systems — which is precisely why the order of evidence collection matters, why forensically sound acquisition procedures exist, and why examiners must document every action they take on a live system so that their own traces can be distinguished from the attacker's.
A forensic examiner boots a suspect computer using the computer's own operating system to look at files. Every file they open has its Last Accessed timestamp updated. The Registry records the examiner's activity. The page file is modified. The examiner has contaminated the evidence by examining it. This is why forensic examination is always performed on a verified copy — never on the original.
Order of Volatility
Not all evidence persists for the same length of time. The order of volatility governs the sequence in which a forensic examiner should collect evidence — capturing the most ephemeral data first, before it disappears, and working toward more persistent storage.
| Evidence Type | Volatility | Lost When | Collection Method |
|---|---|---|---|
| CPU registers, cache | Highest | Immediately on shutdown | Memory acquisition (best effort) |
| Physical RAM | Very high | On shutdown / sleep / power loss | WinPmem, LiME, DumpIt |
| Running processes, open files | High | On shutdown | Live response commands |
| Network connections, ARP cache | High | When connections drop | netstat, ss, arp -a |
| Filesystem data (allocated) | Medium | When overwritten | Forensic disk imaging |
| Filesystem metadata, deleted files | Medium-low | When overwritten (may survive longer) | Forensic disk imaging |
| Remote logging (SIEM) | Low | When retention period expires | Log export / preservation hold |
| Backup / archive data | Lowest | When backup is overwritten or purged | Legal hold on backup systems |
In practice, the examiner may not be able to collect everything — time, access, and resources constrain what is possible. Knowing the order of volatility allows the examiner to triage intelligently, capturing the most at-risk evidence first and accepting that some lower-priority data may be collected later or not at all.
Forensic Soundness
Forensic soundness is the property of an acquisition process that ensures the evidence collected is a complete and accurate representation of the original, has not been altered by the collection process, and can be verified as such. A forensically sound acquisition has three components:
- Completeness — every bit of the source media is captured, including allocated data, deleted data, unallocated space, and slack space. A simple file copy is not forensically sound because it only captures allocated files.
- Integrity — the acquisition process itself did not modify the source. This is achieved through write protection.
- Verifiability — the examiner can prove the copy is identical to the original through cryptographic hashing.
Write Protection
Write protection is the mechanism that prevents any data from being written to the source media during forensic examination. Without write protection, connecting a suspect drive to a forensic workstation triggers automatic OS activity — drive enumeration, thumbnail generation, Last Accessed timestamp updates — that permanently modifies the evidence.
Hardware write blockers are physical devices that sit between the source drive and the forensic workstation, intercepting any write commands and preventing them from reaching the drive. Major manufacturers include Tableau (now Cellebrite), WiebeTech (now CRU), and UFED. Hardware write blockers are required for legally admissible evidence in most jurisdictions.
Software write blockers are OS-level configurations or tools that prevent writes to a connected device. Windows registry write blocking (HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies\WriteProtect = 1), or the write-blocking functionality in forensic Linux distributions (SIFT Workstation, CAINE), provide software-level protection. Accepted for operational IR but may not satisfy the evidentiary requirements of criminal proceedings.
Cryptographic Hashing and Verification
A cryptographic hash is a fixed-length fingerprint of data — change a single bit in the input and the hash output changes completely. Forensic hashing establishes, with cryptographic certainty, that a forensic copy is identical to the original at the moment of acquisition, and that neither has been modified since.
The standard forensic workflow:
- Hash the source drive before acquisition (source hash)
- Acquire the forensic image
- Hash the forensic image (destination hash)
- Compare source and destination hashes — if they match, the image is verified
- Hash the forensic image again at the start of each analysis session (working hash) — if it matches the destination hash, the working copy has not been modified
Modern forensic formats (E01, AFF4) embed the hash in the image file itself. Any modification to the image will cause a hash mismatch on verification — making tampering immediately detectable.
MD5 (128-bit) — legacy standard. Still widely used in forensics for verification purposes despite being cryptographically broken for collision resistance. Acceptable for proving evidence integrity (collisions require deliberate crafting; accidental hash collisions are astronomically unlikely).
SHA-1 (160-bit) — more secure than MD5; also now deprecated for cryptographic purposes. Still accepted in most forensic contexts.
SHA-256 (256-bit) — current recommended standard. Many modern tools compute SHA-256 as default or alongside MD5.
Best practice: compute both MD5 and SHA-256 for every acquisition. This provides defence in depth against hash collision challenges.
Documentation Discipline
Documentation in digital forensics serves a purpose beyond bureaucratic compliance — it is the audit trail that allows another examiner to reproduce every step of the investigation and reach the same conclusions. Without documentation, findings cannot be verified, challenged, or built upon.
What to document during an examination:
- The physical state and condition of the device at collection (photograph the device and any damage)
- Every command executed on a live system during triage, with timestamp
- Every tool used, version number, and settings applied
- All hash values with the time they were calculated
- Every finding, with the artefact location, tool or method used to identify it, and timestamp
- Any anomalies encountered — unexpected tool behaviour, unreadable sectors, evidence of anti-forensics
- Time and date of each work session
The forensic copy (the write-blocked image) is the evidence. The working copy is what the examiner actually analyses. These must be kept distinct — the working copy can be restored from the forensic copy if contaminated; the forensic copy must remain unmodified.
- Locard's Exchange Principle applies to digital forensics — the examiner leaves traces too; documentation allows your traces to be distinguished from the attacker's
- Collect in order of volatility — RAM and live system state first, disk second, archived data last
- Forensic soundness requires completeness (all data captured), integrity (source unmodified), and verifiability (hash-confirmed)
- Hardware write blockers are required for legally admissible evidence; software write blockers are acceptable for operational IR
- Compute both MD5 and SHA-256 for every acquisition; re-verify at the start of each analysis session
Windows Forensics I: The Filesystem
NTFS internals, MFT, timestamps, deleted file recovery, Alternate Data Streams, slack space, and the Registry
Windows is the operating system most commonly encountered in enterprise forensic investigations, and NTFS is its native filesystem. A thorough understanding of NTFS internals — how it stores data, what metadata it records, and where evidence persists even after deletion — is foundational to Windows forensic analysis. This chapter covers the filesystem structures that matter most for investigations, followed by the Windows Registry as a rich source of user activity and system configuration evidence.
NTFS Architecture Overview
NTFS (New Technology File System) was introduced with Windows NT and has been the default Windows filesystem since Windows XP. Its core design principles — journaling for reliability, per-file security descriptors, support for large volumes and files, and extensive metadata — make it one of the most forensically rich filesystems in common use.
Every NTFS volume begins with the Volume Boot Record (VBR), which contains the NTFS BPB (BIOS Parameter Block) — parameters describing the volume geometry. The first system file, $MFT, is the Master File Table.
The Master File Table ($MFT)
The MFT is the heart of NTFS. Every file and directory on an NTFS volume — including system files — has a corresponding record in the MFT. Each MFT record is 1024 bytes by default and contains attributes that describe the file: its name, timestamps, security descriptor, data location, and the data itself (for very small files, data is stored directly in the MFT record — called resident data).
Key MFT system files:
| File | MFT Record | Description |
|---|---|---|
| $MFT | 0 | The MFT itself — a file that contains all other MFT records |
| $MFTMirr | 1 | Partial mirror of the MFT (first 4 records) for recovery |
| $LogFile | 2 | Journaling file — records filesystem transactions for recovery |
| $Volume | 3 | Volume name, version, flags (dirty bit) |
| $AttrDef | 4 | Attribute type definitions |
| . (root) | 5 | Root directory |
| $Bitmap | 6 | Cluster allocation bitmap — which clusters are in use |
| $Boot | 7 | VBR — volume boot record |
| $UsnJrnl | Variable | Update Sequence Number Journal — change log |
The $UsnJrnl (Update Sequence Number Journal) is forensically critical. It records all file and directory changes on the volume — creation, deletion, rename, attribute modification — with timestamps. Because it retains a rolling history (typically tens of thousands of entries), it often preserves evidence of file operations that occurred before the examiner arrived — including file deletion. Tools like MFTECmd.exe (Eric Zimmerman) parse the UsnJrnl into human-readable output.
NTFS Timestamps — MACB
NTFS records four timestamps for every file, stored in the $STANDARD_INFORMATION attribute and, separately, in the $FILE_NAME attribute. These are known by the acronym MACB:
- M — Modified: when the file's data content was last changed
- A — Accessed: when the file was last read (not reliable — Windows disables Last Access updates by default since Vista for performance reasons)
- C — Changed: when the MFT entry itself was last changed (metadata modification — rename, permission change, attribute update)
- B — Born (Created): when the file was created on this volume
The $STANDARD_INFORMATION timestamps are user-accessible and can be modified by programs (including attacker tools — see Chapter 13). The $FILE_NAME timestamps are set by the kernel and are significantly harder to manipulate from user space — making discrepancies between the two a key indicator of timestomping (deliberate timestamp manipulation).
NTFS timestamps are stored in UTC. Many forensic tools display them in local time. When building an investigation timeline, always confirm and document the timezone interpretation of every timestamp source. A 6-hour discrepancy that appears to place an event before business hours may simply be a UTC vs local time confusion.
Deleted File Recovery
When a file is deleted in Windows, the following happens in NTFS:
- The MFT record for the file is marked as not in use (a single bit flip in the record header)
- The clusters occupied by the file's data are marked as available in the
$Bitmap - The file's entry in its parent directory is removed
- The data itself is not overwritten
This means that immediately after deletion, all of the file's data is still physically present on the disk — only the filesystem's bookkeeping has been updated. Recovery is possible until the clusters are overwritten by new data. On an active system, this may happen quickly; on a less active system or a seized device powered off after deletion, recovery may succeed even weeks or months later.
Recovery tools (Autopsy, PhotoRec, FTK, Recuva) recover deleted files by scanning unallocated space for known file signatures — a technique called file carving — and by parsing MFT records marked as not in use, which still contain metadata about the deleted file.
On SSD drives, the TRIM command instructs the drive controller to zero out sectors marked as available by the filesystem — often within seconds of deletion. This dramatically reduces the window for deleted file recovery on modern SSDs and NVMe drives. Chapter 9 covers SSD forensics complications in detail.
Slack Space
NTFS allocates disk space in clusters — the minimum allocation unit, typically 4KB. If a file is 5KB, it occupies two clusters (8KB total), leaving 3KB of allocated but unused space at the end of the second cluster. This wasted space is called file slack.
File slack is divided into two types:
- RAM slack — the space between the end of the file data and the end of the last sector (512 bytes). In older Windows versions, this was filled with RAM contents at the time of writing — a fascinating and occasionally evidence-rich artefact. Modern Windows zeros this space.
- Drive slack — the space between the end of the last sector used and the end of the last allocated cluster. May contain remnants of previously deleted files that once occupied those clusters.
Slack space analysis has produced evidence in numerous cases — fragments of previously existing files recovered from the slack space of a current file. It requires a forensic tool that can access the raw disk image rather than the filesystem layer.
Alternate Data Streams (ADS)
NTFS supports Alternate Data Streams — the ability to attach additional named data streams to any file or directory. The primary data stream (the file content you see in Explorer) is the unnamed stream. ADS are named streams that exist alongside it, invisible to standard directory listings.
ADS are used legitimately by Windows (the Zone.Identifier stream marks files downloaded from the internet — forensically useful for proving provenance) and by some applications. They are also used by malware to hide executable code and data. A file that appears to be a 1KB text document may have a 500KB malicious executable hidden in an ADS.
List ADS on a file: Get-Item -Stream * .\filename.txt
List all ADS in a directory: Get-ChildItem -Recurse | ForEach-Object { Get-Item $_.FullName -Stream * | Where-Object Stream -ne ':$DATA' }
Using Sysinternals Streams: streams.exe -s C:\path\to\investigate
The Zone.Identifier stream on a downloaded file: Get-Content .\downloaded_file.exe -Stream Zone.Identifier
The Windows Registry
The Windows Registry is a hierarchical database that stores configuration information for the operating system, hardware, and applications. From a forensic standpoint, it is one of the richest evidence sources on a Windows system — recording user activity, program execution, hardware connections, network history, and system configuration in ways that users and most malware do not anticipate or fully clean up.
Registry Structure
The Registry is divided into five root keys (hives). The two most forensically valuable are HKEY_LOCAL_MACHINE (HKLM) — system-wide settings — and HKEY_CURRENT_USER (HKCU) — per-user settings. The hive files on disk:
| Hive | File Location | Forensic Value |
|---|---|---|
| SYSTEM | C:\Windows\System32\config\SYSTEM | USB device history, network interfaces, services, timezone |
| SOFTWARE | C:\Windows\System32\config\SOFTWARE | Installed programs, OS version, ShimCache / AppCompatCache |
| SECURITY | C:\Windows\System32\config\SECURITY | Cached credentials, LSA secrets |
| SAM | C:\Windows\System32\config\SAM | Local account hashes (requires SYSTEM key to decrypt) |
| NTUSER.DAT | C:\Users\[username]\NTUSER.DAT | Per-user settings, RecentDocs, UserAssist, MRU lists, typed URLs |
| UsrClass.dat | C:\Users\[username]\AppData\Local\Microsoft\Windows\UsrClass.dat | Shellbags — folder browsing history |
High-Value Forensic Registry Keys
| Artefact | Registry Location | Forensic Value |
|---|---|---|
| UserAssist | NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist | Programs executed via Explorer (ROT-13 encoded names, execution count, last run time) |
| RecentDocs | NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs | Recently opened files, sorted by extension |
| ShimCache / AppCompatCache | SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache | All executables that ran on the system (name, path, last modified time — NOT last execution time) |
| AmCache | C:\Windows\AppCompat\Programs\Amcache.hve | Executable metadata including SHA1 hash, first execution time |
| SRUM | C:\Windows\System32\sru\SRUDB.dat | System Resource Usage Monitor — program execution, network usage, energy consumption going back 30 days |
| Run / RunOnce | HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run | Auto-start programs — persistence mechanism |
| MountedDevices | SYSTEM\MountedDevices | All storage devices ever connected to the system |
| USB History | SYSTEM\CurrentControlSet\Enum\USBSTOR | USB devices ever connected — manufacturer, model, serial number, first/last connected times |
| TypedURLs | NTUSER.DAT\Software\Microsoft\Internet Explorer\TypedURLs | URLs manually typed into Internet Explorer address bar |
| NetworkList | SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList | Networks the system has connected to — SSID, MAC address, first/last connection dates |
- The MFT records metadata for every file — including deleted files whose records are marked "not in use" but not overwritten
- The $UsnJrnl change journal preserves a rolling history of filesystem operations — essential for reconstructing file activity timelines
- MACB timestamps: $STANDARD_INFORMATION is modifiable; $FILE_NAME is kernel-set — discrepancies indicate timestomping
- Slack space may contain fragments of previously existing files; ADS can hide executable content in plain sight
- ShimCache records program presence; AmCache adds first execution time and SHA1 hash; SRUM adds 30-day execution and network usage history
Windows Forensics II: Artefacts & Evidence
Prefetch, LNK files, Shellbags, browser artefacts, Event Log forensics, Volume Shadow Copies, and SRUM
Windows generates a remarkable volume of forensic artefacts in the normal course of operation — records of program execution, file access, user activity, and system events that persist even after users attempt to cover their tracks. This chapter covers the artefacts that experienced Windows forensics practitioners reach for first, along with the interpretation pitfalls that trip up less experienced analysts.
Prefetch Files
The Windows Prefetch service monitors the first 10 seconds of application launch and caches data to speed up subsequent launches. As a side effect, it creates a .pf file in C:\Windows\Prefetch\ for each executable that runs, recording:
- The executable name and path
- Up to 8 timestamps: last run time and (on Windows 8+) the last 8 run times
- Run count
- All files and directories referenced during the first 10 seconds of execution (DLLs loaded, data files opened, temp files created)
Prefetch is enabled by default on workstations and disabled by default on servers (to reduce I/O overhead). Its forensic value is significant: it proves a program executed, when it last ran, how many times it ran, and what files it accessed — even if the executable itself has been deleted.
An attacker deletes mimikatz.exe from a system after use. The prefetch file MIMIKATZ.EXE-XXXXXXXX.pf in C:\Windows\Prefetch\ proves: the tool ran, when it last ran, how many times, and which files it accessed during execution. The prefetch file persists because it is in a different directory than the deleted executable.
Eric Zimmerman's PECmd: PECmd.exe -f "C:\Windows\Prefetch\MIMIKATZ.EXE-XXXXXXXX.pf" --csv output.csv
Parse all prefetch files: PECmd.exe -d "C:\Windows\Prefetch" --csv C:\output\
LNK Files and Jump Lists
Windows automatically creates LNK shortcut files when a user opens a file, even if no shortcut is manually created. These are stored in C:\Users\[user]\AppData\Roaming\Microsoft\Windows\Recent\. Each LNK file records:
- The target file path (original and sometimes network location)
- Target file size at the time of access
- Target file timestamps (modified, accessed, created) at the time of access
- Volume serial number and drive type (removable, fixed, network)
- Machine NetBIOS name where the target resided
LNK files prove a file was accessed even if the file itself is gone. The volume serial number and machine name inside an LNK prove which machine or removable device the file came from — critical for data exfiltration investigations.
Jump Lists are extension of the LNK concept — per-application lists of recently accessed files stored in AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations\ and CustomDestinations\. Each file is named with an application ID (AppID) hash and contains multiple LNK entries. Jump Lists can preserve access records going back much further than the Recent folder, which is typically limited to the most recent files.
Shellbags
Shellbags record Windows Explorer's folder browsing history — every folder a user has opened in Explorer generates a Shellbag entry, which persists in the Registry even after the folder is deleted or the connected device is removed. This makes Shellbags uniquely valuable for proving that a user accessed a specific folder — including folders on external drives and network shares that no longer exist.
Shellbags are stored in UsrClass.dat (for Desktop IE and Windows Explorer 7+) under Local Settings\Software\Microsoft\Windows\Shell\BagMRU and Bags. Eric Zimmerman's ShellBagsExplorer provides a GUI for navigating the Shellbag tree and reconstructing folder browsing timelines.
An employee suspected of copying files to a USB drive denies ever connecting such a device. Shellbags in their UsrClass.dat show Explorer browsed to drive letter E:\ (a removable device) on three specific dates. USB history in the Registry confirms the device serial number. LNK files in the Recent folder prove specific files were opened from E:\. The combination establishes access definitively.
Browser Artefacts
Web browsers record extensive activity that is forensically valuable: history, cached content, downloads, saved credentials, form fill data, and session cookies. The storage format and location varies by browser:
| Browser | Profile Location | Key Forensic Files |
|---|---|---|
| Chrome / Edge (Chromium) | AppData\Local\Google\Chrome\User Data\Default\ | History (SQLite), Web Data (forms), Cookies, Login Data, Downloads |
| Firefox | AppData\Roaming\Mozilla\Firefox\Profiles\[profile]\ | places.sqlite (history+bookmarks), cookies.sqlite, formhistory.sqlite, downloads.sqlite |
| Internet Explorer / Edge Legacy | AppData\Local\Microsoft\Windows\History\ | ESE database, TypedURLs in Registry, cache in Temporary Internet Files |
All Chromium-based browser databases (History, Cookies, Login Data) are SQLite files. Standard SQLite browsers (DB Browser for SQLite, sqlitebrowser) or forensic tools (Magnet AXIOM, Hindsight) can query them directly. Browser artefacts prove web-based file exfiltration (uploads to cloud storage, webmail attachments), research behaviour (reconnaissance of targets), and credential compromise (saved passwords).
Windows Event Log Forensics
Windows Event Logs are one of the highest-value evidence sources in Windows forensics. Stored in C:\Windows\System32\winevt\Logs\ as .evtx files, they record security events, system events, application events, and application-specific logs. Key Event IDs:
| Event ID | Log | Description | Forensic Value |
|---|---|---|---|
| 4624 | Security | Successful account logon | Logon type (2=interactive, 3=network, 10=remote interactive), source IP, account name |
| 4625 | Security | Failed account logon | Brute force detection, credential stuffing |
| 4648 | Security | Logon using explicit credentials | Pass-the-hash, runas, lateral movement |
| 4672 | Security | Special privileges assigned | Privileged logon — SYSTEM, admin |
| 4688 | Security | Process creation | Command-line logging (requires audit policy) — gold standard for process execution evidence |
| 4698 | Security | Scheduled task created | Persistence mechanism detection |
| 4720 | Security | User account created | Attacker-created backdoor accounts |
| 4728/4732/4756 | Security | Member added to privileged group | Privilege escalation |
| 4776 | Security | NTLM credential validation | Lateral movement via NTLM; pass-the-hash |
| 7045 | System | New service installed | Malware persistence via service |
| 4104 | PowerShell/Operational | Script block logging | Full PowerShell script content — requires policy enabling |
| 1102 | Security | Audit log cleared | Anti-forensics — attacker covering tracks |
Volume Shadow Copies
Volume Shadow Copy Service (VSS) creates point-in-time snapshots of NTFS volumes, used by Windows for System Restore, Previous Versions, and backup. These shadow copies can be a forensic goldmine — they may contain Registry hives, event logs, and files from points in time before the attacker arrived or before they deleted evidence.
Attackers know this. Ransomware routinely executes vssadmin delete shadows /all /quiet or equivalent before encrypting files. The presence of this command in process creation logs (Event ID 4688) or in Prefetch is itself strong evidence of malicious intent. Detecting the deletion of shadow copies is a key ransomware indicator.
List all shadow copies: vssadmin list shadows
Mount a shadow copy for examination (as administrator):
mklink /d C:\vss \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\
Or use the Shadow Explorer GUI tool for easy navigation of VSS history.
SRUM — System Resource Usage Monitor
Introduced in Windows 8, SRUM records application and network usage data going back approximately 30 days in C:\Windows\System32\sru\SRUDB.dat — an ESE (Extensible Storage Engine) database. SRUM records include:
- Every application that ran, with total CPU time, memory usage, and I/O byte counts
- Network usage per application — bytes sent and received per network interface
- Energy consumption data
SRUM is particularly valuable for data exfiltration investigations: it records the exact number of bytes sent by each application over each network interface over the past 30 days. Even if the attacker deleted their tools, SRUM may preserve a record that a specific process sent hundreds of megabytes of data to an external IP.
- Prefetch proves execution with timestamps and file references — even if the executable has been deleted
- LNK files and Jump Lists prove file access with timestamps, origin device serial number, and machine name
- Shellbags prove folder browsing history — including folders on deleted external devices — from the Registry
- Event ID 4688 (process creation with command line) is the gold standard for Windows execution evidence — requires specific audit policy
- SRUM records per-application network byte counts for 30 days — proves data exfiltration volumes even without network captures
Linux & Mac Forensics
ext4 internals, Linux log forensics, bash history limitations, Mac APFS, unified logging, Spotlight metadata, and quarantine flags
While Windows dominates enterprise endpoint environments, Linux dominates servers, cloud infrastructure, and DevOps toolchains — and macOS is ubiquitous in creative, technology, and executive roles. Forensic investigations routinely span all three platforms. This chapter covers the key artefacts and methodological differences that apply when moving beyond Windows.
Linux Filesystem Forensics — ext4
The ext4 filesystem (Fourth Extended Filesystem) is the default on most Linux distributions. Its forensic characteristics differ significantly from NTFS:
- Inodes — ext4 uses inodes (index nodes) rather than an MFT. Each inode stores file metadata: permissions, owner, timestamps, and pointers to data blocks. The inode does not store the filename — that is stored in the directory entry that points to the inode. When a file is deleted, the directory entry is removed, but the inode and data blocks may persist until overwritten.
- Three timestamps — Linux traditionally records three timestamps: mtime (data modification), atime (access — may be disabled with
noatimemount option), and ctime (inode change — metadata modification). A fourth, btime (birth/creation time), was added in ext4 but is not exposed by all tools. - Journal — ext4 journals filesystem transactions for crash recovery. The journal may retain recent filesystem operations that can be forensically recovered, similar to the NTFS
$LogFile. - No MFT equivalent — there is no central file describing all other files. Forensic tools must scan inode tables and directory structures to reconstruct the filesystem.
Linux Log Files
Linux centralises logs in /var/log/. The most forensically valuable:
| Log File | Location | Forensic Value |
|---|---|---|
| auth.log / secure | /var/log/auth.log (Debian/Ubuntu), /var/log/secure (RHEL/CentOS) | SSH logins (successful and failed), sudo usage, PAM authentication events, su commands |
| syslog / messages | /var/log/syslog or /var/log/messages | General system events, kernel messages, service starts/stops |
| wtmp / btmp / utmp | /var/log/wtmp (login history), /var/log/btmp (failed logins), /var/run/utmp (currently logged in) | Historical login records with timestamps — query with last and lastb commands |
| kern.log | /var/log/kern.log | Kernel ring buffer — USB device connections, driver messages, kernel errors |
| audit.log | /var/log/audit/audit.log | auditd records — configurable to log file access, syscalls, command execution; extremely high value when configured |
| cron | /var/log/cron or /var/log/syslog | Scheduled task execution — malware persistence via cron leaves records here |
| apache2 / nginx | /var/log/apache2/, /var/log/nginx/ | Web server access and error logs — web shell execution, exploitation attempts |
On systems using systemd (most modern Linux distributions), logs are also stored in the binary journal at /var/log/journal/ and queried with journalctl. The journal correlates log entries from all services with precise timestamps and can be filtered by unit, time range, priority, and user.
Bash History and Its Limitations
The bash shell records commands to ~/.bash_history. Each user has their own history file. This is among the first artefacts investigators check — and among the most frequently manipulated.
Limitations and manipulation techniques investigators must account for:
- History is written on shell exit — commands executed in a session that is killed (rather than exited normally) may not be written to
.bash_history - HISTSIZE and HISTFILESIZE — environment variables that control how many commands are retained. Setting both to 0 disables history entirely.
- HISTFILE — can be set to
/dev/nullto discard all history - Prefixing with a space — commands prefixed with a space are not recorded (when
HISTCONTROL=ignorespaceis set, which is common) - Direct deletion —
history -cclears in-memory history; deleting.bash_historyremoves the file
Despite these limitations, bash history often retains evidence that attackers overlook. Additionally, the absence of history for a period where the system was clearly active is itself a finding. Correlate bash history with auth.log login records to identify periods of activity with no corresponding history.
Linux Persistence Artefacts
Linux persistence mechanisms leave forensic traces across multiple locations. A systematic persistence check during a Linux forensic investigation:
Cron jobs: /etc/crontab, /etc/cron.d/, /etc/cron.{hourly,daily,weekly,monthly}/, crontab -l -u [user] for each user
Systemd services: /etc/systemd/system/, /lib/systemd/system/, systemctl list-units --all
Init scripts: /etc/rc.local, /etc/init.d/, /etc/rc*.d/
Shell profiles: ~/.bashrc, ~/.bash_profile, ~/.profile, /etc/profile, /etc/profile.d/
SSH authorised keys: ~/.ssh/authorized_keys for every user, including root
SUID binaries: find / -perm -4000 -type f 2>/dev/null
LD_PRELOAD hooks: /etc/ld.so.preload
macOS Forensics
macOS presents a distinct forensic environment — built on a BSD Unix foundation but with Apple-specific filesystem, logging, and application frameworks layered on top.
APFS — Apple File System
APFS (Apple File System) replaced HFS+ as the default macOS filesystem in 2017. Key forensic characteristics:
- Clone files — APFS supports instant file cloning (copy-on-write). Cloned files share data blocks until one is modified. This complicates deleted file recovery — a deleted clone may be partially recoverable through its source.
- Snapshots — APFS supports filesystem snapshots. Time Machine backups use APFS snapshots on APFS volumes. These are forensically equivalent to VSS on Windows — historical filesystem states accessible for investigation.
- Encryption — APFS supports per-file and per-volume encryption. FileVault 2 on modern Macs uses APFS encryption. Without the user's login password or a FileVault recovery key, an encrypted APFS volume cannot be examined.
- Timestamps — APFS stores four timestamps: created, modified, changed (metadata), and accessed — similar to ext4.
macOS Unified Logging
Apple replaced the traditional syslog architecture with the Unified Logging System in macOS 10.12 (Sierra). Log data is stored in a compressed binary format at /var/db/diagnostics/ and queried with the log command or Console.app. The unified log captures significantly more system activity than traditional syslog but requires specific query knowledge to use effectively.
Show all log entries from the last hour: log show --last 1h
Filter by process: log show --predicate 'process == "sshd"' --last 24h
Authentication events: log show --predicate 'category == "authentication"' --info
Export for offline analysis: log collect --last 7d --output /tmp/logs.logarchive
Key macOS Forensic Artefacts
| Artefact | Location | Forensic Value |
|---|---|---|
| Quarantine flag (Zone.Identifier equivalent) | Extended attribute com.apple.quarantine on downloaded files | Proves file was downloaded from internet; records source URL and timestamp |
| Spotlight metadata | /.Spotlight-V100/ | Index of file content and metadata — may retain records of deleted files |
| FSEvents | /.fseventsd/ | Filesystem event log — records file and directory create/modify/delete/rename operations |
| Application .plist files | ~/Library/Preferences/ | Per-application settings, recent files, usage history |
| KnowledgeC.db | ~/Library/Application Support/Knowledge/knowledgeC.db | Application usage history (foreground time, device plugs), location data — SQLite |
| bash / zsh history | ~/.bash_history, ~/.zsh_history | Command history — same limitations as Linux |
| Last Visited URLs | Safari History in ~/Library/Safari/History.db | Safari browsing history — SQLite |
- Linux inodes decouple filename from file data — a deleted file's inode and data blocks persist until overwritten; the directory entry is removed immediately
- auth.log and wtmp/btmp provide SSH and sudo evidence; auditd provides configurable syscall-level logging when deployed
- Bash history is unreliable as sole evidence — correlate with auth.log and consider the absence of history during active periods as a finding
- APFS snapshots (Time Machine) provide historical filesystem states equivalent to Windows VSS
- macOS KnowledgeC.db contains application usage history and device connection data — forensically equivalent to Windows SRUM
Memory Forensics
Why RAM matters, acquisition methods, Volatility 3 in depth, process analysis, injection detection, credential extraction, and rootkit detection
Memory forensics is one of the most powerful and technically demanding sub-disciplines in digital forensics. It occupies a unique forensic space: the contents of RAM are invisible to filesystem analysis, disappear on shutdown, and contain categories of evidence — active encryption keys, injected shellcode, credentials in plaintext, and the full process execution state — that no other forensic technique can recover. As malware has increasingly moved toward fileless, memory-resident techniques specifically to evade disk-based detection and forensics, memory analysis has become an essential skill for any serious practitioner.
Why Memory Forensics Matters
Physical RAM contains evidence that exists nowhere else on the system:
- Fileless malware — malware that loads entirely into memory without writing executable files to disk. PowerShell Empire, Cobalt Strike's in-memory payloads, and reflectively loaded DLLs all fall into this category. They leave no disk artefacts for traditional forensics to find.
- Encryption keys — BitLocker volume master keys, TrueCrypt/VeraCrypt keys, and ransomware encryption keys in use are present in RAM while the encrypted volume or process is active. A memory dump taken before shutdown may allow decryption of otherwise inaccessible evidence.
- Credentials in plaintext — Windows caches credentials in LSASS memory for single sign-on purposes. Tools like Mimikatz exploit this to extract plaintext passwords and NTLM hashes. A memory dump taken from a compromised system may reveal all credentials that were cached at the time.
- Network connections — active network connections maintained by running processes — including C2 connections — are visible in memory even if the process has been configured to hide them from standard OS tools.
- Process injection artefacts — injected shellcode, hollowed processes, and reflectively loaded DLLs leave characteristic signatures in memory that Volatility can identify even when they are invisible to the operating system's own process listing tools.
Memory Acquisition
Memory acquisition must be performed on a live system — you cannot image RAM from a powered-off machine (with the extremely rare exception of cold boot attacks, where RAM contents persist briefly at low temperatures after shutdown). This creates a challenge: the act of running acquisition software modifies the memory you are trying to capture.
Windows Memory Acquisition
WinPmem is the most widely used open-source Windows memory acquisition tool. It operates as a kernel driver that maps physical memory to a file. Output formats include AFF4 (compatible with Volatility 3) and raw (dd-compatible).
Acquire to AFF4: winpmem_mini_x64_rc2.exe memory.aff4
Acquire to raw: winpmem_mini_x64_rc2.exe -o memory.raw
The output file should match the installed RAM size. Hash the output immediately after acquisition.
DumpIt provides an extremely simple one-click acquisition — run the binary and it creates a raw memory dump in the same directory. Produces a CSV process listing alongside the dump. Excellent for non-technical responders who need to acquire memory quickly.
Magnet RAM Capture (Magnet Forensics, free) provides a GUI interface and outputs a .mem file. Useful in situations where a GUI is preferred.
The hibernation file (C:\hiberfil.sys) — when Windows hibernates, it writes the full contents of RAM to the hibernation file on disk. This is a compressed memory image that Volatility can analyse directly after decompression. If a system was hibernated during or after an incident, the hiberfil.sys is a ready-made memory image.
VMware and Hyper-V snapshots — virtual machine snapshots include a memory image (.vmem for VMware, checkpoint files for Hyper-V). If the compromised system is a VM and a snapshot exists, this may be the easiest path to memory evidence.
Linux Memory Acquisition — LiME
LiME (Linux Memory Extractor) is a loadable kernel module that acquires physical memory with minimal process footprint. It must be compiled for the specific kernel version of the target system — this compilation should be done on an identical system (same kernel, same distribution) to avoid instability.
Load the module and write to a file: insmod lime-5.15.0-91-generic.ko "path=/tmp/memory.lime format=lime"
Acquire over network (avoids writing to local disk): insmod lime.ko "path=tcp:4444 format=lime" then on analyst workstation: nc [target-ip] 4444 > memory.lime
Pre-compiling LiME modules for your known kernel versions as part of IR preparation saves critical time.
Volatility 3 — The Analysis Framework
Volatility 3 is the current version of the most widely used open-source memory forensics framework. It analyses memory images from Windows, Linux, and macOS using a plugin architecture. The transition from Volatility 2 to 3 brought Python 3 support, improved performance, and a new symbol table system — but the core analytical approach remains the same.
Getting Started
Install: pip3 install volatility3
Run a plugin: python3 vol.py -f memory.raw windows.pslist
Output to CSV: python3 vol.py -f memory.raw windows.pslist > pslist.csv
Specify symbol table (if auto-detection fails): python3 vol.py --symbols /path/to/symbols/ -f memory.raw windows.pslist
Process Analysis
Process analysis is typically the first step in a memory forensics investigation. Volatility provides three complementary process listing plugins, each using a different data structure:
| Plugin | Data Source | Can Miss Hidden Processes? | Best Used For |
|---|---|---|---|
windows.pslist | Active process list (PsActiveProcessHead linked list) | Yes — rootkits can unlink processes from the list | Quick overview; most human-readable output |
windows.psscan | Scans memory for EPROCESS structures (pool tag scanning) | No — finds processes even if unlinked | Rootkit detection; finding hidden/terminated processes |
windows.pstree | Parent-child relationships from EPROCESS structures | Partial | Visualising process hierarchy; identifying anomalous parent-child relationships |
Comparing pslist and psscan output is a classic rootkit detection technique. Processes that appear in psscan but not in pslist have been deliberately hidden from the OS process listing by a rootkit — a strong indicator of malicious activity.
Suspicious Process Indicators
- Unexpected parent processes —
cmd.exeorpowershell.exespawned bywinword.exe,excel.exe, or a web browser indicates code execution from a document or web content - Misspelled or masquerading process names —
svchost.exerunning fromC:\Users\Public\orscvhost.exe,svch0st.exe - svchost.exe without required parent — legitimate
svchost.exealways hasservices.exeas its parent - Single-instance processes with multiple instances —
lsass.exe,smss.exe, andwinlogon.exeshould appear only once in a standard system - Unusual creation times — a process running for 45 days on a system that was rebooted 3 days ago is anomalous
- Unusual process path — any executable running from
%TEMP%,AppData, or the Recycle Bin is suspicious
Network Connections from Memory
python3 vol.py -f memory.raw windows.netscan — shows active and recently closed TCP/UDP connections with owning process, local and remote addresses, state, and timestamps
Look for: connections to unusual external IPs (C2 beacons), connections from web server processes to external IPs (web shell calling out), connections from unusual processes (e.g. notepad.exe with an outbound TCP connection)
Injected Code Detection
Process injection is a technique used by malware and post-exploitation frameworks to execute code within the memory space of a legitimate process — hiding malicious activity behind a trusted process name. Memory forensics can detect injection even when the injected code is invisible to the OS.
malfind
The windows.malfind plugin identifies memory regions that are: executable (PAGE_EXECUTE_READWRITE or similar), not backed by a file on disk (private memory rather than memory-mapped from a legitimate DLL), and contain what appears to be executable code (PE headers or shellcode signatures).
python3 vol.py -f memory.raw windows.malfind
Dump suspicious regions for further analysis: python3 vol.py -f memory.raw windows.malfind --dump
malfind produces false positives — not every flagged region is malicious. Manually review the hex dump of each finding: genuine shellcode or injected PE files will have characteristic byte patterns.
Hollowed Processes
Process hollowing creates a legitimate process (e.g., svchost.exe), unmaps its memory, and replaces it with malicious code. The process appears legitimate in the process listing but is executing attacker code. Detection: compare the process's in-memory image against the on-disk version of the same executable using windows.dlllist and windows.dumpfiles; significant differences indicate hollowing.
Credential Extraction
windows.hashdump — extracts NTLM hashes from the SAM database in memory (requires SYSTEM key)
windows.lsadump — extracts LSA secrets from memory (service account credentials, cached domain credentials)
windows.cachedump — extracts domain-cached credentials (DCC2 hashes) from memory
The presence of these credentials in a memory dump indicates what lateral movement was possible from the compromised system. Even if the attacker used Mimikatz and deleted it, the credentials they could have extracted are preserved in the memory dump.
- Memory contains encryption keys, plaintext credentials, network connections, and injected code that exist nowhere on disk
- Acquire memory before any system shutdown — WinPmem for Windows, LiME for Linux; hibernation files and VM snapshots are alternative sources
- Compare pslist and psscan — processes in psscan but not pslist have been deliberately hidden by a rootkit
- Suspicious process indicators: unexpected parent processes, misspelled names, wrong paths, single-instance processes with duplicates
- malfind identifies private executable memory regions — injected shellcode and process hollowing leave characteristic signatures detectable even without disk artefacts
Network Forensics
PCAP capture, Wireshark in depth, NetFlow analysis, DNS forensics, TLS traffic analysis, C2 beacon detection, and file reconstruction from captures
Network forensics is the capture and analysis of network traffic to reconstruct communications, identify attack vectors, and recover transmitted content. Its fundamental challenge is the opposite of disk forensics: disk artefacts persist and must be collected before they are overwritten; network traffic is ephemeral and must be captured at the moment it occurs — or not at all. This places a premium on pre-positioned capture infrastructure and rapid response to activate capture when an incident is detected.
PCAP Fundamentals
A PCAP (Packet Capture) file contains a timestamped record of all network packets observed at a capture point. Full-packet capture (also called "full content" capture) preserves the complete payload of every packet — including the data being transmitted. This is the most forensically complete form of network evidence but also the most storage-intensive.
Capture points determine what traffic is visible:
- Network TAP (Test Access Point) — a hardware device that passively copies traffic from a network link without affecting the link. The gold standard for network forensics — captures everything without introducing latency or failure risk.
- SPAN/mirror port — a switch feature that copies traffic from one or more ports/VLANs to a designated monitoring port. Common and flexible but can miss packets under high load.
- Endpoint capture — running Wireshark or tcpdump on the affected system itself. Captures only traffic to and from that endpoint. The capturing process modifies the system (relevant to Locard) but is often the only option after the fact.
- Network IDS/IPS sensors — if inline IDS is deployed, it may have captured (or logged metadata about) the traffic of interest.
Wireshark in Depth
Wireshark is the standard tool for interactive PCAP analysis. Its GUI provides protocol dissection, stream reconstruction, and export capabilities that make network forensics accessible. Key analytical techniques:
Display Filters
Filter by IP: ip.addr == 10.1.1.50
Filter source IP: ip.src == 10.1.1.50
Filter by protocol: http, dns, smb2, tls
HTTP POST requests only: http.request.method == "POST"
DNS queries to specific domain: dns.qry.name contains "suspicious-domain"
Large HTTP responses (potential data exfiltration): http.response and frame.len > 50000
TLS handshakes: tls.handshake.type == 1 (ClientHello)
Beaconing pattern — filter traffic from a specific process using known port: tcp.port == 4444 and ip.dst == [C2_IP]
Following Streams
Right-click any packet → Follow → TCP Stream (or UDP Stream, HTTP Stream, TLS Stream) reconstructs the complete conversation in human-readable form. For unencrypted protocols, this reveals the full content of the communication — credentials transmitted in cleartext, commands sent to a remote shell, files transferred over HTTP.
Export Objects
Wireshark can reconstruct and export files transmitted over HTTP, FTP, SMB, TFTP, and DICOM. File → Export Objects → HTTP shows all HTTP objects in the capture and allows selective or bulk export. Exported files can then be hashed and submitted to VirusTotal or analysed in a sandbox.
NetFlow and Traffic Metadata
Full packet capture is storage-intensive — a 1Gbps link at full utilisation generates roughly 450GB of PCAP per hour. For large enterprise networks, continuous full-packet capture at perimeter is impractical. NetFlow (Cisco's protocol, widely standardised as IPFIX) provides traffic metadata — the "who talked to whom, when, for how long, how much" — at a fraction of the storage cost.
A NetFlow record contains: source and destination IP and port, protocol, start and end time, byte count, packet count, and TCP flags. No payload data. Despite the absence of payload, NetFlow is extremely powerful for:
- Lateral movement detection — unusual SMB connections between workstations, SSH from unexpected sources
- Data exfiltration scoping — identifying large outbound transfers to external IPs
- C2 beacon pattern identification — periodic connections with consistent byte counts and intervals
- Scope reconstruction — determining which internal hosts communicated with the identified C2 infrastructure
DNS Forensics
DNS logs — query logs recording every domain name resolution attempted by every host — are among the most valuable and underutilised network forensic data sources. Almost every network attack involving an external component uses DNS: C2 beacons resolve their C2 hostname, exfiltration tools look up cloud storage endpoints, phishing sites are reached by DNS resolution, and malware dropper URLs are resolved before download.
DNS Tunnelling Detection
DNS tunnelling encodes data in DNS query subdomains. To detect it in DNS logs:
- High-entropy subdomain labels — legitimate subdomains are human-readable; tunnelled subdomains are base32/base64 encoded data (
d2hvd3dhc3RoYXQ.evil.com) - Unusual query volume — a single host making hundreds of DNS queries per minute to the same domain
- Unusual record types — TXT, NULL, and MX record queries are sometimes used for tunnelling
- Query length distribution — tunnelled subdomains are often much longer than normal (50+ characters per label)
DGA (Domain Generation Algorithm) Detection
Malware families using DGAs generate large numbers of pseudo-random domain names daily, connecting only to the one that resolves (which the attacker has registered). In DNS logs, DGA activity appears as: many NXDOMAIN (non-existent domain) responses followed by one successful resolution. The successful domain is the active C2.
TLS and Encrypted Traffic Analysis
The majority of modern network traffic is TLS-encrypted, which means payload data is not directly readable in PCAP. However, significant forensic value remains:
- SNI (Server Name Indication) — the TLS ClientHello contains the target domain name in plaintext, even for HTTPS traffic. Extracting SNI from a PCAP reveals which domains a host was communicating with, even without decryption.
- Certificate analysis — the server certificate exchanged during the TLS handshake is visible in plaintext. Certificate subject, issuer, validity period, and Subject Alternative Names reveal information about the server. Self-signed certificates or certificates with suspicious subjects are red flags.
- JA3 fingerprinting — JA3 hashes a combination of TLS ClientHello parameters (cipher suites, extensions, elliptic curves) to produce a fingerprint of the TLS implementation. Different software (browsers, malware frameworks, legitimate tools) produces different JA3 hashes. Cobalt Strike, for example, has a known default JA3 hash that appears in captures of Cobalt Strike C2 traffic.
- Traffic pattern analysis — timing, packet sizes, and connection patterns of encrypted traffic can reveal beaconing even without decryption. A process making a TLS connection to the same IP every 60 seconds, transferring ~200 bytes each time, is a beacon regardless of what the payload contains.
- Network traffic is ephemeral — capture infrastructure must be pre-positioned; after-the-fact reconstruction is limited to what flow data and logs preserve
- Wireshark's Follow Stream and Export Objects features reconstruct conversations and transmitted files from full-packet captures
- NetFlow/IPFIX provides traffic metadata at manageable storage cost — sufficient for lateral movement detection and exfiltration scoping
- DNS query logs reveal nearly every network action — tunnelling detection, DGA identification, and C2 hostname resolution
- TLS encryption does not prevent analysis — SNI, certificate data, JA3 fingerprints, and traffic patterns all yield investigative value without decryption
Disk Forensics & Imaging
Storage device types, write blockers, FTK Imager, dd/dcfldd, image formats, hash verification, and SSD forensics complications
Disk forensics is the original discipline from which everything else in digital forensics grew. Before there were mobile devices, cloud infrastructure, or memory forensics frameworks, there were hard drives — and the methodology developed to forensically image and analyse them established the principles that govern the entire field. This chapter covers imaging methodology, format selection, and the increasingly important complications introduced by modern solid-state storage.
Storage Device Types and Their Forensic Implications
Not all storage devices behave the same way forensically. Understanding the underlying technology determines what evidence can be recovered and how:
- HDD (Hard Disk Drive) — spinning platter storage. Data is written to physical sectors; deleted data persists until those sectors are physically overwritten by new data. No internal mechanisms that zero data on deletion. The most forensically permissive storage type — deleted file recovery is highly reliable on an HDD that has not been heavily written since deletion.
- SSD (Solid State Drive) — NAND flash storage with a controller. The TRIM command (issued by the OS when files are deleted) instructs the controller to zero out the corresponding NAND pages asynchronously. TRIM dramatically reduces deleted file recovery success. Additionally, wear levelling means the physical location of data shifts over time — logical-to-physical mapping is controlled by the drive's internal firmware, not the forensic examiner.
- NVMe — the interface protocol used by the fastest SSDs. Same forensic characteristics as SATA SSDs; TRIM applies.
- USB Flash Drives — similar to SSDs but typically without TRIM support, making deleted file recovery more reliable than on SSDs. Controllers vary widely; some drives remap sectors in ways that complicate forensic imaging.
- eMMC (embedded MMC) — found in tablets, Chromebooks, and lower-end laptops. Soldered directly to the motherboard; removal for forensic imaging requires chip-off techniques (desoldering and reading the NAND directly) or JTAG access.
Hardware Write Blockers
Hardware write blockers are passive devices that sit between the evidence drive and the forensic workstation. They allow read commands to pass through normally while intercepting and discarding any write commands. This ensures zero modification of the evidence drive during imaging.
Selection criteria for write blockers:
- Interface support — does it support the drive's interface? SATA, IDE, USB 3.0, NVMe/M.2, SD card, and CF card each require different adapters or dedicated write blocker models.
- Speed — write blocker throughput should not be the bottleneck. Modern write blockers support USB 3.2 Gen 2 (20Gbps) and PCIe NVMe passthrough for fast acquisition.
- Validation — the write blocker should be validated against the NIST Computer Forensics Tool Testing (CFTT) programme.
Major manufacturers: Tableau (Cellebrite T8u USB 3.0, T356789iu multi-interface), WiebeTech / CRU (Forensic ComboDock), Logicube.
FTK Imager in Depth
FTK Imager (AccessData, free) is the most widely used Windows forensic imaging tool. It can image physical drives, logical drives, memory, and individual files/folders, and supports E01, DD, AFF, and other formats.
1. File → Create Disk Image
2. Source type: Physical Drive (for a full disk image) or Logical Drive (for a volume image)
3. Select source: choose the evidence drive (via the write blocker)
4. Destination: select image format (E01 recommended), destination path (must have sufficient space), segment size, compression (0 = none for legal forensics; 1–9 for size reduction)
5. Evidence item information: fill in case number, examiner name, description, notes — this is embedded in the E01 image
6. Verify images after they are created — FTK Imager automatically computes and verifies MD5 and SHA1 hashes and creates a log file
7. Review the image summary — source hash and destination hash must match
Command-Line Imaging — dd, dcfldd, dc3dd
On Linux/Mac (and via Windows Subsystem for Linux), command-line tools provide flexible imaging with scriptable verification:
Basic dd image: dd if=/dev/sdb of=/mnt/evidence/disk.dd bs=512 conv=noerror,sync status=progress
noerror — continue on read error (important for damaged drives); sync — pad unreadable blocks with zeros to maintain byte alignment
dcfldd with on-the-fly hashing: dcfldd if=/dev/sdb of=/mnt/evidence/disk.dd hash=sha256 hashlog=/mnt/evidence/hash.log
dc3dd with hash and log: dc3dd if=/dev/sdb of=/mnt/evidence/disk.dd hash=sha256 hlog=/mnt/evidence/hash.log log=/mnt/evidence/imaging.log
Network acquisition (write image directly to forensic workstation): on evidence machine: dd if=/dev/sdb | nc [analyst-ip] 9999 — on analyst workstation: nc -l 9999 > disk.dd
Image Formats Compared
| Format | Extension | Characteristics | Best Used For |
|---|---|---|---|
| Raw | .dd, .img, .raw | Bit-for-bit copy with no metadata wrapper; maximum compatibility; no embedded hash or case info | Linux/Mac tools; network acquisition; maximum tool compatibility |
| E01 (Expert Witness) | .E01 | Segmented compressed format; embedded metadata (case info, examiner name); embedded hash verification; widely supported by commercial tools | Legal forensics; long-term evidence storage; FTK, Autopsy, EnCase |
| AFF4 | .aff4 | Open standard; supports logical containers; used by WinPmem for memory images; Volatility 3 compatible | Memory acquisition; modern open-source workflows |
| VMDK / VHD | .vmdk, .vhd | VM disk formats; can be directly mounted in virtualisation software; useful for VM forensics | Virtualised evidence; cloud disk images from AWS/Azure |
SSD Forensics Complications
The TRIM command fundamentally changes deleted file recovery on SSDs. When the OS deletes a file on an SSD with TRIM enabled (the default on Windows, macOS, and most Linux distributions), it issues a TRIM command to the drive controller, which marks the corresponding NAND pages for zeroing. The controller zeros these pages asynchronously — often within seconds to minutes on an idle drive.
Practical implications for forensic investigators:
- Power off immediately — if a live SSD is in an incident and deleted file recovery may be needed, power off the device as quickly as possible (without formal shutdown, which triggers more writes). An idle SSD running TRIM in the background can zero deleted data faster than you can image it.
- TRIM may already have run — on a drive seized hours after deletion, assume TRIM has executed and deleted file recovery may be impossible. Adjust investigation strategy accordingly.
- Wear levelling — the SSD controller remaps logical sectors to different physical NAND pages over time to distribute wear. This means the same logical sector address may point to different physical locations over the drive's lifetime, and previously written data may persist at physical locations that are no longer mapped to any logical sector — potentially recoverable with specialised chip-off or vendor-assisted techniques.
- Vendor and model matters — TRIM implementation and aggressiveness varies by SSD firmware. Some enterprise SSDs have different TRIM behaviour than consumer models. Researching the specific drive model before forensic acquisition is worthwhile.
- HDDs support reliable deleted file recovery; SSDs with TRIM enabled may zero deleted data within seconds of deletion — power off quickly when SSD recovery is needed
- Hardware write blockers must match the drive interface — validate against NIST CFTT programme for legal admissibility
- E01 format embeds metadata and hash verification in the image — preferred for legal forensics; raw dd is preferred for maximum tool compatibility
- dd with
conv=noerror,synchandles damaged drives gracefully by padding unreadable sectors with zeros rather than aborting - Hash the source, hash the destination immediately, compare — re-hash the working copy at every session start
Mobile Device Forensics
iOS and Android extraction methods, forensic tools, app artefacts, cloud backup forensics, and legal considerations
Mobile devices are increasingly the primary digital evidence source in investigations ranging from corporate insider threats to criminal proceedings. They contain location history, communications, app usage data, and credential stores that provide a uniquely intimate record of human behaviour. They are also among the most technically challenging devices to examine — encryption is strong, extraction methods vary by device and OS version, and manufacturer and carrier variations create a fragmented landscape that requires specialised tooling and ongoing training.
Extraction Types
Mobile forensics distinguishes several extraction types, ordered from least to most invasive and from least to most complete:
| Extraction Type | Data Obtained | Invasiveness | Typical Method |
|---|---|---|---|
| Manual | Only what is visible on screen | Minimal | Photographing device screen |
| Logical | Files and data exposed through OS APIs; similar to a backup | Low | iTunes backup, ADB backup, UFED logical |
| File System | Full file system tree including app containers and databases | Medium | AFC2 (jailbroken iOS), ADB with root, UFED premium |
| Physical | Full bit-for-bit image of the device's NAND storage | High | UFED, Oxygen, EDL mode (Android), checkm8 (older iOS) |
| Chip-off | Raw NAND dump — maximum recovery including wear-levelled data | Destructive | Specialised lab equipment; desolders NAND chip |
iOS Forensics
iOS is designed with forensics in mind — but from the user's perspective, not the investigator's. Apple's hardware encryption (the Secure Enclave, hardware AES encryption tied to the device UID key) makes physical acquisition of a locked iPhone effectively impossible without the passcode. The investigator's approach is therefore largely shaped by whether the device is locked and whether the passcode is known.
iTunes/Finder backups are the most accessible source of iOS data without jailbreaking. An unencrypted backup contains messages, call logs, contacts, photos, app data for most applications, and location data. An encrypted backup additionally contains keychain items (saved passwords). Creating a backup over USB using the target computer (which may already have a trust relationship with the device) avoids any modification to the device itself.
GrayKey (Grayshift) and Cellebrite Premium provide law enforcement with passcode extraction capability for certain iOS versions by exploiting bootloader or OS vulnerabilities. These capabilities are version-specific — there is an ongoing cat-and-mouse between Apple's patching and extraction tool updates. Most corporate forensic examiners do not have access to these tools; they are primarily law enforcement capabilities.
iCloud backups and iCloud Drive data may be accessible with the user's Apple ID credentials or through legal process. iCloud backups contain similar data to local iTunes backups. iCloud Drive contains files the user has explicitly synced. Apple provides law enforcement with iCloud data in response to valid legal process.
Android Forensics
Android's open architecture and extreme device fragmentation create both more flexibility and more complexity than iOS. Extraction methods vary by manufacturer, Android version, and whether the device has been rooted.
ADB (Android Debug Bridge) — the primary developer interface for Android. With USB debugging enabled and the device unlocked, ADB provides access to device data and can perform logical backups. Without root, the backup is limited to apps that permit backup. With root, full filesystem access is available.
Check connected devices: adb devices
Create logical backup: adb backup -all -apk -shared -nosystem -f backup.ab
Shell access: adb shell
Pull a specific file: adb pull /data/data/com.whatsapp/databases/msgstore.db ./whatsapp.db
Extract SQLite databases require root or specific permissions — most valuable app data is in /data/data/[package]/databases/
EDL (Emergency Download Mode) — a low-level Qualcomm chipset mode that provides direct flash memory access, bypassing Android's security model. Requires device-specific EDL credentials (which forensic tool vendors obtain through various means) but provides physical-level acquisition on many Android devices using Qualcomm SoCs.
Mobile Forensic Tools
- Cellebrite UFED — the dominant commercial mobile forensics platform. Hardware device with software companion (Physical Analyzer). Supports hundreds of device models, multiple extraction types, and automated parsing of app artefacts.
- Oxygen Forensic Detective — strong app artefact parsing, cloud account extraction, and drone forensics. Popular in corporate and insurance investigation contexts.
- Magnet AXIOM — multi-platform (mobile + computer + cloud) unified forensics platform. Strong for investigations spanning multiple device types.
- iLEAPP / ALEAPP — open-source iOS and Android artifact parsers. Free, actively maintained, and excellent for specific artefact categories.
Key App Artefacts
Messaging apps store evidence in local databases that can be extracted and analysed:
- WhatsApp — messages in
msgstore.db(Android), encrypted with a device-specific key stored locally. Contact information and media metadata in additional databases. - Signal — designed to resist forensic extraction. Messages encrypted in the local database with a passphrase; cloud backup disabled by default. Physical acquisition of a rooted device with the passphrase may recover messages.
- iMessage / SMS — stored in
sms.dbon iOS in the backup. Includes message content, timestamps, and contact information for both SMS and iMessage conversations. - Location data — iOS stores significant location history in
cache.dband in the KnowledgeC database. Android stores location history in Google account data (Google Timeline) and in-app location databases.
Legal Considerations — Compelled Decryption
The Fifth Amendment (US) protects against compelled self-incrimination. Courts have reached inconsistent conclusions on whether compelling a defendant to provide their device passcode constitutes testimonial self-incrimination protected by the Fifth Amendment — or whether it is merely a physical act (like providing a physical key) not protected by the Fifth. The law in this area is unsettled and evolving, varies by jurisdiction, and must be navigated with legal counsel.
- Extraction type determines data completeness — physical acquisition is most complete but requires appropriate capability; logical/backup extraction is most widely accessible
- iOS hardware encryption makes a locked device effectively impenetrable without the passcode; iTunes backups are the primary accessible data source
- Android's fragmentation means extraction method must match device chipset, version, and security state — no universal approach
- Messaging apps vary dramatically in forensic recoverability — WhatsApp is relatively recoverable; Signal is designed to resist forensic extraction
- Compelled decryption law is unsettled — engage legal counsel before attempting to compel a passcode in any legal proceeding
Malware Forensics & Analysis
Static analysis, PE structure, dynamic analysis, behavioural tools, YARA rules, anti-analysis techniques, and fileless malware
Malware forensics is the sub-discipline that most closely bridges incident response and digital forensics. When a malicious file is recovered during a forensic investigation, analysis of that file can reveal: how the attacker got in, what the malware was designed to do, what data may have been exfiltrated, and whether other samples from the same campaign are present elsewhere in the environment. This chapter covers the analytical workflow — from initial static examination through dynamic behavioural analysis — and the YARA rules that translate those findings into detection capability.
The Analysis Workflow
Malware analysis follows a deliberate sequence designed to gather progressively deeper information while controlling risk:
- Triaging — quick initial classification: is this file actually malicious? What type of file is it? Is it packed? Answers from hashing, VirusTotal, and basic static checks.
- Static analysis — examining the file without executing it. Strings, imports, PE structure, embedded resources, entropy analysis.
- Dynamic analysis — executing the file in a controlled (sandboxed) environment and observing behaviour: process creation, file writes, registry modifications, network connections.
- Advanced static analysis — disassembly and decompilation of the binary code to understand logic that was not revealed by strings or behaviour.
- Reporting and detection — documenting findings and writing YARA rules, network signatures, and detection content based on the analysis.
For most incident response scenarios, triage through dynamic analysis (steps 1–3) is sufficient. Advanced static analysis (step 4) requires reverse engineering skills that are a separate specialisation; it is typically reserved for novel, high-priority malware families.
Static Analysis
File Identification and Hashing
Before analysis, establish the file's identity:
File type identification (regardless of extension): file malware.exe on Linux/Mac; TrIDNet on Windows
Compute hashes: sha256sum malware.exe (Linux) or Get-FileHash .\malware.exe -Algorithm SHA256 (PowerShell)
Check hash on VirusTotal: curl "https://www.virustotal.com/api/v3/files/[SHA256]" -H "x-apikey: [KEY]"
Check hash on MalwareBazaar: https://bazaar.abuse.ch/browse/
PE File Structure
Most Windows malware is a Portable Executable (PE) file — the standard Windows binary format. Understanding PE structure allows rapid assessment of a file's capabilities without execution:
- DOS Header and stub — every PE begins with the ASCII bytes
MZ(4D 5A). This is the universal PE file signature. A file masquerading as a PDF or image that begins with MZ is actually an executable. - PE Header — machine type (x86 vs x64), compilation timestamp (useful for attribution but easily manipulated), number of sections
- Section headers —
.text(code),.data(initialised data),.rdata(read-only data, strings, imports),.rsrc(resources). Sections with unusual names or unusual combinations of executable + writable permissions indicate packed or modified code. - Import Address Table (IAT) — lists the DLLs and functions the executable imports. The imports reveal capabilities:
CreateRemoteThread+VirtualAllocEx+WriteProcessMemory= process injection;CryptEncrypt+FindFirstFile+MoveFileExA= ransomware;WSAStartup+connect+recv= network capability.
A file's imports include: LoadLibraryA, GetProcAddress — suspicious because legitimate code usually imports specific functions, not dynamic function resolution; this is a common packer/loader pattern.
Imports of VirtualAlloc, VirtualProtect, CreateThread with no other significant imports — a common shellcode loader pattern.
Very few imports with LoadLibraryA + GetProcAddress only — the malware is resolving all other imports dynamically at runtime to evade static analysis of the IAT.
Strings Analysis
The strings tool (Linux) or Strings (Sysinternals, Windows) extracts printable character sequences from a binary file. Even from an unexecuted file, strings often reveal: C2 domain names and IP addresses, file paths, registry keys, mutex names, error messages (which may include debugging information left by the developer), and configuration data.
Entropy Analysis
High entropy in a PE section indicates encrypted or compressed data — a characteristic of packed malware. Legitimate executables typically have entropy below 7.0 in their code sections; packed malware often has entropy of 7.5–8.0 in sections that contain the compressed payload. Tools like PEiD, Detect-It-Easy (DIE), and pestudio visualise per-section entropy and identify common packer signatures.
Dynamic Analysis
Dynamic analysis executes the malware in a controlled environment and observes its behaviour. The standard approach uses a sandboxed virtual machine with monitoring tools pre-installed. The VM must be isolated from the production network but may need simulated internet connectivity (INetSim or FakeDNS) to allow C2 callbacks that would otherwise fail and affect behaviour.
Core Monitoring Tools (FlareVM / REMnux)
Process Monitor (ProcMon) — Sysinternals tool that logs every file system, registry, and process/thread operation. Filter by process to see exactly what the malware does to the filesystem and registry. The definitive tool for understanding file writes, registry modifications, and process creation.
Process Hacker — real-time process tree view with memory inspection, network connections, and module listing per process. Shows injected DLLs and unusual memory regions.
Wireshark — capture all network traffic during malware execution. Captures C2 callbacks, DNS queries, data exfiltration, and downloaded payloads.
Regshot — takes Registry snapshots before and after execution; diffs them to identify all Registry modifications made by the malware.
INetSim (Linux) — simulates internet services (HTTP, HTTPS, DNS, SMTP) to allow malware to "successfully" complete C2 callbacks in a controlled environment.
Automated Sandboxes
For rapid triage, online sandboxes provide automated dynamic analysis without setting up a local environment:
- Any.run — interactive sandbox; watch malware execute in real time in a browser
- VirusTotal / Files → Behaviour — automated behaviour analysis for submitted files
- Cuckoo Sandbox — self-hosted automated analysis; configure multiple analysis VMs for different OS versions
- CAPE Sandbox — Cuckoo fork with enhanced capability for unpacking and config extraction
Caution: do not submit sensitive or classified samples to public online sandboxes. All public sandbox services retain submitted files and make them accessible to other users. Use a private Cuckoo deployment for sensitive samples.
YARA Rules
YARA is a pattern-matching tool and rule language designed to describe and identify malware samples based on textual or binary patterns. A YARA rule consists of: a rule name, metadata, string definitions, and a condition that specifies when the strings constitute a match.
rule CobaltStrike_Beacon {
meta:
author = "Analyst"
description = "Detects CobaltStrike beacon shellcode"
date = "2024-01-15"
strings:
$s1 = "ReflectiveLoader" ascii
$s2 = { 4D 5A 90 00 03 00 00 00 } // MZ PE header
$s3 = "/C ping -n 1 -w 3000" ascii wide
$sleep = "sleep" ascii fullword
condition:
$s1 and ($s2 or $s3) and $sleep
}
Run against a file: yara rule.yar suspicious.exe
Scan a directory: yara -r rules/ /path/to/scan/
Scan a memory dump: yara -r rules/ memory.raw
Anti-Analysis Techniques
Malware authors are aware that their code will be analysed and take countermeasures. Recognising these techniques is essential for understanding why analysis is producing unexpected results:
- Packing / obfuscation — compressing or encrypting the malware payload. The outer layer (stub) decompresses/decrypts and executes the real payload in memory. Most commercial packers (UPX, Themida, VMProtect) and custom packers are detectable by entropy analysis and packer signatures.
- VM detection — checking for VM artefacts: VMware registry keys, virtualisation-specific device names, CPUID responses, timing differences between physical and virtual hardware. If a VM is detected, the malware may terminate, behave differently, or drop a benign payload.
- Anti-debugging — detecting the presence of a debugger via
IsDebuggerPresent(),CheckRemoteDebuggerPresent(), and more sophisticated timing and exception-based checks. Anti-debugging causes the malware to terminate or change behaviour when a debugger is attached. - Sleep calls — malware that sleeps for long periods during sandbox execution to outlast the sandbox timeout. Sandboxes typically run samples for 60–120 seconds; malware that sleeps for 5+ minutes will not display its full behaviour.
- Environment checks — checking username, computer name, domain membership, or the number of running processes. Sandboxes often have no domain, a small number of processes, and generic machine names — checks that fail these conditions indicate a non-enterprise environment and trigger evasion.
Fileless Malware Forensics
Fileless malware executes entirely in memory — no executable file is written to disk. Common fileless techniques: PowerShell or WMI executing base64-encoded payloads from the Registry or directly from a command line; process injection into a legitimate process; reflective DLL loading that maps a DLL into memory without writing it to disk.
Forensic recovery of fileless malware evidence:
- Memory dumps — the primary source. Volatility's
malfindanddlllistplugins identify injected code. Dumped memory regions can be analysed with static analysis tools or submitted to sandboxes. - Event ID 4104 (PowerShell Script Block Logging) — if enabled, records the full content of PowerShell script blocks before they execute, including deobfuscated content. This captures fileless PowerShell stages even when no script file was written to disk.
- Registry artefacts — fileless malware often stores its payload in the Registry (Run keys, COM object registration, WMI subscriptions). Registry forensics may recover the payload even after the process has terminated.
- Process creation logs — Event ID 4688 with command-line logging captures the obfuscated PowerShell or WMI command that launched the fileless payload.
- Static analysis (strings, PE imports, entropy) reveals capabilities without execution risk; dynamic analysis reveals actual behaviour in a controlled environment
- PE imports are a rapid capability assessment — process injection, network, and ransomware capabilities each have characteristic import patterns
- High entropy PE sections indicate packing — the real payload is compressed or encrypted and decompresses at runtime
- YARA rules translate forensic findings directly into detection signatures deployable to EDR and SIEM
- Fileless malware leaves no disk artefacts — memory dumps, PowerShell Script Block Logging (4104), and Registry forensics are the primary recovery paths
Cloud & SaaS Forensics
AWS, Azure, and GCP forensics, SaaS audit logs, container forensics, evidence preservation, and cross-border jurisdiction
Cloud forensics is one of the fastest-evolving areas of the discipline — and one where practitioners trained exclusively on traditional endpoint and network forensics frequently struggle. The absence of physical media, the shared infrastructure model, ephemeral compute, and the provider's control over underlying infrastructure require a fundamental shift in both methodology and tooling. This chapter covers the practical approach to forensics across major cloud platforms and the SaaS applications that run on them.
How Cloud Forensics Differs
Traditional forensics: the examiner physically accesses the device, applies a write blocker, images the storage media, and analyses the image. The entire process is under the examiner's control.
Cloud forensics: the examiner has no access to physical hardware, cannot image underlying storage media, is dependent on the provider's logging infrastructure for evidence, and is working with ephemeral resources that may have been terminated before the investigation begins. The provider controls the evidence.
This shifts the forensic approach from evidence collection from media to evidence collection from APIs and logs. The quality of a cloud forensic investigation is directly proportional to the quality of the logging configuration — which, in most cloud environments, is not enabled comprehensively by default.
AWS Forensics
CloudTrail — The Control Plane Log
AWS CloudTrail records every API call made to AWS services — who called what, from where, with what parameters, at what time. It is the single most important evidence source for AWS forensic investigations.
All API calls by a specific IAM principal in a time window:
fields @timestamp, eventName, sourceIPAddress, userAgent
| filter userIdentity.arn like "arn:aws:iam::123456789:user/compromised-user"
| filter @timestamp between 1704067200000 and 1704153600000
| sort @timestamp asc
Console login events:
fields @timestamp, sourceIPAddress, userIdentity.userName
| filter eventName = "ConsoleLogin"
| sort @timestamp desc
All S3 GetObject events (potential data exfiltration):
fields @timestamp, sourceIPAddress, requestParameters.bucketName, requestParameters.key
| filter eventName = "GetObject"
| sort @timestamp desc
EC2 Instance Forensics
Forensically examining a running EC2 instance can be done in several ways:
- EBS snapshot acquisition — take a snapshot of the instance's EBS volumes, create a new volume from the snapshot, and attach it to a separate forensic EC2 instance for examination. This provides a point-in-time disk image without affecting the running instance. The forensic instance can run Autopsy, Sleuth Kit, or other tools to analyse the volume.
- SSM Session Manager — AWS Systems Manager provides a browser-based or CLI shell to EC2 instances without SSH. Useful for live response commands (process listing, memory collection, network state) when SSH access is not available or has been disabled as a containment measure.
- Memory acquisition on EC2 — acquire RAM using WinPmem or LiME on the running instance, then upload the dump to S3 for analysis. Note that this writes to the instance's local storage — document this as forensic contamination.
GuardDuty
AWS GuardDuty is a managed threat detection service that analyses CloudTrail, VPC Flow Logs, and DNS logs for threat indicators. GuardDuty findings are pre-mapped to ATT&CK techniques and provide a starting point for investigation. Key forensic value: GuardDuty may identify threats that occurred before the investigation began — its findings can extend the investigation timeline backwards.
Azure Forensics
| Log Source | Location | Forensic Value |
|---|---|---|
| Azure Activity Log | Monitor → Activity Log; exportable to Log Analytics | All Azure Resource Manager operations — VM create/delete, NSG changes, RBAC modifications |
| Azure AD Sign-in Logs | Azure AD → Sign-in logs; export to Log Analytics or SIEM | Authentication events, MFA results, conditional access outcomes, risk levels |
| Azure AD Audit Logs | Azure AD → Audit logs | Directory changes — user creation, role assignment, application registration |
| Azure Diagnostic Logs | Per-resource Diagnostic Settings | Resource-specific operational logs — must be enabled per resource; not enabled by default |
| Microsoft Sentinel | Sentinel workspace | SIEM aggregating all above sources; query with KQL |
Azure disk snapshot for VM forensics: create a managed disk snapshot via the portal or CLI, export it to a storage account as a VHD, download and mount the VHD for offline analysis.
Microsoft 365 Forensics
Microsoft 365 is the most widely used SaaS platform in enterprise environments and a frequent target in business email compromise, insider threat, and data exfiltration investigations. The primary forensic data source is the Unified Audit Log (UAL).
The UAL records user and admin activities across Exchange Online, SharePoint, OneDrive, Teams, and Azure AD. It must be explicitly enabled (not on by default in all tenants) and is retained for 90 days for E3 plans, 365 days for E5 plans. The retention cliff at 90/365 days is a common discovery that prevents full reconstruction of incidents with long dwell times.
PowerShell connection: Connect-IPPSSession -UserPrincipalName [email protected]
Search UAL for a user's activities:
Search-UnifiedAuditLog -StartDate "2024-01-01" -EndDate "2024-01-15"
-UserIds "[email protected]" -ResultSize 5000
Mail forwarding rules created (BEC indicator):
Search-UnifiedAuditLog -Operations "Set-InboxRule","New-InboxRule"
-StartDate "2024-01-01" -EndDate "2024-01-15"
Files accessed from SharePoint:
Search-UnifiedAuditLog -RecordType SharePointFileOperation
-Operations FileAccessed,FileDownloaded -StartDate "2024-01-01" -EndDate "2024-01-15"
Container and Kubernetes Forensics
Container workloads introduce ephemeral forensic challenges. A compromised container may be terminated and replaced within seconds, destroying all in-container evidence. The forensic approach for containers:
- Do not terminate the suspect container — pause it (
docker pause [container]) or preserve it withdocker committo create an image before it exits - Container filesystem —
docker export [container] > container.tarcaptures the complete container filesystem as a tarball for offline analysis - Kubernetes audit logs — API server audit logs record every kubectl action, pod creation, and RBAC-related activity. Enable with
--audit-log-pathand an audit policy file. - Falco — runtime security tool that generates alerts on suspicious container behaviour (shell spawned in container, sensitive file access, network connection from unexpected process)
Cross-Border Jurisdiction and Evidence Preservation
Cloud data may be physically stored in multiple jurisdictions simultaneously. This creates complications for both evidence collection (what legal process is required in each jurisdiction?) and data protection compliance (does collecting and moving this data violate GDPR or other data residency requirements?).
Practical guidance: issue a legal hold notice to the cloud provider as early as possible to preserve data before retention periods expire. Work with legal counsel to identify the correct legal process for each jurisdiction where evidence may reside. Document the geographic distribution of data before beginning collection.
- Cloud forensics is log-based — the quality of the investigation depends entirely on logging configuration established before the incident
- CloudTrail and Azure Activity Log are the control-plane equivalents of Windows Event Logs — they must be enabled in all regions/subscriptions
- EBS snapshots and Azure disk snapshots provide disk-level forensic images without affecting running instances
- M365 Unified Audit Log is the primary evidence source for BEC and data exfiltration investigations — it expires at 90/365 days; preserve it immediately
- Container forensics must happen before termination — pause rather than kill suspect containers; preserve via docker export or commit
Anti-Forensics & Countermeasures
Timestomping, secure deletion, encryption, steganography, LOLBIN techniques, and why anti-forensics leaves its own traces
Anti-forensics encompasses the techniques used to prevent, complicate, or mislead digital forensic investigation. Understanding these techniques is essential for practitioners: you must know what attackers do to cover their tracks, why those techniques sometimes work, and — critically — the forensic artefacts that anti-forensic activities themselves leave behind. The fundamental truth that most practitioners eventually discover is this: attempting to hide evidence usually creates new evidence.
Timestomping
Timestomping is the deliberate modification of file timestamps to mislead timeline analysis. An attacker may change the timestamps of a malicious file to match the timestamps of benign system files, making it appear to have existed long before the attack — or to predate the organisation's log retention window.
Detection: As covered in Chapter 4, NTFS maintains two sets of timestamps — $STANDARD_INFORMATION (modifiable from user space) and $FILE_NAME (kernel-set, significantly harder to modify). When a file's $STANDARD_INFORMATION timestamps differ significantly from its $FILE_NAME timestamps, timestomping is indicated. Additionally, the $UsnJrnl change journal records the actual time of file system operations — including the metadata change that occurred when timestamps were modified.
A file shows a $STANDARD_INFORMATION Created timestamp of 2022-01-15 (consistent with the OS installation date). Its $FILE_NAME Created timestamp shows 2024-03-22. The $UsnJrnl shows a metadata modification event on 2024-03-22 at 14:32:07 UTC. The discrepancy proves the $STANDARD_INFORMATION timestamp was artificially set to an earlier date.
Secure Deletion
Standard file deletion does not overwrite data — it only removes filesystem pointers. Secure deletion tools overwrite the file's data before deletion, preventing recovery. Common tools:
- sdelete (Sysinternals) — overwrites file data with zero passes, random passes, or DoD 5220.22-M standard overwrite pattern before deletion. Leaves artefacts: Prefetch, Event Logs, and the $UsnJrnl record the execution of sdelete.
- Eraser — Windows GUI secure deletion tool. Same artefacts as sdelete.
- shred / wipe (Linux) — command-line secure deletion. Effective on HDDs; partially effective on SSDs (due to wear levelling, different physical pages than the logical address may not be overwritten).
Forensic limitation: secure deletion of individual files is less effective than it appears because: (1) the filesystem may have retained the file's data in $LogFile, VSS snapshots, or SIEM logs before deletion; (2) file carving from unallocated space may not recover the file but may recover slack from adjacent clusters; (3) the act of running a secure deletion tool leaves artefacts — Prefetch, UserAssist, Event Logs — that prove something was being hidden.
Full-Disk Encryption
Full-disk encryption (FDE) — BitLocker, FileVault, LUKS — is legitimate and recommended security practice, but it presents a real challenge for forensic investigations when the decryption key is unavailable.
Avenues for accessing an FDE-protected drive:
- Recovery key — BitLocker recovery keys are often stored in Active Directory (corporate), Microsoft Account (consumer), or a printout. Azure AD stores BitLocker keys for Intune-enrolled devices.
- Memory acquisition — the decryption key is held in RAM while the volume is mounted. A live memory dump (Chapter 7) from a running system with the volume mounted may allow key recovery. Volatility plugins (Bitlocker plugin, AESKeyFinder) search for key material in memory dumps.
- TPM cold boot — extremely rare; applicable to specific older configurations.
- Legal compulsion — depending on jurisdiction and the Fifth Amendment considerations discussed in Chapter 10, decryption keys may be compelled via court order.
Living-Off-the-Land (LOLBIN) Techniques
Living-off-the-land attackers use built-in OS binaries and scripting environments rather than custom malware — exploiting tools that are present on every Windows or Linux installation and that generate less obvious forensic evidence than third-party tools.
Common Windows LOLBINs and their forensic traces:
| Binary | Abuse Use Case | Forensic Evidence Left |
|---|---|---|
certutil.exe | Download files from internet, base64 decode | Prefetch, Event ID 4688, browser cache written by certutil, IEF cache |
mshta.exe | Execute HTA (HTML Application) scripts — bypass AppLocker | Prefetch, Event ID 4688 with command line showing URL or file path |
regsvr32.exe | Execute remote scripts via COM scriptlets (Squiblydoo) | Prefetch, Event ID 4688, network connection to script URL in proxy logs |
wscript.exe / cscript.exe | Execute VBScript and JScript payloads | Prefetch, Event ID 4688, Script Block Logging if configured |
powershell.exe | Everything — download, execute, inject, exfiltrate | Prefetch, Event ID 4688/4104 (Script Block Logging), PowerShell Transcription logs |
wmic.exe | Lateral movement, WMI subscriptions, process execution | Prefetch, Event ID 4688, WMI activity logs |
Steganography
Steganography hides data within other files — most commonly images or audio files — in ways that are invisible to casual inspection. A JPEG file can contain a hidden archive, encryption keys, or C2 command instructions embedded in the pixel data or EXIF metadata. Detection requires specialised tools (StegSpy, SteghideDetect) or statistical analysis of file entropy and pixel distribution anomalies.
In practice, steganography is an uncommon forensic finding outside of nation-state and sophisticated cybercrime investigations. When encountered, it typically indicates a level of operational security sophistication that should prompt reassessment of the investigation's scope.
Every anti-forensic action creates evidence of its own execution. Running a secure deletion tool creates Prefetch entries and Event Log records. Clearing the Event Log creates Event ID 1102 (Log Cleared). Timestomping creates a $UsnJrnl record of the metadata modification. Attacker tools used to disable logging are themselves logged. The investigator's task is to recognise the pattern of anti-forensic activity and treat it as evidence of consciousness of guilt.
- Timestomping is detected by comparing $STANDARD_INFORMATION vs $FILE_NAME timestamps — significant discrepancies indicate manipulation
- Secure deletion leaves its own artefacts — Prefetch, Event Logs, and UsnJrnl prove that deletion tools were run even when the target files are gone
- BitLocker keys may be recoverable from AD, Azure AD, Microsoft Account, or from live memory acquisition of a running system
- LOLBINs bypass many detection controls but still generate Prefetch, Event ID 4688, and network-level evidence
- Every anti-forensic technique leaves its own evidence — the pattern of anti-forensic activity is itself forensically significant
Forensic Reporting & Expert Testimony
Report structure, writing for non-technical audiences, expert testimony, peer review, bias, and reproducibility
The finest forensic analysis in the world has zero practical value if it cannot be communicated effectively to its audience. Forensic reports and expert testimony are the mechanisms by which technical findings become legal decisions, corporate policy changes, criminal convictions, or civil judgments. The skills required to produce them are distinct from the skills required to conduct the analysis — and equally important.
The Forensic Report Structure
A complete forensic examination report typically contains the following sections:
- Cover page and executive summary — case name/number, examiner details, date, and a non-technical summary of findings and conclusions. The executive summary is written last but read first. It must be comprehensible to a judge, juror, HR director, or senior executive with no technical background. Findings stated in plain language. Conclusions stated explicitly and without hedging.
- Scope and objectives — what questions was the examination designed to answer? What was in scope? What was explicitly out of scope? Defining scope protects against scope creep challenges in court.
- Methodology — what processes, tools, and versions were used? In what sequence? This section must be detailed enough that another qualified examiner could follow the same steps. Tool versions matter — the same tool name may produce different results across versions.
- Evidence examined — a list of every item of evidence examined, with its unique identifier, description, hash values, and chain of custody reference.
- Findings — what was found? Each finding presented separately, with the artefact location, the tool and method used to identify it, and the raw data (log line, hex dump, screenshot) supporting it. Findings are factual — they describe what was observed, not what it means.
- Analysis and conclusions — what do the findings mean? This section contains the examiner's interpretation, expert opinion, and conclusions. Distinguish clearly between facts (what was found) and opinions (what the examiner believes the facts mean).
- Limitations — what could not be determined? What evidence was unavailable, corrupt, or incomplete? What alternative explanations exist for the findings? Honest acknowledgement of limitations strengthens rather than weakens a report — it demonstrates the examiner's objectivity.
- Appendices — raw output, tool logs, hash verification reports, timeline exports, and any other supporting material too detailed to include in the main report body.
Writing for Non-Technical Audiences
Most forensic reports will be read — and judged — by people who are not technical. Judges, jurors, HR directors, insurance adjusters, and executives are the primary audiences for forensic conclusions. Technical prose written for a peer audience will confuse and alienate these readers.
Practical writing guidance:
- Define every technical term on first use — do not assume the reader knows what NTFS, MFT, Prefetch, or NTLM mean
- Use analogy — "the Prefetch file is similar to the 'Recently Used' list in an office application — it records that the program ran and when" is more useful than a technically precise description for a non-technical reader
- State conclusions explicitly — "Based on the above evidence, I conclude that User X executed the file malware.exe at 14:32:07 UTC on 15 January 2024 from the system's local C: drive" is a conclusion. "The evidence may potentially suggest some possible connection between User X and malware.exe" is not.
- Use consistent terminology — choose one term for each concept and use it throughout the report. Alternating between "the suspect," "the user," "the employee," and "John Smith" creates ambiguity.
Expert Testimony
When a forensic report is used in legal proceedings, the examiner may be called to testify as an expert witness. This is a skill that requires preparation and practice — being technically competent does not automatically make one a good witness.
Direct examination — the side that retained you asks questions designed to elicit your methodology and findings. Speak clearly, avoid jargon, use analogies, and pause between question and answer. Do not volunteer information beyond what was asked.
Cross-examination — opposing counsel's goal is to undermine your methodology, your qualifications, or your conclusions. Common attacks: challenging tool reliability, proposing alternative explanations for findings, questioning whether you considered exculpatory evidence, suggesting bias based on who retained you. Responses to these challenges must be calm, factual, and grounded in your methodology.
Key principles for testimony:
- Say "I don't know" or "I cannot determine that from the evidence" rather than speculating beyond your findings
- Correct any mischaracterisation of your testimony immediately and politely
- Distinguish consistently between what you found (fact) and what you concluded (opinion)
- Do not change your opinion under pressure — if opposing counsel proposes an alternative explanation, evaluate it fairly; if it is not supported by the evidence, say so clearly
Confirmation Bias and Objectivity
Confirmation bias — the tendency to search for, interpret, and remember information in a way that confirms pre-existing beliefs — is the most dangerous cognitive error in forensic practice. An examiner who begins an investigation believing the suspect is guilty will unconsciously interpret ambiguous evidence against the suspect, assign less weight to exculpatory findings, and stop investigating once a confirming narrative is established.
Structural countermeasures:
- Hypothesis testing — formulate alternative hypotheses before examining evidence and actively look for evidence that would support each one, not just the primary hypothesis
- Peer review — have a colleague review findings and conclusions before finalising the report. The reviewer should have access to the evidence and the methodology, not just the draft report.
- Document exculpatory evidence — explicitly note evidence that does not support the primary hypothesis. An examiner who mentions only incriminating evidence is not being objective.
Reproducibility
A forensic finding is scientifically valid only if it is reproducible — another qualified examiner, given the same evidence and the same methodology, must be able to reach the same conclusion. This standard governs every aspect of forensic practice: tool selection, documentation discipline, methodology description, and conclusion drafting.
In practice, reproducibility is tested by: opposing parties commissioning their own forensic examination of the same evidence; defence experts reviewing the prosecution's forensic methodology; and regulatory bodies auditing practitioner certifications and methodologies. A forensic practitioner whose work cannot survive this scrutiny is not practising forensics — they are practising advocacy in a forensic costume.
- The executive summary must be comprehensible to a non-technical audience — write it last, but recognise it is read first and judges the entire report
- Distinguish findings (factual observations) from conclusions (expert interpretation) — courts and counsel will challenge conflation of the two
- Cross-examination targets methodology, qualifications, and alternative explanations — prepare for all three before testifying
- Confirmation bias is the most dangerous cognitive error in forensic practice — structural countermeasures include peer review, hypothesis testing, and explicit documentation of exculpatory evidence
- Reproducibility is the scientific standard — if another qualified examiner cannot reach the same conclusion using the documented methodology, the finding is not forensically sound
Tools, Labs & Practice
The full analyst toolkit, forensic workstation setup, practice environments, career paths, certifications, and the DFIR community
Digital forensics is a discipline learned through practice far more than through reading. This final chapter provides the practical scaffolding for putting everything in this module to use: the tools that professional examiners reach for, the environments where you can practise legally and safely, the certifications that structure skill development and are recognised by employers, and the community resources that will keep your knowledge current long after this module is complete.
The Forensic Analyst's Toolkit
Open Source Tools
| Category | Tool | Platform | Key Use |
|---|---|---|---|
| Forensic Framework | Autopsy + The Sleuth Kit | Win/Linux/Mac | Full disk analysis, file recovery, timeline, hash lookup |
| Memory Forensics | Volatility 3 | Win/Linux/Mac | Memory image analysis — process, network, injection, credentials |
| Memory Acquisition | WinPmem, LiME, DumpIt | Win/Linux | Live RAM acquisition |
| Windows Artefacts | Eric Zimmerman's Tools | Windows | MFT, Registry, Prefetch, Shellbags, LNK, SRUM parsing |
| Disk Imaging | FTK Imager (free) | Windows | Disk imaging, preview, evidence container |
| Disk Imaging | dd / dcfldd / dc3dd | Linux/Mac | Command-line imaging with hash verification |
| Network Analysis | Wireshark / tshark | All | PCAP analysis, stream reconstruction |
| Network Forensics | NetworkMiner | Windows | Passive host reconstruction, file extraction from PCAP |
| Log Analysis | Chainsaw | Win/Linux/Mac | Fast Windows event log hunting with Sigma rules |
| Log Analysis | Hayabusa | Win/Linux/Mac | Windows event log threat hunting and timeline generation |
| Malware Analysis | Detect-It-Easy (DIE) | All | Packer/compiler/obfuscator detection, PE analysis |
| Malware Analysis | YARA | All | Pattern matching, malware family identification |
| Browser Forensics | Hindsight | Win/Linux | Chromium browser artefact extraction |
| Timeline | log2timeline / plaso | Linux | Super-timeline creation from multiple artefact types |
| Timeline | Timeline Explorer | Windows | Interactive timeline analysis, CSV viewer |
Commercial Platforms
- Magnet AXIOM — leading multi-platform commercial forensics suite. Unified computer, mobile, and cloud analysis with automated artefact parsing and AI-assisted analysis.
- Cellebrite Digital Collector / UFED — dominant mobile forensics platform, expanding into enterprise endpoint forensics.
- X-Ways Forensics — high-performance disk forensics tool favoured by forensic laboratories for its speed and precision on large-scale investigations.
- EnCase Forensic (OpenText) — long-standing enterprise forensics platform with strong case management and court-accepted workflow.
Setting Up a Forensic Workstation
SIFT Workstation
The SANS Investigative Forensics Toolkit (SIFT) is a free, open-source Linux distribution pre-configured with a comprehensive forensic toolset. Built on Ubuntu, it includes Volatility, Autopsy, Sleuth Kit, log2timeline/plaso, Eric Zimmerman's tools (via Wine), and dozens of other utilities. SIFT is the standard training environment for SANS forensics courses (FOR508, FOR572, FOR585) and is freely downloadable.
REMnux
REMnux is a Linux distribution specialised for malware analysis. It includes static analysis tools (PE analysis, disassembly), dynamic analysis tools (sandboxing support, process monitoring), network simulation (INetSim, FakeDNS), and reverse engineering tools. REMnux and SIFT can be co-installed on the same system.
FlareVM
FLARE VM is a Windows-based malware analysis environment maintained by Mandiant. It converts a Windows VM into a fully equipped malware analysis workstation: IDA Pro (community), Ghidra, x64dbg, dnSpy, PE-bear, Python/Jupyter for scripting, and hundreds of additional tools installed via Chocolatey.
Practice Environments
- NIST CFReDS (Computer Forensic Reference Data Sets) — a library of forensically prepared images with known content, maintained by NIST for tool testing and training. Excellent for validating that your tools and methodology produce correct results.
- CTF challenges — Capture-the-Flag competitions frequently include DFIR challenges. CyberDefenders, BlueTeamLabs Online, and HackTheBox's Sherlock category all provide forensics-focused challenges with realistic artefacts. These are the best free practice resource available.
- Magnet CTF — Magnet Forensics runs periodic CTF competitions with mobile and computer forensics challenges. Solutions are published afterwards with explanations.
- MemLabs — a GitHub repository of memory forensics CTF challenges specifically designed around Volatility analysis. Six progressively harder challenges from introduction to advanced.
Certifications
| Certification | Body | Focus | Level |
|---|---|---|---|
| GCFE | GIAC (SANS) | Windows computer forensics — FOR500 course aligned | Intermediate |
| GCFA | GIAC (SANS) | Advanced computer forensics and incident response — FOR508 | Advanced |
| GCFR | GIAC (SANS) | Cloud forensics and incident response — FOR509 | Advanced |
| GNFA | GIAC (SANS) | Network forensics — FOR572 | Advanced |
| EnCE | OpenText (formerly Guidance) | EnCase-specific workflow and methodology | Intermediate |
| CCE | ISFCE | Broad computer forensics — vendor-neutral | Intermediate |
| CFCE | IACIS | Law enforcement computer forensics standard | Intermediate |
The DFIR Community
- Conferences: DFRWS (Digital Forensics Research Workshop) — peer-reviewed academic/practitioner conference; OSDFCon (Open Source Digital Forensics Conference) — open-source tools focused; SANS DFIR Summit — practitioner presentations.
- Blogs and research: Brian Carrier (TSK), Matt Suiche (memory forensics), Maxim Suhanov (Windows artefacts), DFIR.Science, About DFIR (Jessica Hyde).
- GitHub resources: Awesome DFIR repositories aggregate tool lists, challenge resources, and research. The EricZimmerman GitHub is essential for Windows forensics tooling.
- Discord communities: DFIR Discord, BlueTeamLabs, and CyberDefenders all have active DFIR channels where practitioners share findings, tools, and career guidance.
- SIFT Workstation (Linux) and FlareVM / REMnux (Windows) provide free, pre-built forensic analysis environments — start here before purchasing commercial tools
- NIST CFReDS and CTF platforms (CyberDefenders, BlueTeamLabs) provide the legal, realistic practice that turns reading into skill
- GCFE and GCFA (SANS/GIAC) are the most respected commercial-sector certifications; CFCE for law enforcement; EnCE for EnCase-heavy environments
- The DFIR community is active and open — blogs, conferences, Discord, and GitHub repositories are the primary channels for staying current
- Forensic skill development is primarily empirical — hours examining actual evidence, solving CTF challenges, and having your work reviewed develops the pattern recognition that no amount of reading can substitute for