Chapter 13
Performing Forensic Analysis and Techniques

Computer forensic investigations are used to determine what activities, changes, and other actions have occurred on a system, who or what performed them, and what data is stored there. This means that computer forensic techniques are used in a variety of scenarios, including police investigations, inquiries into system administrator misuse, compromise and malware analysis, and investigations related to internal policy violations.

In this chapter you will learn how to be prepared to conduct basic forensic investigations. You will learn about forensics kits, their contents, and the use of the devices and tools they contain. Then, you will explore forensic tools and processes needed to capture and preserve forensics data for network-based, endpoint-based, mobile, and cloud and virtual investigations.

Building a Forensics Capability

One of the first steps to being able to conduct a forensic investigation is to gather the right set of tools. Forensic tools come with a broad variety of capabilities, costs, and purposes. You should determine what types of investigations you are likely to conduct, what types of systems and devices you will need to analyze, and what evidentiary standards you will need to comply with before you build your toolkit.

Building a Forensic Toolkit

A complete forensic toolkit is an important part of any forensic investigation. Not only can having the right tools and materials make the process easier, but it can also help ensure that your investigation has the right documentation and support materials in case you need to provide proof of your process—either in court, to management, or to auditors.

Over the next few pages you will learn about the major components of a forensic toolkit, including a forensic workstation, data capture tools and devices, and the administrative tools that help provide proper chain-of-custody tracking. Keep in mind how your organization is likely to conduct forensic investigations—not all of these components may be needed for your use cases.

Key Toolkit Components

The following components are common to most forensic toolkits. Forensic workstations may be a desktop, a laptop, or even a server, and the specific components should be tailored to your organization. But this basic set of items will allow you to perform forensic investigations under most circumstances.

  • A digital forensics workstation. A good forensic workstation is designed to allow for data capture and analysis, and those tasks can benefit from a powerful, multicore CPU and plenty of RAM. Having lots of fast, reliable storage is also important, since large investigations can deal with terabytes of data.
  • A forensic investigation suite or forensic software like FTK, EnCase, the SANS Investigate Forensic Kit (SIFT), or The Sleuth Kit (TSK) that provides the ability to capture and analyze forensic images as well as track forensic investigations.
  • Write blockers, which ensure that drives connected to a forensic system or device cannot be written to. This helps to ensure the integrity of the forensic investigation; having file access times changed—or worse, having the system that is analyzing the data modify the content of the files on the drive—can prevent forensic evidence from being useful.
  • Forensic drive duplicators, which are designed to copy drives for forensic investigation and then provide validation that the original drive and the content of the new drive match. Many forensic tools and suites also offer this capability, but a dedicated cloning device can be useful (and can sometimes make it easier to prove that the duplication process was completed in a forensically sound manner).
  • Wiped drives and wiped removable media of sufficient capacity to handle any drive or system that you are likely to encounter. Fortunately, large SATA hard drives, portable NAS devices, and large SSDs make it a lot easier to capture and transport multiple forensic images. Removable media, in the form of large USB thumb drives, writable Blu-ray or DVD media, or flash media, can also be valuable for transporting forensic data or for sending it to other organizations when necessary.
  • Cables and drive adapters of various types to ensure that you can connect to most types of devices you are likely to encounter. In a corporate environment, you are likely to know what types of machines and drives your organization deploys, allowing you to select the right adapters and cables to match what you have. In law enforcement, consulting, or other environment where you may not know what you will encounter, having a broad selection of cables and adapters can be incredibly helpful.
  • A camera to document system configurations, drive labels, and other information. Cameras are a surprisingly important part of forensic capture because they can speed up data recording and can provide a visual record of the state of a system or device.
  • Labeling and documentation tools, including a label maker or labels, indelible pens, and other tools to help with chain-of-custody and forensic process documentation.
  • Notebooks and preprepared documentation forms and checklists to record forensic investigation processes and notes. Common types of forms include chain-of-custody forms that track who was in possession of evidence at any time, incident response forms for tracking a response process, incident response plans and incident forms, and escalation lists or call lists of people to contact during a response process. These are sometimes replaced by a forensic recording software package or another software tool that provides ways to validate log entries and that tracks changes. Figure 13.1 shows an example of a chain-of-custody form.
Snapshot of the sample chain-of-custody form.

FIGURE 13.1 Sample chain-of-custody form

Mobile Device Forensic Toolkit Components

Handling mobile device forensics can create additional challenges. The diversity of mobile device operating systems, connection types, security options, and software versions can make capturing data from devices difficult. Having the right tools plays a big role in successfully connecting to and capturing data from mobile devices. If you need to build a mobile forensic toolkit, you may need to add some or all of the following to your existing forensic kit:

  • Tools for accessing SIM cards and flash memory cards. For some phones, this is simply a pin-style push device, whereas others may require small screwdrivers or other tools.
  • A mobile device connection cable kit that includes the most common connector types for current and recent phones. This has become simpler in recent years, and having USB micro, Lightning, and USB-C connectors will cover most smartphones and tablets. Connecting to older phones and non-smartphones can still require additional proprietary cables. Fortunately, many vendors provide mobile device forensic cable kits, allowing you to buy many of the most common cables at once.
  • Mobile device–specific forensic software and tools designed to target mobile device operating systems.

Understanding Forensic Software

There are many types of forensic software, ranging from purpose-built forensic suites and tools like FTK, EnCase, CAINE, Autopsy, and SIFT to forensic utilities like DumpIt and Memoryze. Many common Linux and Windows utilities also have forensic applications, including utilities like dd and WinDbg.

Capabilities and Application

Forensic investigations can take many forms, which means that you'll need a broad software toolkit to handle situations, systems, and specific requirements you encounter. Key forensic tool capabilities to include in your forensic software toolkit are imaging, analysis, hashing and validation, process and memory dump analysis, password cracking, and log viewers.

Imaging Media and Drives

The first step in many forensic investigations is to create copies of the media or disks that may contain data useful for the investigation. This is done using an imaging utility, which can create a forensic image of a complete disk, a disk partition, or a logical volume.

Forensic images exactly match the original source drive, volume, partition, or device, including slack space and unallocated space. Slack space is the space left when a file is written. This unused space can contain fragments of files previously written to the space or even files that have been intentionally hidden. Unallocated space is space that has not been partitioned. When used properly, imaging utilities ensure that you have captured all of this data.

Analysis Utilities

Forensic analysis utilities provide a number of useful capabilities that can help offer insight into what occurred on a system. Examples include the following:

  • Timelines of system changes
  • Validation tools that check known-good versions of files against those found on a system
  • Filesystem analysis capabilities that can look at filesystem metadata (like the Windows Master File Table for NTFS) to identify file changes, access, and deletions
  • File carving tools that allow the recovery of files without the filesystem itself available
  • Windows Registry analysis
  • Log file parsing and review

These analysis tools can help identify information that is useful for a forensic investigation but using them well requires detailed forensic knowledge to avoid missing important data.

Carving

When data is recovered as part of forensic analysis, the original filesystem may no longer be intact. In this, and other scenarios where the original filesystem cannot be used, file carving tools come in handy. File carving tools look at data on a block-by-block basis, looking for information like file headers and other indicators of file structure. When they find them, they attempt to recover complete or even partial files.

Three common types of file carving methods are as follows:

  • Header- and footer-based carving, which focuses on headers like those found in JPEG files. For example, JPEGs can be found by looking for xFFxD8 in the header and xFFxD9 in the footer.
  • Content-based carving techniques look for information about the content of a file such as character counts and text recognition.
  • File structure-based carving techniques that use information about the structure of files.

Figure 13.2 shows a JPEG file opened in HxD, a free hex editor tool. At the top left of the image you can see the header information for the JPEG showing FF and D8 as the first pair of entries in the file.

Chain-of-Custody Tracking

Support for properly maintaining chain-of-custody documentation in an automated and logged manner is an important part of a forensic suite, and it is an important part of their documented forensic procedures for many organizations. Maintaining chain-of-custody documentation ensures that drive images and other data, as well as the actions taken using the suite, are properly validated and available for review, thus reducing the potential for legal challenges based on poor custodial practices.

Legal Holds

One common use of forensic tools is in support of legal holds. A legal hold (or litigation hold) is conducted when information must be retained for a legal case. In this scenario, forensic and backup tools are often leveraged to ensure that a current copy of the target system, drive, or network storage location is preserved and maintained as required by the hold. Although forensic tools are often leveraged as part of this process, a purpose-built eDiscovery tool is often the better choice if your organization deals with a reasonable volume of legal holds.

Snapshot of the carving a JPEG file using HxD.

FIGURE 13.2 Carving a JPEG file using HxD

Hashing and Validation

Verification of the forensic integrity of an image is an important part of forensic imaging. Fortunately, this can be done using hashing utilities built into a forensics suite or run independently to get a hash of the drive to validate the contents of the copy. The goal of this process is to ensure that the copy exactly matches the source drive or device.

Forensic image formats like EnCase's EO1 format provide built-in hashing as part of the file. In cases where formats like these are not used, both MD5 and SHA1 hashes are frequently used for this purpose. Hashing large drives can take quite a bit of time even using a fast algorithm like MD5, but the process itself is quite simple as shown here. The following provides the MD5 hash of a volume mounted on a Linux system:

user@demo:~# md5sum /dev/sda1
9b98b637a132974e41e3c6ae1fc9fc96 /dev/sda1

To validate an image, a hash is generated for both the original and the copy. If the hashes match, the images are identical. Both hashes should be recorded as part of the forensic log for the investigation.

Hashing is also often used to validate binaries and other application related files to detect changes to the binaries. Manual checksums using MD5 or SHA1 utilities can be used to check if a file matches a known good version or one from a backup, or it can be checked against a provided checksum from a vendor or other source.

Fortunately for incident responders and forensic analysts, known file hash databases are maintained by a handful of organizations, including these:

Many organizations also track known hashes of malware, allowing responders to upload suspected malicious code to have it checked.

Conducting Endpoint Forensics

Traditionally, the great majority of forensic activity has taken place on endpoint systems: servers, desktops, laptops, and mobile devices of all types. As organizations increasingly move to the cloud, more forensic activity is taking place there, but a majority of forensic work is likely to continue to involve traditional endpoints for most practitioners.

Operating System, Process, and Memory Dump Analysis

Information about the state of the operating system (OS), including the data that is stored in memory by processes, can be important to both forensic investigations as well as investigations of malware infections or compromise. Often data that is otherwise kept encrypted is accessible in memory to processes, or the encryption keys that those processes use to access encrypted data are available. The ability to capture memory, process information and data, as well as operate specific analysis capabilities, is a useful forensic capability. OS analysis can provide key data about what was occurring on a system during the timeframe targeted by an investigation.

In addition to live memory capture and analysis, memory dump analysis can be particularly valuable when recovering decryption keys for full-disk encryption products like BitLocker. Hibernation files and crash dumps can both contain the data needed to decrypt the drive, which makes accessing an unlocked machine critically important for a forensic practitioner.

Disk Forensics

The most common forensic activity for endpoints is disk, or storage-based analysis. This can range from manual inspection of files to complete imaging and analysis of entire disks or volumes as mentioned earlier in the chapter.

Memory Forensics

Conducting memory forensics requires either running live forensic analysis on a running machine or making a copy of live memory to point in time forensic memory analysis. Tools like Volatility, an open source memory forensics framework, can capture and analyze memory.

Volatility has a wide range of plug-in commands, including the ability to detect API hooks, read the keyboard buffer, grab the Windows clipboard, look for live TCP connections, scan for driver objects, and many more. If there is data accessible in live memory in an unencrypted form, you should assume it can be recovered—and if it is encrypted, the encrypted version can be accessed and potentially decrypted if the key is available.

Memory forensics can be particularly useful when attempting to recover security artifacts that are stored in memory when in use such as encryption keys and passwords. As a forensic practitioner, you should keep in mind that system crash dumps often contain a copy of live memory, making them an attractive target for both practitioners and knowledgeable attackers.

Mobile Device and Cell Phone Forensics

Mobile device forensic capabilities exist in many commercial forensic suites, as well as in the form of stand-alone tools. Due to the security features that many phone operating systems provide, they often have specialized decryption or brute-forcing capabilities to allow them to capture data from a locked and encrypted phone or phone volume.

Phone backup forensic capabilities are also a useful tool for mobile forensics. Backups may not have all current data, but they can contain older data that was deleted and may not have the same level of security that the phone itself does, thus making them an attractive target for forensic acquisition and review.

Password Crackers and Password Recovery

An increasing number of drives and devices are encrypted or use a password to protect the system or files. This makes password recovery tools (also called password crackers) very useful to a forensic examiner. Common places to discover password protection beyond the operating system or account level include Microsoft Office files, PDFs, as well as ZIP and RAR compressed files.

Recovering passwords for forensic investigations can be challenging, but tools like ElcomSoft's Advanced Office Password Recovery, shown in Figure 13.3, provide brute-force password breaking for a range of file types.

Snapshot of the advanced Office Password Recovery cracking a Word DOC file.

FIGURE 13.3 Advanced Office Password Recovery cracking a Word DOC file

Cryptography Tools

Cryptographic tools are common both to protect forensic data and to protect data and applications from forensics. Forensic tools often have encryption capabilities to ensure that sensitive data under forensic investigation is not breached as part of the investigation when drives or files are transferred, or if the forensic environment is compromised.

Encryption tools are also needed to handle encrypted drives and network protocols. These capabilities vary from tool to tool, but handling BitLocker, Microsoft Office, and other common encryption mechanisms are common tasks during forensic investigations.

When forensic techniques are used to investigate malware, encryption and other protection schemes are frequently encountered as a means of preventing code analysis of malware. Many malware packages use tools called “packers,” intended to protect them from reverse engineering. Packers are intended to make direct analysis of the code difficult or impossible. Some forensic tools provide support for unpacking and decoding from packing techniques like Base64 encoding.

Log Viewers

Log files can provide information about the system state, actions taken on the system, and errors or problems, as well as a wide variety of other information. This makes log entries particularly useful when you are attempting to understand what occurred on a system or device. Forensic suites typically build in log viewers that can match log entries to other forensic information, but specialized logs may require additional tools.

Network Forensics

Network traffic forensics require capturing traffic on the network or reviewing artifacts of that traffic like security or network device logs, traffic monitoring data, or other information that can help forensic practitioners to reconstruct events and incidents.

For the purposes of the CySA+ exam, you will need to know the basics of both Wireshark and tcpdump.

Wireshark Network Forensics

Wireshark is an open source network protocol analyzer (sometimes called a packet sniffer, or sniffer). It runs on many modern operating systems and can allow users to capture and view network data in a GUI. Captures can be saved, analyzed, and output in a number of formats.

Figure 13.4 shows a simple Wireshark capture of traffic to the CompTIA website. Note the DNS query that you can see that starts the connection. If you scrolled further you'd see the multitude of trackers and ad sites that also get hit along the way!

Snapshot of the Wireshark view of network traffic.

FIGURE 13.4 Wireshark view of network traffic

As you prepare for the CySA+ exam, you should spend a little time capturing traffic using Wireshark and tcpdump, and make sure you know the basics of how to find a packet by text strings and protocols. You should also be able to identify what common traffic like the start of a TCP connection looks like.

Tcpdump Network Forensics

Tcpdump is a command-line packet capture utility found on many Linux and Unix systems. Tcpdump is a powerful tool, particularly when combined with other tools like grep to sort and analyze the same packet data that you could capture with Wireshark. Although Wireshark typically has to be installed on systems, tcpdump is more likely to be installed by default.

In Figure 13.5, you can see a tcpdump watching network traffic for DNS traffic.

Snapshot of the Tcpdump of network traffic.

FIGURE 13.5 Tcpdump of network traffic

As you can see, text representations of packets can be harder to sort through. In fact, when capturing this example the authors had to output the capture to a file rather than to the terminal buffer because loading the CompTIA website generated more traffic than the terminal's default buffer. Tcpdump is powerful and helpful, but you will need to learn how to filter the output and read through it.

Cloud, Virtual, and Container Forensics

Cloud computing, virtualization, and containerization have created a new set of challenges for forensic practitioners. Many of the artifacts that would have once been available are now part of ephemeral virtual machines or containers, or are hosted by third-party providers. Practitioners must plan in advance for how they will conduct forensic investigations, meaning you need to know what artifacts you can gather, what you will need to do to gather them, and what you may need to partner with a cloud provider to obtain, or if they will provide the access or data you need at all.

Performing Cloud Service Forensics

Performing forensic investigations on cloud services can be challenging, if not impossible. Shared tenant models mean that forensic data can be hard to get and often require the cloud service provider to participate in the investigation. Maintaining a proper chain of custody, preserving data, and many other parts of the forensic process are more difficult in many cloud environments.

If a cloud service is likely to be part of your forensic investigation, you may want to do the following:

  • Determine what your contract says about investigations.
  • Determine what legal recourse you have with the vendor.
  • Identify the data that you need and whether it is available via methods you or your organization controls.
  • Work with the vendor to identify a course of action if you do not control the data.

Performing Virtualization Forensics

Virtualization forensics can be somewhat less complex than attempting forensics on a hosted environment. Virtualized systems can be copied and moved to a secure environment for analysis, but as a forensic practitioner you will need to keep in mind your forensic goals. Incident response forensics may be easier since the evidentiary requirements are typically less than those found in a legal case, making how you handle the forensic copies of systems and how and when you capture them less critical.

Regardless of whether you're conducting an investigation for incident response, an internal investigation, or law enforcement, you will need to understand the limitations of what your capture and copying methods can do. Remember to also consider the underlying virtualization environment—and what you would do if the environment itself were the target of the forensic work!

Virtualization and containerization share many of the same goals and operate in somewhat similar ways. Figure 13.6 shows how the two concepts look at a high level. Note the separation of the virtual machines in the virtualized environment versus the applications running under the same containerization engine.

Schematic illustration of the virtualization versus containerization.

FIGURE 13.6 Virtualization vs. containerization

Container Forensics

Containers are increasingly common, and container forensics can create some unique issues. Perhaps the most important of them is that most containers are designed to be disposable, and thus if something goes wrong many organizations will have processes in place to shut down, destroy, and rebuild the container in an automated or semi-automated fashion. Even if there isn't a security issue, due to their ephemeral nature, containers may be destroyed or rescheduled to a different node. This means that forensic artifacts may be lost.

Containerization technology also creates other challenges: internal lots and filesystem artifacts are ephemeral; they communicate over software-defined networks that change frequently as containers are bought online, taken offline, or moved; and security contexts are dynamically modified by the containerization orchestration tool.

All of this means that if you anticipate the need to respond to incidents involving containerized applications, you need to preplan to capture the data you will need. That means identifying tooling and processes to audit activities, as well as methods to capture data that may be necessary for container forensics. Fortunately, containerization security tools are available that can help with this.

Conducting a Forensic Investigation

Forensic investigations rely on more than just a forensic toolkit and a forensic suite. The process of conducting an investigation is often complex due to the number of systems, devices, individuals, and other material involved. Next, we will look at a typical forensic process.

Forensic Procedures

Forensic investigations can take many forms and there are many formal models for forensic investigations, but the basic process involved when conducting them remains the same. In almost all investigations you will take these steps:

  1. Determine what you are trying to find out. You may be asked to investigate a compromised system, to analyze the actions taken by malware, or to find out if a system administrator made an unauthorized change to a system. This forms the problem statement that helps to define what forensic activities you will take.
  2. Outline the locations and types of data that would help you answer the questions from step 1. Data may exist in many forms, and applications and systems can determine the format and accessibility of the data. Knowing where and how you need to collect data will also influence what your forensic process looks like. At this stage, you may not know the specific hardware or log locations, but you should be able to come up with the types of data and systems you will need to capture data from.
  3. Document and review your plan.
  4. Acquire and preserve evidence. The acquisition process may require cloning media, seizing systems or devices, or making live memory images to ensure that information is not lost when a system is powered off.
  5. Perform initial analysis, carefully tracking your actions, the systems and data you work with, and your findings, as well as any questions you need to answer.
  6. Use the initial analysis to guide further work, including deeper investigation, and review where the initial analysis pointed to additional data or where information is missing that is needed to answer the questions you originally asked.
  7. Report on the findings of the investigation.

Acquisition processes need to take into account the order of volatility, which measures how easily data is to lose. This means that data stored in memory or caches is considered highly volatile, since it will be lost if the system is turned off, whereas data stored in printed form or as a backup is considered much less volatile. Figure 13.7 shows a view of the order of volatility of common storage locations that data is likely to be acquired from during a forensic investigation.

Schematic illustration of the order of volatility of common storage locations.

FIGURE 13.7 Order of volatility of common storage locations

Target Locations

Target locations differ based on operating system or device type, but Windows, macOS, and Linux systems are the most common targets of forensic acquisition. Table 13.1 lists common locations and examples of how they might be used for Windows forensics.

This isn't an exhaustive list, and the needs of each forensic investigation will vary, but knowing where to look and what files you may need can help guide your decisions when determining which systems and volumes to image. Unfortunately, each Linux distribution and macOS version tends to have slightly different locations, making it harder to provide a simple list of common locations. You can find a useful macOS listing at forensicswiki.xyz/wiki/index.php?title=Mac_OS_X. Linux forensics analysts will often target the contents of /var, /home, and /etc as excellent starting locations for system logs, user data, and configuration information.

TABLE 13.1 Forensic application of Windows system artifacts

Windows Use
Windows Registry Information about files and services, locations of deleted files, evidence of applications being run
Autorun keys Programs set to run at startup (often associated with malware or compromise)
Master File Table (MFT) Details of inactive/removed records
Event logs Logins, service start/stop, evidence of applications being run
INDX files and change logs Evidence of deleted files, MAC timestamps
Volume shadow copies Point-in-time information from prior actions
User directories and files Logged-in user artifacts
Recycle Bin contents Files that were intended to be deleted but forgotten
Hibernation files and memory dumps Memory artifacts of commands run
Temporary directories Artifacts of software installation, user temporary file storage, or other limited lifespan data
Application logs Application-specific data
Removable drives (including flash drives) System logs may indicate drives were plugged in; data may be relevant to investigations

Acquiring and Validating Drive Images

Drive and media images must be captured in a forensically sound manner. They also require hashing and validation, and with the exception of live system forensics where it cannot be completely avoided, forensic duplication should not change the source drive or device. To do this, an exact bit-for-bit copy is made using an imaging utility, write blockers are employed to prevent the possibility of modifying the source drive, and multiple copies are made so that the original drive can be retained for evidence.

Forensic Copies

Forensic copies of media don't work the same way that simply copying the files from one drive to another would. Forensic copies retain the exact same layout and content for the entire device or drive, including the contents of “empty” space, unallocated space, and the slack space that remains when a file does not fill all the space in a cluster.

The need for a verifiable, forensically sound image means that you need to use an imaging tool to create forensic images rather than using the copy command or dragging and dropping files in a file manager. Fortunately, there are a number of commonly available tools like dd or FTK's Imager Lite built into major forensic suites that can create forensic images.

Imaging with dd

The Linux dd utility is often used to clone drives in RAW format, a bit-by-bit format. dd provides a number of useful operators that you should set to make sure your imaging is done quickly and correctly:

  • Block size is set using the bs flag and is defined in bytes. By default, dd uses a 512-byte block size, but this is far smaller than the block size of most modern disks. Using a larger block size will typically be much faster, and if you know the block size for the device you are copying, using its native block size can provide huge speed increases. This is set using a flag like bs = 64k.
  • The operator if sets the input file; for example, if = /dev/disk/sda1.
  • The operator of sets the output file; for example, of = /mnt/usb/.

Figure 13.8 shows a sample dd copy of a mounted drive image to a USB device. The speed of copies can vary greatly based on block size, the relative speeds of the source and destination drive, and other variables like whether the system is virtual or physical.

Snapshot of the dd of a volume.

FIGURE 13.8 dd of a volume

Handling Encrypted Drives

Drive and device encryption is increasingly common, making dealing with drive images more challenging. Of course, live system imaging will avoid many of the issues found with encrypted volumes, but it brings its own set of challenges. Fortunately, commercial forensic suites handle many of the common types of encryption that you are likely to encounter, as long as you have the password for the volume. They also provide distributed cracking methods that use multiple computers to attack encrypted files and volumes.

Using Write Blockers

Write blockers are an important tool for both forensic investigation and forensic drive image acquisition. During drive acquisition, using a write blocker can ensure that attaching the drive to a forensic copy device or workstation does not result in modifications being made to the drive, thus destroying the forensic integrity of the process. The same capability to prevent writes is useful during forensic analysis of drives and other media because it ensures that no modifications are made to the drive accidentally.

  • Hardware write blockers prevent writes from occurring while a drive is connected through them. Hardware write blockers can be certified to a NIST standard, and testing information is available via the NIST Computer Forensics Tool Testing program at www.cftt.nist.gov/hardware_write_block.htm.
  • Software write blockers are typically less popular than hardware write blockers, making them less common. Due to the possibility of problems, hardware write blockers are more frequently used when preventing writes from occurring is important.

Verifying Images

Image verification is critical to ensuring that your data is forensically sound. Commercial tools use built-in verification capabilities to make sure the entire image matches the original. When investigators use dd or other manual imaging tools, md5sum or sha1sum hashing utilities are frequently used to validate images. Each time you generate an image, you should record the hash or verification information for both the original and the cloned copy, and that information should be recorded in your forensic logbook or chain-of-custody form. FTK's Imager Lite will display the hash values in a report at the end of the process, as shown in Figure 13.9.

Snapshot of the FTK image hashing and bad sector checking.

FIGURE 13.9 FTK image hashing and bad sector checking

Imaging Live Systems

When systems are using full disk encryption, or when applications, malware, or other software may be memory resident without a copy on the disk, an image may need to be collected while the system is running.

Live imaging may not obtain some desirable data:

  • Live imaging can leave remnants due to the imaging utility being mounted from a removable drive or installed.
  • The contents of a drive or memory may change during the imaging process.
  • Malware or other software may be able to detect the imaging tool and could take action to avoid it or disable it.
  • Live images typically do not include unallocated space.

Both commercial and open source tools provide portable versions that can be loaded on a live system to provide live imaging capabilities.

Acquiring Other Data

There are many other types of specialized data beyond drive images that you may want to specifically target during acquisition. Fortunately, in most cases, forensic images of the host drives will also provide access to that data if it is resident on the systems. A few of the other areas you may want to specifically target include log data, USB device histories, application data, browser cache and history, email, and user-generated files.

Acquiring and Reviewing Log Data

Log data is often stored remotely and may not be accurate in the case of a compromised machine or if an administrator was taking actions they wanted to conceal. At other times an investigation may involve actions that are logged centrally or on network devices, but not on a single local system or device that you are likely to create a forensic image of. In those cases, preserving logs is important and will require additional work.

To preserve and analyze logs:

  • Determine where the logs reside and what format they are stored in.
  • Determine the time period that you need to preserve. Remember that you may want to obtain logs from a longer period in case you find out that an issue or compromise started before you initially suspected.
  • Work with system or device administrators to obtain a copy of the logs and document how the logs were obtained. Checksums or other validation are often appropriate.
  • Identify items of interest. This might include actions, user IDs, event IDs, timeframes, or other elements identified in your scope.
  • Use log analysis tools like Splunk, Sawmill, Event Log Analyzer, or even a text editor to search and review the logs.

Viewing USB Device History

Windows tracks the history of USB devices connected to a system, providing a useful forensic record of thumb drives and other devices. USB Historian can be used to review this based on a mounted drive image. During a forensic examination, the information provided by USB Historian or similar tools can be used to match an inventory of drives to those used on a computer, or to verify whether specific devices were in use at a given time. USB Historian, shown in Figure 13.10, provides such data as the system name, the device name, its serial number, the time it was in use, the vendor ID of the device, what type of device it is, and various other potentially useful information.

Snapshot of the USB Historian drive image.

FIGURE 13.10 USB Historian drive image

Capturing Memory-Resident Data

Shutting down a system typically results in the loss of the data stored in memory. That means that forensic data like information in a browser memory cache or program states will be lost. Although capture information in memory isn't always important in a forensic investigation, it is critical to be able to capture memory when needed.

There are a number of popular tools for memory captures, with a variety of capabilities, including the following:

  • fmem and LiME, both Linux kernel modules that allow access to physical memory. fmem is designed to be used with dd or similar tools; LiME directly copies data to a designated path and file.
  • DumpIt, a Windows memory capture tool that simply copies a system's physical memory to the folder where the DumpIt program is. This allows easy capture to a USB thumb drive and makes it a useful part of a forensic capture kit.
  • The Volatility Framework supports a broad range of operating systems, including Windows, Linux, and macOS, and has a range of capabilities, including tools to extract encryption keys and passphrases, user activity analysis, and rootkit analysis.
  • Both EnCase and FTK have built-in memory capture and analysis capabilities as well.

Using Core Dumps and Hibernation Files

In addition to memory images, core dumps and crash dump files can provide useful forensic information, both for criminal and malware investigations. Since they contain the contents of live memory, they can include data that might not otherwise be accessible on the drive of a system, such as memory-resident encryption keys, malware that runs only in memory, and other items not typically stored to the disk.

The Windows crash dump file can be found by checking the setting found under Control Panel ➢ System And Security ➢ System ➢ Advanced System Settings ➢ Startup And Recovery ➢ Settings. Typically, crash dump files will be located in the system root directory: %SystemRoot%MEMORY.DMP. Windows memory dump files can be analyzed using WinDbg; however, you shouldn't need to analyze a Windows kernel dump for the CySA+ exam.

Acquisitions from Mobile Devices

Mobile device forensic acquisition typically starts with disabling the device's network connectivity and then ensuring that access to the device is possible by disabling passcodes and screen lock functionality. Once this is done, physical acquisition of the SIM card, media cards, and device backups occurs. Finally, the device is imaged, although many devices may be resistant to imaging if the passcode is not known or the device is locked.

There are four primary modes of data acquisition from mobile devices:

  • Physical, by acquisition of the SIM card, memory cards, or backups
  • Logical, which usually requires a forensic tool to create an image of the logical storage volumes
  • Manual access, which involves reviewing the contents of the live, unlocked phone and taking pictures and notes about what is found
  • Filesystem, which can provide details of deleted files as well as existing files and directories

Much like desktop and server operating system forensics, a key part of mobile forensics is knowing the key file locations for useful forensic data. Table 13.2 lists some of the key locations for iOS devices.

TABLE 13.2 Key iOS file locations

Location Content
com.apple.commcenter.plist Device identification data
com.apple.Maps.plist Map search history and latitude/longitude data
SystemConfiguration/com.apple.wifi.plist Wi-Fi network data
Library/CallHistory/call_history.db Phone call logs
Library/SMS/sms.db SMS messages
Library/SMS/Attachments MMS files
Library/Safari Safari web browser data
Library/Caches/com.apple.WebAppCache/ApplicationCache.db Web browser cache
Library/Accounts/Accounts3.sqlite Account information
/private/var/mobile/Library/Caches/com.apple.routined/ Frequent location data (binary plist)

Similar information exists on Android, Windows, and other devices, although different carriers and OS versions may place data in slightly different locations. As you can see from the partial list of important files in Table 13.2, mobile phones can provide a very detailed history of an individual's location, communications, and other data if all of their data can be acquired.

Forensic Investigation: An Example

In the following section, you will learn the basics of a forensic analysis using FTK. Since we have already discussed imaging, we will start from a previously acquired forensic image and will perform analysis, including

  • Import of the data into FTK, including indexing and case management
  • Evidence of the data leakage
  • Email communication with third parties about the files
  • Web browser information pointing to antiforensic activities
  • Evidence of application installs
  • Evidence of filesystem changes, including renaming files

Remember that a full forensic examination of a system can involve more tasks than those listed here and that the scope and direction of the investigation will help to determine what those tasks are. You are also likely to encounter additional clues that will point you in new directions for forensic examination as you explore a system image.

Importing a Forensic Image

Once you have a forensic image in hand and have made a copy to use in your investigation, you will typically import it into your forensic tool. Figure 13.11 shows how information about the case is captured as an image is imported.

Once your image has been imported into a case and properly logged, the image is then indexed and analyzed. This includes identifying file types, searching slack and unallocated space, building an index of file timestamps, and other analysis items. This can take some time, especially with large drives. Figure 13.12 shows the forensic image used for this case partially through the indexing process.

Snapshot of the initial case information and tracking.

FIGURE 13.11 Initial case information and tracking

Snapshot of the case information and tracking partly through the indexing process.

FIGURE 13.12 Case information and tracking partly through the indexing process

With indexing done, you can now begin to explore the forensic image. FTK provides a series of tabs with common evidence categories, including email, graphics, video, Internet/chat, bookmarks, and others. Most investigators will take some time to ensure that the operating system, time zone, and other computer information (such as which users have accounts on the system) are recorded at this stage.

Analyzing the Image

Since this is a data leakage case, Internet browser history and email are likely to be of particular interest. Figure 13.13 shows how email can be read via FTK's browser capability. We can see an email that was sent reading “successfully secured.” Other emails also mention a USB device, and that spy would like it if the informant can deliver the storage devices directly. This provides another clue for further investigation.

Snapshot of the email extraction.

FIGURE 13.13 Email extraction

Searching the web browser history provides more information about the informant's likely behavior. The history file for Chrome includes searches for antiforensics techniques and a visit to the antiforensics techniques page of forensicswiki.org, as shown in Figure 13.14.

Snapshot of the Web search history.

FIGURE 13.14 Web search history

Since the informant searched for antiforensic techniques, it is likely that they applied them with some degree of success. A visit to the antiforensics techniques page, as well as searches for data that was deleted or otherwise hidden, is needed.

Some of this additional information can be gathered by reviewing data cached by Windows, including install information from the local user directories. Since the sample image is a Windows 7 machine, install information resides in C:Users<username>AppDataLocalTemp. Checking there shows that iCloud was installed in the middle of the timeframe that email communications were occurring, as shown in Figure 13.15.

Snapshot of iCloud setup log with timestamp.

FIGURE 13.15 iCloud setup log with timestamp

FTK also indexes and displays deleted files, allowing you to see that CCleaner, a system cleanup program that removes browser history and cache and wipes other information useful for forensic investigations, was removed from the system in Figure 13.16, and that Eraser, a file wiping utility, appears to have been partially deleted but left a remnant directory in the Program Files folder. Both of these utilities are likely to be found as part of an antiforensics attempt, providing further evidence of the user's intention to delete evidence.

Snapshot of the CCleaner remnant data via the Index Search function.

FIGURE 13.16 CCleaner remnant data via the Index Search function

At the end of the timeline for the informant in our case, a resignation letter is created and printed. This can be found easily using a timeline of events on the system, or as part of a manual file review using the indexed list of files and searching for Microsoft Office documents, as shown in Figure 13.17.

Snapshot of the resignation letter found based on document type.

FIGURE 13.17 Resignation letter found based on document type

Reporting

The final stage of forensic investigation is preparing and presenting a report. Reports should include three major components: the goals and scope of the investigation; the target or targets of the forensic activities, including all systems, devices, and media; and a complete listing of the findings and results.

Goals of the Investigation

This section of your report should include the goals of the investigation, including the initial scope statement for the forensic activities. This section will also typically include information about the person or organization that asked for the investigation. An example of a statement of the goals of an investigation is “John Smith, the Director of Human Resources, requested that we review Alice Potter's workstation, email, and the systems she administers to ensure that the data that was recently leaked to a competitor was not sent from her email account or workstation.”

Targets

The report you create should include a list of all the devices, systems, and media that was captured and analyzed. Targets should be all listed in your tracking notes and chain-of-custody forms if you are using them. The same level of detail used to record the system or device should be used in this listing. A sample entry might read:

Alice Potter's workstation, internal inventory number 6108, Lenovo W540 laptop, with Samsung SSD serial number S12KMFBD644850, item number 344

If large numbers of devices or systems were inspected, the full listing of targets is often moved to an appendix, and the listing of what was reviewed will list a high-level overview of systems, applications, devices, and other media, with a reference to the appendix for full detail.

Findings and Analysis

Findings are the most critical part of the document and should list what was discovered, how it was discovered, and why it is important. The Stroz Friedberg forensic investigation conducted as part of a contract dispute about the ownership of Facebook provides an example of the detail needed in forensic findings, as shown in Figure 13.18. While the report is now dated, many of the same forensic artifacts and concepts still show up—although floppy disks have been replaced with flash media and cloud storage!

Snapshot of the sample forensic finding from Stroz Friedberg's Facebook contract investigation.

FIGURE 13.18 Sample forensic finding from Stroz Friedberg's Facebook contract investigation

Summary

Cybersecurity analysts need to understand the tools, techniques, and processes required to conduct forensics. Forensics toolkits are typically built around powerful forensic workstations that may run a purpose-built forensic investigation suite or may provide individual forensic utilities and tools. Toolkits also often include write blockers, forensic duplicators, media, and documentation equipment and supplies. Specialized tools exist for mobile device forensics, law enforcement, and other types of specific forensic investigations.

Forensic software provides the ability to image and analyze systems, carve filesystems, and acquire data from various types of drives and devices. It also often supports important forensic functions, allowing analysts to maintain chain-of-custody documentation to provide who had access to an image and what was done with it. Hashing and validation are also critical to prove that forensic images match the original.

The forensic process includes identifying targets, conducting acquisition and validating that the images match, analysis, and reporting. A host of specific tools, techniques, file locations, and other elements come together as part of an investigation to create a complete forensic case. In the end, a forensic report must include the goals of the investigation, the targets, a listing of what was found, and careful analysis of what that data means.

Exam Essentials

Explain the purpose of forensic software and how it provides specialized capabilities for investigations. Forensic tools include analysis utilities that can provide timelines; file validation; filesystem analysis for changes, deletions, and other details; log file viewing; and other analysis. Key data acquisition capabilities include dead, or offline system, cloning and validation via hashing, the ability to identify changes to binaries and other files, filesystem carving, chain-of-custody and activity logging, and live system imaging. Password cracking and recovery, as well as the ability to decrypt common types of encrypted files, are necessary for many systems. Mobile forensic tools provide the ability to perform the same types of activities for iOS, Android, and other mobile platforms and their unique types of data.

Know where forensic activities take place and in what contexts and environments. Forensic activities occur on the network, endpoint systems and devices, on mobile devices, and in cloud, virtualization and containerized environments. Tools like Wireshark, tcpdump, and dd are used to conduct these investigations.

Be familiar with what's involved in a forensic investigation. This stage includes scoping, identifying locations of relevant data, planning, acquisition, analysis, and reporting. Targets include system information; file modification, access, and change detail; lots; user artifacts; and stored data like memory dumps, shadow copies, and Recycle Bin contents. Acquisition requires forensic validation and care to not modify the source data, typically including the use of write blockers.

Describe what tools are used in forensic investigations to review what occurred on a targeted system or device. Chain of custody and tracking of actions taken are critical to conducting a sound forensic investigation. Tools to capture and read network traffic, such as Wireshark, as well as endpoint tools that can read email, web history, deleted files, installed files, disk, memory, and other events make analysis simpler. Forensic discoveries will often result in further work to fully understand the timeline of events on a system.

Lab Exercises

Activity 13.1: Create a Disk Image

In this exercise you will use dd to create a disk image and then verify the checksum of the image.

Part 1: Boot a Kali Linux system and mount a drive

  1. Start your Kali Linux virtual machine.
  2. Select a USB thumb drive that is formatted as FAT32 to make an image of for this practice session. A smaller drive will be faster to image, and you should make sure you image a drive smaller than the space you have available for your Kali Linux system.
  3. In the Devices menu for the running Kali virtual machine, select USB and then the drive you have inserted. The device should now show up on your Kali Linux desktop.
  4. Verify that you can navigate to the drive from the command line. Open a terminal window, then navigate to /dev/disk/by-label, and make sure you see the name of the thumb drive you have mounted.

Part 2: Clone the drive

  1. Create a temporary working directory for your volume by running the following in your terminal window:
     mkdir ~/tmp

    This will create a directory called tmp in your home directory.

  2. Create an MD5 checksum of the volume you intend to clone in your home directory:
     md5sum /dev/disk/by-label/[label of your drive]> ~/exercise7_1_original.md5
  3. Clone the volume or disk:
     dd if=/dev/disk/by-label/[label of your drive] of=~/tmp/exercise7_1_disk.img bs=64k
  4. Once this completes, verify the integrity of the image using MD5:
     md5sum ~/tmp/exercise7_1_disk.img> ~/exercise7_1_clone.md5
  5. Now compare the MD5 files. You can do that by using the more command to view the files, or you can record the values here:
    • __________________________________________
    • __________________________________________

    The values should be the same if your clone was successful.

Activity 13.2: Conduct the NIST Rhino Hunt

The National Institute of Standards and Technology provides a set of practice forensic images that can be freely downloaded and used to hone your forensic skills. You can find the full set at www.cfreds.nist.gov. For this exercise we will use the Rhino hunt scenario as well as the SANS SIFT image available from digital-forensics.sans.org/community/downloads.

  1. Run SIFT. If you prefer VMware, you can run it directly; otherwise, use the import tool to import it into VirtualBox. (If you import the VM into VirtualBox, you will need to run sudo apt-get install virtualbox-guest-dkms and then reboot to get a useful screen resolution.)
  2. Log in using the default username with the password forensics.
  3. Download the SANS Rhino hunt:
     wget http://www.cfreds.nist.gov/dfrws/DFRWS2005-RODEO.zip
  4. Unzip the Rhino hunt:
     unzip DFRWS2005-RODEO.zip
  5. Use SIFT to find the rhino pictures.
    • Mount the file:
       sudo mount -o loop, ro RHINOUSB.dd /mnt/usb
    • Review the contents of the mount:
       ls /mnt/usb

    Note that you will see only two recipes for gumbo. Something was done to this drive that overwrote the original contents, and they need to be recovered!

    Next we will recover deleted files using foremost, a utility that automatically recovers files based on file headers and other information.

  6. Create a directory for the output:
     mkdir output
  7. Run foremost against the RHINOUSB image.
     foremost -o output/ RHINOUSB.dd
  8. Review the output.

To open the file you have recovered, click the filing cabinet icon at the top left of the screen, navigate to Home ➢ Output ➢ Doc, and then double-click on the DOC file you recovered. Read to the end of the file to determine what happened to the hard drive.

Once you know where the hard drive went, you are done with this exercise. The Rhino hunt has a lot more to it, so feel free to continue based on the NIST page's instructions.

Activity 13.3: Security Tools

Match each of the following tools to the correct description:

dd A memory forensics and analysis suite
md5sum A GUI network traffic sniffer
Volatility Framework A device used to prevent forensic software from modifying a drive while accessing it
FTK Used to validate whether a drive copy is forensically sound
Eraser A Linux tool used to create disk images
Write blocker A command-line network packet sniffer
WinDbg A full-featured forensic suite
Forensic drive duplicator A tool used to review Windows memory dumps
Wireshark A drive and file wiping utility sometimes used for anti-forensic purposes
tcpdump A device designed to create a complete forensic image and validate it without a PC

Review Questions

  1. Which format does dd produce files in while disk imaging?
    1. ddf
    2. RAW
    3. EN01
    4. OVF
  2. File carving is used to find file remnants found in clusters on disks that have been only partially rewritten by new files. What is the technical term for where these files are found?
    1. Outer
    2. Slack
    3. Unallocated space
    4. Non-Euclidean
  3. Mike is looking for information about files that were changed on a Windows endpoint system. Which of the following is least likely to contain useful information for his investigation?
    1. The MFT
    2. INDX files
    3. Event logs
    4. Volume shadow copies
  4. Alice wants to copy a drive without any chance of it being modified by the copying process. What type of device should she use to ensure that this does not happen during her data acquisition process?
    1. A read blocker
    2. A drive cloner
    3. A write blocker
    4. A hash validator
  5. Frederick's organization has been informed that data must be preserved due to pending legal action. What is this type of requirement called?
    1. A retainer
    2. A legal hold
    3. A data freeze
    4. An extra-legal hold
  6. What two files may contain encryption keys normally stored only in memory on a Window system?
    1. The MFT and the hash file
    2. The Registry and hibernation files
    3. Core dumps and encryption logs
    4. Core dumps and hibernation files
  7. Jeff is investigating a system compromise and knows that the first event was reported on October 5th. What forensic tool capability should he use to map other events found in logs and files to this date?
    1. A timeline
    2. A log viewer
    3. Registry analysis
    4. Timestamp validator
  8. During her forensic copy validation process, Danielle hashed the original, cloned the image files, and received the following MD5 sums. What is likely wrong?
     b49794e007e909c00a51ae208cacb169 original.img
     d9ff8a0cf6bc0ab066b6416e7e7abf35 clone.img
    1. The original was modified.
    2. The clone was modified.
    3. dd failed.
    4. An unknown change or problem occurred.
  9. Jennifer wants to perform memory analysis and forensics for Windows, MacOS, and Linux systems. Which of the following is best suited to her needs?
    1. LiME
    2. DumpIt
    3. fmem
    4. The Volatility Framework
  10. Alex is conducting a forensic examination of a Windows system and wants to determine if an application was installed. Where can he find the Windows installer log files for a user named Jim?
    1. C:WindowsSystem 32Installers
    2. C:WindowsInstall.log
    3. C:WindowsJimInstall.log
    4. C:WindowsJimAppDataLocalTemp
  11. Kathleen needs to find data contained in memory but only has an image of an offline Windows system. Where does she have the best chance of recovering the information she needs?
    1. The Registry
    2. %SystemRoot%MEMORY.DMP
    3. A System Restore point file
    4. %SystemRoot%/WinDbg
  12. Carl does not have the ability to capture data from a cell phone using mobile forensic or imaging software, and the phone does not have removable storage. Fortunately, the phone was not set up with a PIN or screen lock. What is his best option to ensure he can see email and other data stored there?
    1. Physical acquisition
    2. Logical access
    3. Filesystem access
    4. Manual access
  13. What forensic issue might the presence of a program like CCleaner indicate?
    1. Antiforensic activities
    2. Full disk encryption
    3. Malware packing
    4. MAC time modifications
  14. Which of the following is not a potential issue with live imaging of a system?
    1. Remnant data from the imaging tool
    2. Unallocated space will be captured
    3. Memory or drive contents may change during the imaging process
    4. Malware may detect the imaging tool and work to avoid it
  15. During his investigation, Jeff, a certified forensic examiner, is provided with a drive image created by an IT staff member and is asked to add it to his forensic case. What is the most important issue that Jeff could encounter if the case goes to court and his procedures are questioned?
    1. Bad checksums
    2. Hash mismatch
    3. Antiforensic activities
    4. Inability to certify chain of custody
  16. Jeff is investigating a system that is running malware that he believes encrypts its data on the drive. What process should he use to have the best chance of viewing that data in an unencrypted form?
    1. Live imaging
    2. Offline imaging
    3. Brute-force encryption cracking
    4. Cause a system crash and analyze the memory dump
  17. Susan needs to capture network traffic from a Linux server that does not use a GUI. What packet capture utility is found on many Linux systems and works from the command line?
    1. tcpdump
    2. netdd
    3. Wireshark
    4. snifman
  18. During a forensic investigation Ben asks Chris to sit with him and to sign off on the actions he has taken. What is he doing?
    1. Maintaining chain of custody
    2. Over-the-shoulder validation
    3. Pair forensics
    4. Separation of duties
  19. Which tool is not commonly used to generate the hash of a forensic copy?
    1. MD5
    2. FTK
    3. SHA1
    4. AES
  20. Which of the following issues makes both cloud and virtualized environments more difficult to perform forensics on?
    1. Other organizations manage them.
    2. Systems may be ephemeral.
    3. No forensic tools work in both environments.
    4. Drive images cannot be verified.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset