My Note 3-5
My Note 3-5
Module-3
Understanding Hard Disks and File Systems
Characteristics:
- Mechanical Components: HDDs contain moving parts such as spinning platters and read write heads,
making them susceptible to wear and physical damage.
- Magnetic Storage: Data is recorded magnetically on the platters. The drive heads magnetize small areas on
the disk to represent data.
- Rotational Speed: Measured in Revolutions Per Minute (RPM), this factor significantly impacts the drive’s
performance. Common speeds include 5400 RPM and 7200 RPM for consumer drives, while high-end
enterprise models can reach up to 15,000 RPM.
- Capacity: HDDs generally offer higher storage capacities (up to 20TB and beyond) at a lower cost
compared to SSDs.
- Cost: HDDs are more affordable than SSDs on a per-gigabyte basis, making them ideal for users seeking
large storage at a lower cost.
- Durability: Due to their mechanical components, HDDs are more prone to failures and physical damage,
particularly from shocks or drops.
Performance Metrics:
1. Seek Time: Time taken for the readwrite heads to position themselves over the correct track. Typical
values range between 8 to 12 milliseconds.
2. Rotational Latency: Time taken for the platter to spin the correct sector under the readwrite head. Average
latency is half the time of one full revolution.
3. Data Transfer Rate: Measured in megabytes per second (MBs), this rate depends on platter RPM, platter
density, and the data's location on the disk.
4. Access Time: Sum of the seek time and rotational latency, representing the total time to begin reading or
writing data.
Data Arrangement:
- Tracks, Cylinders, and Sectors:
- Tracks: Concentric circles on each platter where data is stored.
- Cylinders: The collection of tracks on all platters at a given head position.
Abhi
- Sectors: Subdivisions of tracks, each typically storing 512 bytes or, in newer HDDs, 4096 bytes (4KB
sectors).
- Zoned Bit Recording (ZBR): Outer tracks of the platter store more sectors than inner tracks, increasing
overall storage capacity.
Interfaces:
HDDs use various interfaces to connect to a computer:
- IDEPATA: Older interface, slower data rates, and bulkier cables.
- SATA (Serial ATA): Most common interface, offering speeds up to 6 Gbps (SATA III).
- SCSI and SAS (Serial Attached SCSI): High-performance interfaces used in enterprise storage
environments. SAS supports more devices and faster speeds compared to traditional SCSI.
Characteristics:
- No Moving Parts: SSDs consist entirely of electronic components, making them less prone to mechanical
failure.
- NAND Flash Memory: Most SSDs use NAND-based flash memory, which is non-volatile and stores data
in memory cells.
- Performance: SSDs are much faster than HDDs. Their speed advantage is particularly noticeable in tasks
like booting up the operating system, opening applications, and file transfers.
- Form Factors: SSDs come in various sizes, including 2.5-inch drives (common in laptops), M.2 form
factors (which attach directly to the motherboard), and PCIe-based SSDs.
- Durability: Since SSDs do not have moving parts, they are more durable and less susceptible to physical
damage caused by vibrations or shocks.
- Cost: SSDs are more expensive per gigabyte than HDDs, though the price gap has been narrowing over
time.
Performance Metrics:
1. Data Transfer Rate: SSDs are significantly faster than HDDs. Typical SSDs using the SATA interface
offer readwrite speeds of 500–600 MBs, while PCIe NVMe SSDs can achieve up to 3500 MBs or more.
2. Access Time: With no moving parts, SSDs offer near-instantaneous access times, often in the range of
microseconds.
3. InputOutput Operations per Second (IOPS): SSDs can handle far more IOPS than HDDs, making them
ideal for environments where quick access to data is critical.
Types of SSDs:
1. NAND-based SSDs:
- Most common, used in consumer devices.
- MLC (Multi-Level Cell), TLC (Triple-Level Cell), and QLC (Quad-Level Cell) refer to the number of
bits stored per cell. More bits per cell result in higher density but reduced endurance and slower write
speeds.
Abhi
SSD Interfaces:
- SATA SSD: Older standard, slower than newer interfaces (limited to 6 Gbps).
- PCIe SSD: Uses PCIe lanes for significantly faster speeds (up to 32 Gbps in PCIe 4.0 and 64 Gbps in PCIe
5.0).
- NVMe (Non-Volatile Memory Express): A storage protocol designed for PCIe SSDs that leverages the
parallelism of flash storage. NVMe offers low latency and high performance, making it the preferred
interface for high-speed SSDs.
Characteristics:
- Speed: SSHDs offer better performance than traditional HDDs, though they are slower than full SSDs.
- Cost-Effective: SSHDs offer a middle ground between the cost of HDDs and SSDs, providing a balance
between capacity and speed.
- Capacity: Since most of the data is stored on the HDD portion, SSHDs can offer high storage capacities
(up to several terabytes).
Characteristics:
- Speed: PCIe SSDs with NVMe can reach speeds up to 3500 MBs for read operations, far surpassing SATA
SSDs.
- Low Latency: NVMe SSDs are designed for minimal delay, making them ideal for performance-intensive
applications like gaming, video editing, and large-scale data processing.
- Form Factors: NVMe SSDs are available in various form factors, including M.2, U.2, and add-in cards
(AIC).
Usage:
- Gaming and High-Performance Computing: PCIe and NVMe SSDs are favored in systems where
performance is paramount, such as in gaming PCs, servers, and workstations.
performance, storage efficiency, and the ability to recover from errors. Below, we’ll dive deeper into each
key component that makes up the logical structure of a hard disk.
- Components of MBR:
- Partition Table:
The MBR contains a 64-byte partition table that stores details about the partitions on the disk, including
size and type. This table can describe up to four primary partitions, with the possibility of one being an
extended partition to create logical drives.
- Disk Signature:
A unique 2-byte identifier at the end of the MBR used by the system to distinguish between different
disks.
- Limitations:
- Can only manage disks up to 2 TiB in size.
- Limited to four primary partitions. To bypass this limit, extended partitions are used to create additional
logical drives.
2. Clusters
A cluster is the smallest unit of storage that the file system can manage. Physically, a cluster is made up of
a set of continuous sectors on the disk. When files are stored, the file system assigns the necessary number
of clusters to hold the file’s data.
- Impact on Performance:
Larger clusters reduce fragmentation (when files are broken into non-contiguous blocks), improving
readwrite performance. However, they also increase slack space, especially if many small files are stored on
the disk.
- Cluster Sizing:
Abhi
Cluster size can range from 512 bytes to 4096 bytes or more, depending on the disk volume and
formatting scheme. Larger disks usually have larger clusters, but this trade-off must be managed to minimize
wasted space.
- Cluster Chaining:
Files do not need to be stored in contiguous clusters. The file system can store parts of a file in different
locations on the disk and link these clusters through a process known as cluster chaining.
3. Slack Space
Slack space is the unused portion of a cluster that remains after a file has been written. For example, if the
cluster size is 4096 bytes and the file only uses 3000 bytes, the remaining 1096 bytes become slack space.
- Drive Slack:
The space from the end of the last sector of the file to the end of the cluster. This space is often filled with
leftover data from the drive itself.
- Forensic Importance:
Since slack space may still contain old data from previously deleted files, forensic investigators can recover
partial or whole fragments of deleted files by analyzing slack space.
4. Lost Clusters
Lost clusters occur when the OS marks a cluster as "in use," but no file is associated with it. This happens
if files aren’t properly closed or if the system crashes while writing data.
- Impact:
Lost clusters reduce available disk space and can lead to data integrity issues. They may also slow down
system performance, as the OS struggles to manage these orphaned data blocks.
5. File Allocation Table (FAT) vs. New Technology File System (NTFS)
- Advantages of GPT:
- Larger Disk Support:
GPT can manage disks larger than 2 TiB, whereas MBR cannot.
- More Partitions:
GPT supports up to 128 partitions, while MBR is limited to four primary partitions.
- GPT Structure:
- LBA 0: Contains the protective MBR, which prevents older systems from misidentifying a GPT disk.
- LBA 1: Stores the GPT header, which points to the partition table (Partition Entry Array).
- LBA 2: Contains the Partition Entry Array, where each partition’s details are stored.
7. Disk Partitions
- Primary Partition:
Abhi
A primary partition is one that can host an operating system or data. Only one primary partition can be
active at any given time during the boot process.
- Extended Partition:
Since MBR only allows four primary partitions, extended partitions are used to create additional logical
drives. These logical drives can be used for data storage, but they cannot be used to boot the OS.
- Hidden Partitions:
Hidden partitions are often used by manufacturers for recovery purposes. These partitions are not visible to
the OS by default but can be accessed with specialized tools.
The Windows boot process varies slightly between systems using BIOS with MBR (Master Boot Record)
and those using UEFI with GPT (GUID Partition Table). Both methods have distinct phases that ensure the
operating system loads correctly.
1. Power On:
- The user presses the power button, sending a signal to the CPU.
- The CPU checks the Power Good signal from the power supply, ensuring stable voltage levels.
2. BIOS Initialization:
- The BIOS firmware initializes hardware components, loading essential firmware settings stored in the
non-volatile memory (CMOS).
Abhi
- It performs the Power-On Self-Test (POST), which checks components like RAM, CPU, keyboard, and
storage devices for functionality.
- If any hardware fails POST, the BIOS emits beep codes or displays error messages.
4. Loading MBR:
- The MBR contains the partition table and the boot code. The BIOS loads the MBR into memory.
- The MBR identifies the active partition, usually containing the Windows Boot Manager.
2. Security Phase:
- The UEFI firmware checks security settings, managing reset events and preparing the environment for
subsequent phases.
- `Get-GPT` can be used to analyze GPT structures, while `Get-BootSector` identifies whether the disk is
MBR or GPT.
- In Disk Management, users can view the partition style under the Volumes tab for any selected disk.
The Linux boot process is also composed of three major stages: BIOS, Bootloader, and Kernel.
A. BIOS Stage
1. Power On:
- Similar to Windows, the BIOS initializes when the system is powered on.
- POST checks hardware functionality.
B. Bootloader Stage
2. Kernel Loading:
- The bootloader loads the Linux kernel into memory, which is the core component of the operating
system.
Abhi
- It may also load an initial RAM disk (`initrd`), which contains temporary filesystem data required to
mount the real filesystem.
C. Kernel Stage
1. Executing initrd:
- The kernel uses the initrd image to create a temporary root filesystem.
- It executes the `init` process (or systemd), which is responsible for managing system initialization tasks.
4. User Login:
- Once services are up and running, the user is presented with a login prompt or graphical interface,
allowing them to access the system.
Bootloaders
The macOS boot process is also distinct, leveraging its unique architecture (PowerPC and Intel). It involves
several key steps that integrate hardware and software initialization.
A. BootROM Activation
B. OS Selection
1. OS Choice:
- If multiple operating systems are installed, users can hold down the Option key during startup to choose
which OS to boot.
1. Boot Loader:
- The system passes control to the boot loader (`boot.efi` for Intel Macs or `BootX` for older PowerPC
Macs).
- The boot loader is responsible for loading the macOS kernel and required components.
2. Kernel Loading:
- The boot loader loads a pre-linked version of the kernel located at
`SystemLibraryCachescom.apple.kernelcaches`.
- If the pre-linked kernel is unavailable, it attempts to load the mkext cache file, which contains device
drivers.
D. Driver Initialization
1. Driver Management:
- If the mkext cache is not found, the system searches for drivers in `SystemLibraryExtensions`.
- The kernel initializes its environment by linking loaded drivers using the IO Kit and the device tree
structure.
E. Launch Services
1. launchd Process:
- The `launchd` process replaces the older `mach_init`, responsible for running startup items and preparing
the user environment.
- It manages services and applications needed for user sessions.
2. User Login:
- Once the system is ready, the user is presented with a login screen to access their account.
Versions
FAT has three versions, distinguished by the size of entries in the FAT structure:
- FAT12: Supports fewer than 4,087 clusters.
- FAT16: Handles between 4,087 and 65,526 clusters.
- FAT32: Accommodates between 65,526 and 268,435,456 clusters.
Key Characteristics
- Cluster Size: The volume size determines the cluster size, which is a fundamental unit of disk space
allocation.
- Redundancy: FAT creates two copies of the file allocation table to safeguard against damage, and it
maintains a permanent location for the root folder.
- Usage: Commonly used in portable devices like flash drives, digital cameras, and other removable storage
devices. Its simplicity makes it compatible with many operating systems.
Key Features
- Metadata Storage: NTFS uses a system file called the Master File Table (MFT) to store metadata about
files and folders, including file names, locations, and access times. This is crucial for forensic investigations.
- Self-Repairing: NTFS is designed to recover from disk errors automatically, reducing the risk of data loss.
- Security Features: It supports file-level security, allowing users to set permissions for different files and
folders. Data can also be encrypted for additional protection using the Encrypting File System (EFS).
- Fault Tolerance: NTFS maintains a log of all changes made to files in case of a system crash, enabling
recovery with minimal data loss.
Abhi
NTFS Architecture
NTFS's architecture consists of several components:
- Master Boot Record (MBR): Contains boot code and partition information.
- Boot Sector (Volume Boot Record - VBR): The first sector in an NTFS volume that holds the boot code
and details about the file system.
- Ntldr.dll: The boot loader that accesses the NTFS file system.
- Ntfs.sys: The file system driver for NTFS.
- Kernel Mode & User Mode: NTFS operates in two modes, with kernel mode allowing direct access to
system components, while user mode restricts access for security.
System Files
NTFS maintains various system files in the root directory that are crucial for file system management:
- $MFT: Contains a record for every file.
- $LogFile: Used for recovery purposes.
- $AttrDef: Contains definitions for system and user-defined attributes.
- $BadClus: Records all bad clusters on the disk.
- $Bitmap: Contains a bitmap for the entire volume.
- $Quota: Indicates disk quota for each user.
Sparse Files
NTFS supports sparse files, which are efficient in terms of disk space. When large portions of the file
contain no data, NTFS only allocates space for the non-zero data, effectively managing disk usage.
The architecture of Linux file systems is composed of two main components: User Space and Kernel Space.
1. User Space: This is the memory area where user processes operate. It is protected from direct access to
kernel operations, providing a secure environment for user applications.
2. Kernel Space: This is where the kernel executes core functions and services. Access to kernel space is
facilitated through system calls, allowing user processes to interact with the underlying hardware and system
resources.
GNU C Library (glibc) serves as an intermediary between user space and kernel space, providing a system
call interface that connects user applications to kernel services.
Virtual File System (VFS) is an abstraction layer that enables applications to access various file systems
seamlessly. Its internal architecture consists of:
- Dispatching Layer: Provides file-system abstraction.
- Caching Mechanisms: Enhances performance by storing frequently accessed data. The main cached objects
are dentry (directory entry) and inode (index node) objects.
When a file is accessed, the dentry cache records directory levels, and the inode identifies file attributes and
locations. The caching mechanism improves performance, using techniques like least-recently-used (LRU)
algorithms to manage memory effectively.
Linux file systems follow a single hierarchical directory structure, which is defined by the Filesystem
Hierarchy Standard (FHS). This standard organizes directories and files, making the system easier to
navigate. Here’s a summary of common directories within the FHS:
| Directory | Description |
Abhi
|-----------|-------------|
| `bin` | Essential command binaries (e.g., `cat`, `ls`, `cp`) |
| `boot` | Static files for the boot loader (e.g., Kernels, Initrd) |
| `dev` | Device files (e.g., `devnull`) |
| `etc` | Host-specific configuration files |
| `home` | User home directories |
| `lib` | Libraries for binaries in `bin` and `sbin` |
| `media` | Mount points for removable media |
| `mnt` | Temporary mounted file systems |
| `opt` | Add-on application software packages |
| `root` | Home directory for the root user |
| `proc` | Virtual file system for process and kernel information |
| `run` | Runtime process information |
| `sbin` | System binaries |
| `srv` | Site-specific service data |
| `tmp` | Temporary files |
| `usr` | Secondary hierarchy for read-only user data |
| `var` | Variable data (e.g., logs, spool files) |
Developed by Remy Card, ext2 became the foundation for many Linux distributions. It uses fixed-size data
blocks and has an inode structure that describes files. Each file is identified by a unique inode number, and
the file system is managed through a superblock containing critical metadata. Key aspects include:
Ext3, introduced by Stephen Tweedie in 2001, is a journaling file system that enhances data integrity by
logging changes before they are committed to the disk. It supports large file sizes (16 GB to 2 TB) and offers
improved reliability and performance compared to ext2. Features include:
As the successor to ext3, ext4 was designed for scalability and performance. It can handle file sizes up to 16
TB and volume sizes up to 1 exbibyte. Key enhancements include:
Design:
- Boot Blocks: Initial blocks in the partition reserved for booting.
- Superblock: Contains a magic number to identify the file system as UFS and vital parameters describing
the file system's geometry, statistics, and tuning.
- Cylinder Groups: The file system is divided into cylinder groups, each containing:
- A backup copy of the superblock.
- A header with statistics and free lists.
- Numerous inodes, each representing file attributes.
- Numerous data blocks.
Structure:
1. Boot Blocks: Logical blocks 0 and 1 contain system startup information.
2. Master Directory Block (MDB): Found in logical block 2, it holds volume metadata, such as creation
timestamps and location of other volume structures. An Alternate MDB exists at the end of the volume for
utility purposes.
Abhi
3. Volume Bitmap: Starts at logical block 3 and tracks the allocation of blocks, with bits indicating used or
free status.
4. Extents Overflow File: A B-tree storing additional extents when initial extents in the Catalog File are
exhausted, also includes records of bad blocks.
5. Catalog File: Another B-tree containing records for all files and directories, with unique catalog node IDs
for efficient lookup.
Features:
- Uses B-tree data structures for improved performance.
- Supports large files up to 64 bits and file names of up to 255 characters.
- Employs a 32-bit allocation table for mapping, allowing for more allocation blocks than HFS.
Advantages:
- Efficient disk space usage.
- Compatibility with international file naming.
- Allows booting on non-Mac operating systems.
Structure:
- Container Layer: Manages volume metadata, encryption states, and snapshots.
- File-System Layer: Contains data structures for file metadata, content, and directory organization.
Key Features:
- Copy-on-Write: Allows efficient data management without overwriting existing data.
- Snapshots: Captures the state of the file system at a specific time, facilitating backups and recovery.
- Cloning: Creates duplicates of files and directories without using additional disk space.
- High Timestamp Granularity: Provides precise timestamps for file changes.
- TRIM Support: Enhances performance by allowing the operating system to inform the SSD which blocks
of data are no longer in use.
Drawbacks:
- APFS-formatted drives are incompatible with OS X 10.11 Yosemite and earlier, complicating file transfers
to older Mac devices.
- The copy-on-write feature can lead to fragmentation issues on copied files.
- APFS is not suitable for traditional HDDs due to its design optimizations for SSDs.
- Lacks support for non-volatile RAM (NVRAM), compression, and Apple Fusion Drives.
Abhi
Key Features:
- Command-Line Interface:
The Sleuth Kit's command-line tools allow for efficient data analysis through various commands. Investigators can
run scripts and automate tasks to streamline their workflow.
- Image Formats:
TSK can analyze several disk image formats, including:
- Raw images (e.g., created with the `dd` command)
- Expert Witness format (EnCase)
- Advanced Forensic Format (AFF)
- Plug-in Framework:
TSK supports a plug-in architecture, allowing users to extend its functionality by integrating additional modules that
can analyze specific file types or automate forensic processes.
Use Case:
To utilize TSK effectively, a forensic examiner first creates an image of a hard disk or USB drive using disk imaging
tools like AccessData FTK Imager. They then load this image into TSK to analyze the file system structure, locate
files, and extract data.
2. Autopsy
Autopsy is a digital forensics platform that serves as a graphical user interface (GUI) for The Sleuth Kit. It simplifies
the forensic analysis process by providing a user-friendly interface that integrates various digital forensic tools and
modules.
Key Features:
- Timeline Analysis:
This feature provides an advanced graphical event viewing interface, enabling investigators to visualize and analyze
the sequence of activities on a computer over time.
- Hash Filtering:
Autopsy includes hash filtering capabilities that allow users to flag known malicious files while ignoring known good
files. This reduces noise in the investigation and helps focus on relevant evidence.
- Keyword Search:
The platform supports indexed keyword searches, enabling investigators to find files that contain specific terms or
phrases quickly. This is crucial for locating evidence related to investigations.
- Data Carving:
Autopsy employs data carving techniques to recover deleted files from unallocated space on a disk. It can utilize
tools like PhotoRec to extract data effectively.
Use Case:
Autopsy serves as an all-in-one platform for digital forensic investigations. For instance, a forensic investigator might
analyze a suspect’s computer by creating a disk image, loading it into Autopsy, and using its various features to
recover deleted files, examine user activity, and compile evidence for reporting.
Abhi
Key Features:
- Disk Editor:
WinHex can edit data on multiple types of storage media, including:
- Hard disks
- Floppy disks
- CD-ROMs
- DVDs
- ZIP drives
- Memory cards (e.g., from cameras)
- RAM Editor:
The RAM editor feature allows access to physical RAM and virtual memory, enabling investigators to analyze
running processes and capture volatile data.
- Disk Cloning:
WinHex can create disk images and backups, ensuring that original data is preserved for examination.
- Security Features:
The software includes secure erasing capabilities to wipe confidential files and cleanse hard drives, making it useful
for data sanitization as well.
Use Case:
Abhi
WinHex is often used in scenarios where files have been deleted or systems have become corrupted. For example, an
investigator may use WinHex to recover critical documents from a damaged hard drive, analyze running processes in
memory, or securely wipe a device before disposal.
Module-4
Data Acquisition and Duplication
3. Admissibility in Court:
Courts require evidence to be collected in a manner that minimizes risk and maintains integrity.
Forensically sound acquisition practices enhance the likelihood that evidence will be accepted during legal
proceedings.
Forensic data acquisition is generally categorized into two main types: Live Data Acquisition and Dead Data
Acquisition.
Key Characteristics:
- Volatile Data Collection:
Involves collecting data stored in RAM, caches, and system registries, which are dynamic and can change
rapidly. Examples of volatile data include:
Abhi
- System Data: Information related to the current configuration and running state of the computer (e.g.,
login activity, running processes, open files, etc.).
- Network Data: Information regarding the network state (e.g., open connections, routing information, ARP
cache, etc.).
- Post-Acquisition:
After live data acquisition, investigators may proceed with static (dead) acquisition by shutting down the
system and obtaining a forensic image of the hard disk.
Potential Uses:
- Collecting data from cloud services (e.g., Dropbox or Google Drive).
- Accessing unencrypted data that may be open on the system.
Considerations:
The order of data collection should follow the principle of Order of Volatility to prioritize the most volatile
data first (e.g., registers and processor caches) and proceed to less volatile sources.
Key Characteristics:
- Unaltered Data Capture:
Non-volatile data is collected in an unaltered manner, ensuring the integrity of the evidence. Sources of
non-volatile data can include:
- Hard drives
- USB drives
- External storage media (e.g., DVDs, flash drives)
Repeatability:
Dead acquisition can be repeated on well-preserved disk evidence, allowing for comprehensive analysis.
Best practices (or rules of thumb) help ensure successful data acquisition. Here are several important
considerations:
4. Integrity Verification:
After creating duplicates, investigators must verify their integrity by comparing hash values (e.g., MD5) of
the copies against the original media.
1. Logical Acquisition
Logical acquisition involves selectively collecting specific files or directories from a storage medium rather
than capturing a complete image of the entire device. This method is utilized when investigators can identify
the exact data relevant to their investigation.
When to Use:
- Time Constraints: When the investigation needs to proceed quickly.
- Targeted Investigation: When investigators are aware of which files are crucial to the case, such as emails,
documents, or logs.
Examples:
- Email Investigations: Collecting .pst or .ost files from Microsoft Outlook. These files may contain
important communications relevant to a case.
- Database Investigations: Gathering specific records from large databases or RAID arrays, allowing for
rapid access to pertinent information.
Advantages:
- Efficiency: Fast data collection since only relevant files are extracted, reducing the time taken compared to
full imaging.
Abhi
- Reduced Storage Needs: Requires less storage space than full images, which is beneficial in environments
with limited resources.
- Focused Evidence: Allows investigators to concentrate on specific files that are likely to contain evidence,
thus streamlining the analysis process.
Considerations:
- The risk of missing important data that may not have been initially identified as relevant. Therefore, careful
planning and knowledge of the system are required.
2. Sparse Acquisition
Sparse acquisition is a method that collects only fragments of deleted or unallocated data from a storage
device. This technique focuses on areas of the disk that may contain remnants of files that are no longer
visible in the file system.
When to Use:
- Non-Exhaustive Investigations: When full imaging is unnecessary, and investigators only need to retrieve
specific remnants of data.
- Targeted Recovery: When investigators suspect that deleted data may contain critical evidence.
Advantages:
- Resource Efficient: Saves time and storage space by focusing only on potentially useful fragments of data.
- Potential Recovery of Important Evidence: May recover deleted files that are still recoverable but not
present in the standard file system view.
Considerations:
- Incomplete Recovery: There’s a possibility that important data could be overlooked, as only fragments are
retrieved.
- Requires Advanced Tools: Tools must be capable of recognizing and extracting unallocated space
effectively.
3. Bit-Stream Imaging
Bit-stream imaging is the process of creating a complete bit-by-bit copy of a storage medium. This method
captures all data, including active files, deleted files, and hidden data, ensuring a comprehensive forensic
representation of the source.
1. Bit-Stream Disk-to-Image-File:
- Description: This method allows investigators to create one or more image files of the suspect drive,
capturing the complete data structure, including all sectors and clusters.
- Common Tools: ProDiscover, EnCase, FTK, The Sleuth Kit, and X-Ways Forensics.
- Advantages:
- Full Data Preservation: Captures all data, including deleted files that may still be recoverable.
- Forensic Integrity: Maintains the original media in an unaltered state, ensuring that evidence remains
admissible in court.
Abhi
- Flexibility: The ability to create multiple copies allows for different analyses without risking original
evidence.
2. Bit-Stream Disk-to-Disk:
- Description: Used when direct imaging to an image file is not feasible, such as with outdated hardware or
specific data recovery needs. This involves making a direct copy from one disk to another.
- Tools: EnCase, SafeBack, Tableau Forensic Imager, and other specialized imaging hardware.
- Advantages:
- Efficient for Old Drives: Particularly useful for older drives where imaging software may be
incompatible.
- Real-Time Recovery: Facilitates the recovery of credentials or other data during the copying process.
- Customizable Geometry: Adjusts the geometry of the target disk to match the source, optimizing the
acquisition process.
Considerations:
- Time-Consuming: Creating a full image of a large drive can take significant time, which may be a
constraint in urgent situations.
- Storage Requirements: Requires adequate storage space to accommodate large image files, particularly for
high-capacity drives.
1. Raw Format
Raw format refers to a bit-by-bit copy of the suspect drive, creating an exact duplicate of all data, including
unallocated space and deleted files. The image is typically obtained using command-line tools, such as the
`dd` command.
Advantages:
- Fast Data Transfers: The raw format allows for rapid copying of data from the source media.
- Minor Data Read Errors Ignored: The acquisition process can overlook minor errors, ensuring that most
data is captured even if some sectors have issues.
- Wide Tool Compatibility: Most forensic tools can read raw image files, making this format versatile for
analysis.
Abhi
Disadvantages:
- Storage Requirements: The raw image requires storage space equivalent to that of the original media,
which can be significant for large drives.
- Bad Sector Handling: Open-source tools may fail to recognize or collect data from marginal (bad) sectors
effectively. Commercial tools generally handle these situations better, employing more retries to ensure data
integrity.
2. Proprietary Format
Proprietary formats are specific to commercial forensic tools. These tools acquire data from the suspect
drive and save the images in their unique formats.
Commercial forensics tools acquire data from the suspect drive and save the image files in their
own formats.
Advantages:
- Compression Options: These formats often include features to compress image files, reducing the amount
of space needed on target media.
- Segmentation: Proprietary formats can split large images into smaller segments, allowing for easier storage
on smaller media like CDs or DVDs without losing data integrity.
- Metadata Incorporation: They can embed relevant metadata within the image file, such as acquisition date,
time, hash values, and case details, which can enhance the contextual understanding of the evidence.
Disadvantages:
- Interoperability Issues: Image files created in one tool’s format may not be supported by other forensic
tools, potentially complicating cross-tool investigations.
Characteristics:
- File Extensions: AFF uses two main extensions: `.afm` for metadata and `.afd` for segmented image files.
- Simple Design: The format is designed for accessibility across multiple platforms and operating systems,
providing an open solution for forensic investigators.
Advantages:
- Compression Support: AFF supports image file compression, which can save storage space.
- Metadata Storage: It allocates space for metadata associated with images, allowing for better evidence
management.
- Internal Consistency Checks: AFF includes mechanisms for self-authentication to ensure data integrity.
Compression Algorithms:
- Zlib: Offers faster compression but is less efficient.
- LZMA: Provides more efficient compression but at the cost of slower performance.
Abhi
Characteristics:
- Object-Oriented Design: AFF4 uses generic objects (volumes, streams, graphs) to facilitate data
management and retrieval.
- Unified Data Model: It offers a consistent naming scheme and a unified approach to organizing
information, enhancing usability.
Advantages:
- Support for Large Data Sets: AFF4 can handle a vast number of images and supports various container
formats (e.g., Zip, Zip64).
- Network Storage: It allows for data to be stored over networks and supports WebDAV for imaging directly
to HTTP servers.
- Efficiency Improvements: The format supports zero-copy transformations, which enhance processing
efficiency by reducing the need for data duplication.
When determining the data acquisition format, forensic investigators must consider several factors:
1. Case Requirements: The specific needs of the investigation, including the types of data needed and their
urgency.
2. Storage Capacity: The available storage space for the acquired data and whether compression is necessary.
3. Tool Compatibility: The forensic tools available for analysis and their support for various data formats.
4. Interoperability: The ability to share and access data across different forensic tools or platforms.
The method of data acquisition chosen depends on various situational factors. Key considerations include:
- Size of the Suspect Drive: For larger drives, disk-to-image copying is typically required. If the target drive
is smaller than the suspect drive, investigators may need to reduce the data size using:
Abhi
- Microsoft Disk Compression Tools: Tools like DriveSpace or DoubleSpace can be used to exclude slack
disk space.
- Compression Methods: Archiving tools (e.g., PKZip, WinZip, WinRAR) can reduce file sizes.
- Testing Lossless Compression: By applying MD5, SHA-2, or SHA-3 hashes before and after compression
to ensure data integrity.
- Time Required to Acquire the Image: Larger drives take longer to acquire. For example, acquiring a 1 TB
drive may take over 11 hours. Investigators should prioritize acquiring only data of evidentiary value to save
time.
- Retention of the Suspect Drive: If the drive cannot be retained (e.g., in civil litigation), logical acquisition
may be necessary. If the drive can be retained, a reliable data acquisition tool should be used to create a
copy.
Choosing the right tool is paramount in forensic data acquisition, depending on the acquisition technique.
The following requirements for data acquisition tools are crucial:
Mandatory Requirements:
- No Alteration of Original Content: The tool must not modify the original data.
- Logging of IO Errors: The tool must log any input output errors in an accessible format.
- Comparison Capability: The tool must compare source and destination data and alert users if the
destination is smaller.
- Scientific Validation: Tools must pass scientific and peer review and yield repeatable results.
- Complete Acquisition: The tool must acquire all visible and hidden data sectors.
- Bit-Stream Copy: It must create a bit-stream copy when there are no errors, or a qualified bit-stream copy
when errors occur.
- Destination Size Check: The tool must ensure the destination is larger or equal to the source.
- Correct Documentation: Documentation must be accurate for expected outcomes.
Optional Requirements:
- Hash Value Calculation: The tool should compute hash values for the bit-stream copy and compare them
with the source hash.
- Logging Features: Optional logging of tool actions, settings, and errors is desirable.
- Partition Handling: The tool should allow for the creation of images of individual partitions.
- Visibility of Partition Tables: It should make the source disk partition table visible to users.
Before data acquisition, the target media must be sanitized to erase any previous data. Data sanitization
protects sensitive information from retrieval. Common methods include:
- Overwriting Data: This involves applying sequences of zeroes and ones to completely erase data. Methods
include:
- Russian Standard GOST P50739-95 (6 passes)
Abhi
Physical destruction (e.g., shredding) can also be employed for sensitive media.
Volatile data (e.g., data in RAM) is dynamic and must be acquired carefully. Actions performed on a live
system can alter data. The acquisition methods vary based on the operating system:
- Windows: Tools like Belkasoft Live RAM Capturer can capture the entire volatile memory. It's crucial to
conduct this without modifying the system to avoid data loss.
To prevent alterations to the original evidence, write protection must be enabled. This can be achieved
through:
Contingency planning involves preparing for unexpected issues during data acquisition. It is essential for
ensuring the integrity of the evidence. Plans should include:
- Creating Multiple Images: At least two copies of evidence should be made to prevent loss due to
corruption.
- Utilizing Different Imaging Tools: If multiple tools are available, use them for redundancy.
- Handling Hardware Failures: Have hardware acquisition tools ready for BIOS-level data access.
8. Validating Data Acquisition
Abhi
Validation is crucial to ensure the integrity of the acquired data. This involves calculating and comparing
hash values. Hashing algorithms like CRC-32, MD5, SHA-1, and SHA-256 can be used for validation. In
Windows, the Get-FileHash cmdlet can be employed for hash calculations, and forensic tools often include
built-in validation features.
Goals of Anti-Forensics:
- Impediment of Information Collection: Reduce the availability of relevant evidence, complicating the
investigator's task.
- Concealment of Criminal Activity: Hide or obscure actions taken by the perpetrator to avoid detection.
- Compromise Evidence Integrity: Alter evidence to mislead investigations and forensic analysis.
- Disguise Use of Anti-Forensics Tools: Remove indicators that anti-forensics measures have been applied.
Techniques of Anti-Forensics
1. DataFile Deletion
- Description: When files are deleted, the OS typically only removes the pointers to the data, marking the
space as available for future use. The actual data can often be recovered until it is overwritten.
- Implications: Although standard file deletion might seem effective, forensic investigators can often recover
deleted files using recovery tools, such as Recuva or EnCase. Advanced deletion methods, like using the
Secure Erase command, can mitigate this risk by overwriting the data.
2. Password Protection
- Description: This involves securing files or drives with passwords, limiting access to authorized users only.
- Techniques: Attackers may use strong, complex passwords, and tools like KeePass for management.
- Implications: Password cracking techniques (e.g., brute-force, dictionary attacks) can sometimes bypass
these protections. Investigators might use tools like John the Ripper or Hashcat to attempt recovery of
passwords.
3. Steganography
- Description: This technique involves concealing information within other non-suspicious files, such as
images, audio, or video.
- Tools: Software like OpenStego or Steghide enables users to hide data without significantly altering the
original file.
- Implications: Steganography can be difficult to detect with traditional forensic methods, making it a
powerful tool for evading detection.
- Description: Some file systems (e.g., NTFS) support Alternate Data Streams (ADS), which allow data to be
stored within a file in a way that is not visible through standard file operations.
- Implications: Investigators may need specialized tools (like StreamArmor or ADS Scout) to detect and
analyze these hidden streams, complicating investigations.
5. Trail Obfuscation
- Description: Manipulating system logs, timestamps, and other records to mislead forensic investigators.
This includes deleting or altering log files and timestamps.
- Tools: Log cleaning tools, such as CCleaner or BleachBit, can be employed to erase traces of user activity.
- Implications: Accurate timeline reconstruction becomes challenging for investigators, obscuring the
perpetrator's actions.
6. Artifact Wiping
- Description: Permanently removing digital evidence through specialized software that overwrites data on a
hard drive multiple times.
- Tools: Software like DBAN (Darik's Boot and Nuke) or Eraser can securely wipe data.
- Implications: This technique significantly hampers data recovery efforts, as overwritten data is much
harder to retrieve.
7. Overwriting DataMetadata
- Description: Attackers may overwrite existing data or modify metadata to obscure their activities, such as
altering the timestamps on files to mislead investigators.
- Implications: This complicates the forensic analysis and reconstruction of events, as the evidence trail
becomes less reliable.
8. Encryption
- Description: Data is encoded into an unreadable format using encryption algorithms, accessible only with
the correct decryption key.
- Tools: Common encryption tools include VeraCrypt, BitLocker, and TrueCrypt. These can encrypt
individual files or entire drives.
- Implications: Strong encryption can make data inaccessible to forensic investigators, especially if the key
is not available.
9. Program Packers
- Description: These tools compress and obfuscate executable files, making reverse engineering difficult.
- Implications: Investigators may struggle to analyze the true nature of the files, hindering malware detection
and analysis.
- Description: Some forensic tools may have vulnerabilities that attackers can exploit to evade detection or
manipulate evidence.
- Implications: If investigators rely on flawed tools, they may draw incorrect conclusions or miss critical
evidence.
Anti-forensics Countermeasures.
Anti-forensics poses significant challenges to digital forensic investigations by hindering the collection and
analysis of evidence. To combat these techniques effectively, investigators can employ various
countermeasures aimed at mitigating the impact of anti-forensics. Here’s an in-depth exploration of these
countermeasures:
- Implementation: Regularly assess and upgrade forensic tools to ensure they include the latest features and
functionalities. Conduct routine vulnerability tests on these tools to identify and address potential
weaknesses.
Anti-forensics Tools
Understanding the landscape of anti-forensics also involves recognizing the tools that may be employed by
individuals aiming to conceal their activities. Some commonly known anti-forensics tools include:
Module-5
Windows and Linux Forensics
2. Locard's Exchange Principle: This principle states that whenever two objects come into contact, they
exchange material. Thus, investigators should minimize actions that could alter volatile data in memory.
3. Use of Command-Line Tools: Command-line tools are essential for retrieving volatile data. Here are some
important commands and their usage:
- Description: This command displays the current date and time, helping investigators establish the context
of events.
5. Process Information
- Tasklist: Lists all running processes along with their process IDs (PIDs).
- Command:
tasklist
6. Process-to-Port Mapping
- Netstat (with -o switch): Displays PIDs associated with each network connection.
- Command:
netstat -ano
- Persistence: Unlike volatile data, which resides in RAM and disappears when the power is cut, non-volatile
data remains stored on disk drives or other permanent storage devices.
- Content Types: Examples include:
- Documents: Emails, spreadsheets, and word processing files.
- Deleted Files: Files that have been removed but not yet overwritten.
- Configuration Settings: Information stored in the Windows Registry about user preferences and system
settings.
- Historical Data: Logs and system events that provide insights into user actions.
- Evidence Recovery: It allows forensic investigators to retrieve evidence of criminal activity, user behavior,
and system configuration.
- Establishing Timelines: Non-volatile data helps in building a timeline of actions leading up to an incident.
- User Behavior Analysis: Understanding how users interact with the system can provide clues about their
intent and activities.
File Systems
The Windows file system is structured to manage data efficiently. Understanding its components is essential
for forensic analysis.
- File System Data: Includes information about the file system structure (e.g., NTFS, FAT32).
Abhi
Several command-line utilities can aid in the collection and analysis of non-volatile information. Here are
some key commands:
- Command:
dir /o:d
- Description: Lists files in the current directory sorted by date. This command can help identify the last
accessed or modified files, providing insights into user activity.
- Command:
dir s t:w
- Description: Recursively lists all files in the current directory and subdirectories, displaying their last
modified time. This is helpful for identifying recently modified files that may be of interest.
The Windows Registry holds a wealth of information about system configuration and user settings.
Investigators can use the following commands to access registry data.
- Command:
reg query HKLMSoftwareMicrosoftWindowsCurrentVersionUninstall
- Description: Lists all installed applications. This can help investigators identify software that may be
relevant to the investigation.
- Command:
reg query HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerRecentDocs
- Description: Displays recently accessed documents. This can provide insights into user behavior.
ESE (Extensible Storage Engine) databases store important user and system information. These files
typically have the `.edb` extension and can be examined using specific tools.
Abhi
Using ESEDatabaseView
The ESEDatabaseView utility is a powerful tool for analyzing .edb files. It presents the data in an organized
format, making it easier to extract evidence.
The Windows Search Index accelerates file searches by indexing content. The primary file is located at:
- Path:
C:ProgramDataMicrosoftSearchDataApplicationsWindowsWindows.edb
To parse the Windows Search Index, investigators can use the ESEDatabaseView tool mentioned above.
This allows for analysis of indexed data, including deleted items and user searches.
Identifying devices that were connected to the system can reveal potential avenues of attack or evidence of
data exfiltration.
Using DriveLetterView
- Features:
- Shows local, remote, and removable drives, even if they are not currently plugged in.
- Allows exporting of drive lists to various formats.
Slack space is the unused space in disk clusters that may contain remnants of previously stored files.
Analyzing this space can reveal hidden or deleted information.
Abhi
Using DriveSpy
DriveSpy can collect slack space from an entire partition, making it easier for investigators to analyze this
potentially significant data.
- Description: Check if a file is sparse, which can indicate that it may have slack space.
- Purpose: The hostname, current date and time, and the system's time zone help in correlating logs, network
traffic, and other data with the specific system and time period.
- Commands:
- Hostname: hostname
This command retrieves the system's hostname, which is useful for identifying the machine in a network.
- Time Zone:
cat etctimezone
This retrieves the current time zone configuration. You can also obtain the epoch time, which is critical for
precise event timelines:
date +%s
2. System Uptime
Abhi
- Purpose: The uptime command provides insight into how long the system has been running, which can be
crucial for determining the timeframe of malicious activities.
- Command:
uptime
This command shows the system's uptime, the number of logged-in users, and load averages for the past 1,
5, and 15 minutes.
3. Network Information
- Purpose: Network details such as active network interfaces, IP addresses, and routing tables help
investigators analyze the system's communication and detect abnormal connections.
- Commands:
- Network Interfaces and IP Addresses:
ip addr show
This command displays active network interfaces and their associated IP addresses.
- Routing Table:
Displays the kernel's routing table to trace network communication paths:
netstat -rn
4. Open Ports
- Purpose: Open ports can indicate services running on the system. Attackers often exploit these to infiltrate
networks.
- Command:
netstat -tulpn
This command lists open TCP and UDP ports and the associated processes.
- Alternative:
Use nmap to scan for open ports on the local machine:
5. Running Processes
Abhi
- Purpose: Investigating active processes helps identify malicious activities. Suspicious processes can
indicate malware, rootkits, or other threats.
- Command:
ps auxww
This command lists all processes running on the system, along with their resource consumption (e.g., CPU
and memory usage).
6. Open Files
- Purpose: Investigating open files is useful for identifying malicious programs or unusual activity.
- Command:
lsof
This lists all open files and the processes associated with them. You can filter results for specific users:
lsof -u <username>
7. Mounted Filesystems
- Purpose: Understanding the mounted filesystems helps investigators identify active disk partitions and
potential external storage devices connected to the system.
- Command:
mount
This command lists all mounted filesystems along with their mount points.
8. Kernel Modules
- Purpose: Attackers may load malicious kernel modules to manipulate the system. Investigating loaded
modules helps in identifying unauthorized changes to the kernel.
- Command:
lsmod
- Purpose: Swap memory can hold remnants of data from running processes. Investigating swap areas can
provide insight into recently running applications or files.
- Command:
Abhi
swapon --show
This lists all disk partitions, useful for identifying attached storage devices.
- Purpose: The kernel logs important system events that may not appear in user-level logs. Reviewing kernel
messages can reveal suspicious activities, such as hardware failures or attempts to access restricted
resources.
- Command:
dmesg
This command retrieves kernel messages, which can be critical in analyzing system-level events.
Here are key types of non-volatile data, along with the methods to collect them.
1. System Information
- Purpose: System information reveals essential hardware and software configurations, which help
investigators understand the environment in which an incident occurred.
- Commands:
- CPU Details:
cat proccpuinfo
This command displays detailed information about the system's CPU, including model, architecture, and
speed.
- Mount Points:
cat procselfmounts
This shows currently mounted file systems and external devices, which could be significant if external
storage was used for illicit activities.
Abhi
2. Kernel Information
- Purpose: The kernel version and configuration are critical for identifying vulnerabilities or security patches
that may have been exploited during an attack.
- Commands:
- Kernel Version:
uname -r
This provides the current kernel version, which is useful to determine if the system has outdated or
vulnerable components.
- Alternative Command:
cat procversion
or
hostnamectl | grep Kernel
- Purpose: Investigating user accounts helps identify suspicious accounts, unauthorized users, or privilege
escalation.
- Command:
- User Accounts:
cat etcpasswd
This file contains information about all user accounts on the system. Each line in the file corresponds to a
user and includes details like username, user ID, group ID, home directory, and default shell.
- Filtering Usernames:
This command lists only the usernames from the `etcpasswd` file.
- Purpose: Collecting login information helps determine who was logged into the system at the time of the
incident and if any unauthorized access occurred.
- Commands:
- Currently Logged-in Users:
w
This command shows information about users currently logged into the system.
Abhi
- Login History:
last -f varlogwtmp
This retrieves the login history, including remote access attempts and system reboots, by analyzing the
`varlogwtmp` file.
5. System Logs
- Purpose: System logs store various activities related to the system’s operations, security events, and user
actions. These logs are key sources of evidence in forensic investigations.
- Important Logs:
- Authorization Logs:
cat varlogauth.log
This file contains information about user authentication, sudo command executions, and other
authorization events.
- System Messages:
cat varlogsyslog
This retrieves general system messages, including error reports and status updates from running services.
- Kernel Logs:
cat varlogkern.log
This file stores all kernel-related messages, including initialization, errors, and warnings.
- Purpose: Different log files provide specific types of information based on the services running on the
system, such as web servers, mail servers, or database services. Understanding the contents of these logs
helps in pinpointing the timeline and scope of an attack.
- Purpose: Shell history files can reveal commands executed by users, which can provide evidence of
malicious activities or attempts to cover up traces of an attack.
- Common Locations:
- history:
cat ~._history
This file contains the history of commands executed by the user in the shell.
- Purpose: Hidden files may contain malicious scripts or files intentionally concealed by an attacker.
Investigators need to uncover these files to fully assess the extent of an attack.
- Command:
find -type f -name "."
This command lists hidden files (those starting with a `.`) throughout the system.
- Purpose: Investigating suspicious files and verifying file integrity are crucial for detecting tampered or
unauthorized files.
- Commands:
- File Information:
file <filename>
This command identifies the type of a given file, which can be useful when examining files with unknown
or altered extensions.
This command extracts printable strings from a binary file, which helps investigators search for hidden or
embedded data.
- Purpose: Investigating writable files helps identify files or directories that could have been modified during
the attack, especially if they contain unauthorized or malicious data.
Abhi
- Command:
find -type f -perm 222
This lists all writable files on the system, which may have been altered or tampered with during an
intrusion.
Memory Dumps
A memory dump (or crash dump) captures the system's memory state during failures or specific triggers.
Analyzing these dumps can reveal evidence of internal errors or potential attacks.
Crash Dumps
Crash dumps include information about system failures, providing insights into:
- Stop Messages: Error codes generated during failures.
- Loaded Drivers: Information about active drivers at the time of the crash.
- Processor State: Context of the processor when the failure occurred.
The crash dump is essential for forensic investigators, as it can indicate whether a crash was caused by a
system error or an external threat.
Abhi
To analyze memory dumps, tools such as DumpChk can be utilized. This tool verifies the integrity of the
dump files and provides summary information.
1. Userdump.exe:
- This tool allows investigators to dump process memory without terminating the process.
- The generated dump file can be analyzed using Microsoft debugging tools.
2. adplus.vbs:
- This VBScript tool can automate memory dumps based on specific conditions.
During investigations, capturing RAM is crucial for acquiring volatile data. Tools commonly used for RAM
acquisition include:
Abhi
Redline is a tool developed by FireEye for analyzing memory and identifying malicious activities. The
analysis involves:
2. Examining Processes:
- Under the ‘Processes’ tab, inspect all running processes at the time of the dump.
3. Checking Ports:
- Click on ‘Ports’ to view all network connections established by the processes.
Example:
- If `rundll32.exe` is shown to connect to a suspicious IP (e.g., `172.20.20.21` over port `4444`), further
investigation is warranted.
The Windows Registry is a hierarchical database that stores settings and configurations for the operating
system and applications. Analyzing the registry helps investigators uncover user actions, installed software,
and system settings.
2. Live Analysis:
- Use the Windows Registry Editor or tools like FTK Imager to capture registry hives from a live system.
1. Cache
Cache is a temporary storage area that holds copies of frequently accessed web resources, such as images,
scripts, and other data files. By caching these elements, browsers can quickly retrieve them, improving load
times for websites previously visited.
Purpose of Caching:
Abhi
- Improved Performance: Faster access to web resources reduces loading times and improves user
experience.
- Reduced Bandwidth Usage: By storing copies of resources locally, less data needs to be downloaded
repeatedly, saving bandwidth.
- Google Chrome:
- Location: `C:\Users{username}\AppData\Local\Google\Chrome\User\ DataDefaultCache`
- Analysis Tool: ChromeCacheView
- Functionality: Displays a list of cached files along with details like URL, content type, file size, last
accessed time, expiration time, server name, and response code.
- Mozilla Firefox:
- Location: `C:\Users<Username>\AppData\Local\MozillaFirefox\ProfilesXXXXXX.defaultcache2`
- Analysis Tool: MZCacheView
- Functionality: Similar to ChromeCacheView, it allows investigators to see cached content and associated
metadata.
- Microsoft Edge:
- Location: `C:\Users\Admin\AppData\Local\MicrosoftWindows\WebCache`
- Analysis Tool: IECacheView
- Functionality: Displays cached items along with pertinent information for forensic analysis.
2. Cookies
Cookies are small pieces of data stored on the user’s device by web browsers to remember user preferences,
login sessions, and other information between visits. Cookies can be essential for maintaining user sessions
and personalizing browsing experiences.
Types of Cookies:
- Session Cookies: Temporary cookies that are deleted once the browser is closed.
- Persistent Cookies: Remain on the user’s device for a specified period, even after the browser is closed.
- Google Chrome:
- Location: `C:Users{username}AppDataLocalGoogleChromeUser DataDefaultCookies`
- Analysis Tool: ChromeCookiesView
- Functionality: Lists all cookies with details such as hostname, path, name, value, secure status, HTTP-
only status, last accessed time, creation time, and expiration time.
- Mozilla Firefox:
- Location: `C:Users<Username>AppDataRoamingMozillaFirefoxProfilesXXXXXX.defaultcookies.sqlite`
- Analysis Tool: MZCookiesView
- Functionality: Similar capabilities to ChromeCookiesView, allowing for comprehensive cookie
examination.
Abhi
- Microsoft Edge:
- Location:
`C:UsersAdminAppDataLocalPackagesMicrosoft.MicrosoftEdge_xxxxxxxxxACMicrosoftEdgeCookies`
- Analysis Tool: EdgeCookiesView
- Functionality: Displays cookies stored by Edge, providing insights into user activity and preferences.
3. Browser History
Browser History records all the websites visited by the user, including the URLs, timestamps, and additional
metadata. This information can be pivotal for understanding a user’s online behavior and identifying any
potential criminal activities.
- Google Chrome:
- Location: `C:Users{username}AppDataLocalGoogleChromeUser DataDefaultHistory`
- Analysis Tool: ChromeHistoryView
- Functionality: Displays all visited web pages, including URL, title, visit datetime, number of visits, and
referrer information. The data can be exported into various formats for further analysis.
- Mozilla Firefox:
- Location: `C:Users<Username>AppDataRoamingMozillaFirefoxProfilesXXXXXX.defaultplaces.sqlite`
- Analysis Tool: MZHistoryView
- Functionality: Provides access to browsing history in a structured format, making it easier to analyze
user behavior over time.
- Microsoft Edge:
- Location: `C:UsersAdminAppDataLocalMicrosoftWindowsHistory`
- Analysis Tool: BrowsingHistoryView
- Functionality: Similar to the tools used for Chrome and Firefox, it offers an overview of user browsing
activity.
- Purpose: Restore points are snapshots of system settings and files at a specific time, created during
significant system events such as installations, uninstalls, or updates.
Abhi
- Importance: Investigators can analyze these directories to track changes made to application files,
including when applications were installed or removed.
b. Prefetch Files
- Purpose: Prefetch files store information about applications that have been executed on a Windows system.
- Importance: Even if an application has been uninstalled, its prefetch file remains, providing evidence of the
application's execution history.
c. Metadata
- Definition: Metadata refers to data about data, offering insights into the characteristics of files, including
their creation, access, and modification details.
- Importance: It contains evidentiary information crucial for investigations, such as timestamps, file size, and
author information.
- Purpose: Image files, especially JPEGs, often contain EXIF data, which includes metadata about the
image, such as the camera model and settings.
- Importance: Investigating EXIF data can provide context about how and when an image was taken.
- Rp.log Files:
- These log files reside in the restore point directories and indicate the creation event of a restore point,
including its type and description.
- They are instrumental for noting the date of application installations or removals.
- Change.log.x Files:
- Change.log files document changes to monitored system and application files, providing a sequence of
alterations along with original filenames.
- When a monitored file is modified, it is preserved in a restore point directory with a new name format
(e.g., Axxxxxxx.ext).
3. Prefetch Files
- Location: C:WindowsPrefetch
- Forensic Use: Investigators can correlate prefetch data with registry or Event Log information to identify
user sessions and application usage.
Prefetching
- Definition: A Windows feature to speed up application launches by collecting data for the first 10 seconds
after an application starts.
- Registry Control: The prefetching process can be controlled via:
HKEY_LOCAL_MACHINESYSTEMControlSet00xControlSessionManagerMemoryManagementPrefetch
Parameters
- EXIF Metadata:
- Commonly found in JPEG files, this data includes details such as camera settings, timestamp, and GPS
coordinates.
- Tools like Exiv2, IrfanView, and ExifTool can be used to view and extract this metadata.
5. Understanding Metadata
- What is Metadata? Metadata provides structured data about files, including details on who created,
accessed, and modified them.
- Examples of Metadata:
- Organization name
- Author name
- Computer name
- Hidden text
- Document versions
- GPS data
Usefulness in Investigations
- Metadata can reveal hidden data, identify individuals who attempted to obscure data, and correlate
information from various documents.
MAC Timestamps
- Definition: MAC timestamps refer to the Modified, Accessed, and Created times of a file.
- Storage Differences:
- FAT File System: Uses local time for timestamps.
- NTFS File System: Stores timestamps in Coordinated Universal Time (UTC).
- FAT16 System:
- Copying a file: Modification date remains, creation date updates.
- Moving a file: Both dates remain unchanged.
- NTFS System:
- Copying a file: Same behavior as FAT16.
- Moving a file: Same behavior as FAT16.
PDF Files
- Contents: PDF metadata can include the author, creation date, and application used.
- Extraction Tools: Tools such as `pdfmeta.pl` and `pdfdmp.pl` can be used to extract metadata.
Word Documents
- Metadata Characteristics: Word documents can include hidden data, previous revisions, and a list of
authors.
- Extraction Methods: Use built-in inspection tools in Microsoft Word to view metadata:
1. Click on the File tab.
2. Select Info.
3. Click Check for Issues → Inspect Document.
- Metashield Analyzer: An online tool that allows investigators to analyze file metadata.
- Usage Steps:
1. Select the file for analysis.
2. Accept terms and conditions.
3. Click Analyze to view the output.
TSK and Autopsy can be used to analyze both live and dead systems (disk images) for recovering files,
examining metadata, and tracking changes. This section explains how to use specific TSK commands and
the features of Autopsy for forensic file system analysis.
The `fsstat` command in TSK provides comprehensive information about a file system. This command helps
forensic investigators get details about the volume, such as file system type, size, layout, and timestamps. It
can also reveal file system metadata, such as the last time it was mounted or the volume ID. Knowing these
attributes helps investigators understand the structure of the file system under investigation.
Command:
- `-i` option specifies the type of input (e.g., disk image type or file type).
- `filename.extension` is the path to the disk image or file system being examined.
Output Information:
- File System Type: The type of file system (e.g., ext3, NTFS, FAT).
- Volume Size: Size of the file system in sectors or bytes.
- Mounted Timestamps: The last time the volume was mounted.
- Volume ID: A unique identifier for the volume.
- Mount Directory: The directory where the file system was last mounted.
This information can provide insight into when and how the disk was used, possibly revealing if it was
tampered with or mounted during unauthorized activities.
The `fls` command in TSK lists all files and directories on a specified image file, including deleted files.
This command is useful for quickly getting an overview of the contents of the disk image or file system
under investigation, which is crucial for identifying important files or artifacts.
Command:
Output Information:
- List of Files and Directories: Including file names, directory structures, and their inodes.
- Recently Deleted Files: These are often listed, making it possible to examine deleted data that hasn't been
fully removed from the file system.
This command is highly useful for locating files, including hidden and deleted files, that are essential in
forensic investigations.
The `istat` command is used to display detailed metadata of a file, including information about its MAC
times (Modification, Access, and Creation times), file size, access permissions, and other attributes. This is
critical in tracking user actions on files and determining the timeline of file access, modifications, and
deletions.
Command:
- `-f` option specifies the file system type (e.g., ext3, NTFS).
- `-i` option specifies the image type.
- `inode_number` is the inode number of the file whose metadata you want to inspect.
Output Information:
- MAC Times (Modification, Access, and Creation Times): These timestamps give a history of when the file
was last modified, accessed, and created, helping investigators to build a timeline of activity.
- File Size and Permissions: Size of the file and access permissions (read, write, execute).
- Other Metadata: Information such as the number of hard links to the file and the block addresses used by
the file.
The `istat` command is often used in combination with `fls` to examine specific files based on their inode
numbers.
While TSK provides command-line utilities for analyzing file systems and disk images, Autopsy provides a
graphical user interface (GUI) that makes the process easier and more intuitive. It is particularly useful for
investigators who are not familiar with command-line interfaces, as it allows them to leverage TSK’s
powerful features through a point-and-click interface.
3. File Recovery:
Autopsy can locate and recover deleted files that may still reside on the disk but are no longer visible in
the file system.
4. Timeline Analysis:
Abhi
One of the most powerful features of Autopsy is its ability to create a timeline of events. By correlating
timestamps from file system metadata, log files, and other artifacts, Autopsy helps investigators build a
detailed timeline of user activities and system events leading up to and during an incident.
5. Keyword Search:
Investigators can search for specific keywords or patterns across the file system, helping them locate
incriminating evidence such as malicious scripts, confidential data, or communication logs.
7. Reporting:
Autopsy automatically generates reports based on the analysis, including detailed logs of actions taken,
files analyzed, and key findings. These reports can be used as evidence in legal proceedings.
4. Analyze Metadata:
- Analyze MAC times, file permissions, and other attributes to track user activity and potential tampering.
Use `istat` in TSK or the metadata viewer in Autopsy.
5. Generate Reports:
- Use Autopsy’s built-in reporting tools to generate comprehensive reports, which include file listings,
metadata analysis, and keyword search results.
Web applications allow users to interact with a central server through a browser, enabling data submission
and retrieval from a database. This communication happens through standardized formats such as HTML
and XML, regardless of the operating system or browser. However, due to vulnerabilities, attackers can
exploit web applications to access sensitive information like user credentials and financial data.
Forensic investigators must examine server, network, and host machine logs to gather clues about the attack.
1. Distributed Nature: Web applications interact with various hardware and software components, making it
difficult to trace attacks as logs may be spread across multiple systems (e.g., IIS, Apache).
2. Volatile Data: Capturing livevolatile data (e.g., processes, network connections) without taking the
website offline is a challenge. Taking a site offline for imaging can impact business operations.
3. Log Volume: High-traffic websites generate large amounts of logs, making it hard to collect and analyze
them.
4. Diverse Logs: Investigators must be familiar with different web and application servers to analyze logs
that may be in various formats.
5. Anonymization Tools: Attackers often use proxies and anonymizers, making it difficult to trace them.
6. Access Restrictions: Many web applications restrict access to HTTP information, which is essential for
distinguishing between valid and malicious HTTP requests.
- Denial of Service (DoS): Legitimate users are denied access, and customers may report unavailability of
services.
- Redirecting to Malicious Sites: Users being redirected to unknown, malicious websites is a sign of an
attack.
Abhi
- Anomalies in Logs: Suspicious log entries, changes in passwords, and creation of new user accounts
indicate potential breaches.
- Error Messages: HTTP error pages like "500 Internal Server Error" can signify SQL injection attempts.
1. Interviews: Interview individuals involved to gather preliminary information about the attack.
2. Server Seizure: Identify and isolate compromised servers or devices to prevent further damage.
3. Forensic Imaging: Create forensic images of affected systems for analysis.
4. Log Collection: Gather logs from various sources, such as web server logs, SIEM tools, and web
application firewall (WAF) logs.
5. Encryption and Integrity: Use encryption and checksums to ensure log integrity during collection and
analysis.
6. Log Analysis: Analyze logs to find patterns or suspicious entries that correlate to the attack.
7. IP Tracing: Attempt to trace the attacker’s IP address, though anonymization tools may complicate this
process.
8. Documentation: Meticulously document every step of the investigation for potential legal proceedings.
IIS is a Microsoft-developed web server that handles HTTP requests and other protocols such as HTTPS,
FTP, and SMTP. It operates on Windows servers and can host websites and applications. Its log files capture
essential data that can be used in security investigations, as well as for performance monitoring. Logs play a
critical role in identifying suspicious activity and reconstructing security incidents.
- World Wide Web Publishing Service (WWW Service): Configures the HTTP.sys listener.
- Windows Process Activation Service (WAS): Manages application pools and worker processes, ensuring
the system is properly configured for the incoming requests.
Fields explained:
- `2019-12-12 06:11:41`: Timestamp of the request.
- `192.168.0.10`: Server IP address.
- `GET`: HTTP method.
- `imagescontentbg_body_1.jpg`: Requested resource.
- `192.168.0.27`: Client IP address.
- `Mozilla5.0 Chrome48.0`: Client browser information.
- `200`: HTTP status code (OK).
- `365`: Time taken to process the request in milliseconds.
The Apache HTTP Server is a highly modular, open-source web server that supports many operating
systems (Windows, Linux, macOS, etc.). Its logging capabilities capture all HTTP requests made to the
server, helping administrators troubleshoot issues and track malicious activities.
Fields explained:
- `10.10.10.10`: Client IP address.
- `Jason`: Authenticated user (if applicable).
- `[17Aug2019:00:12:34 +0300]`: Date and time.
- `"GET imagesbg.jpg HTTP1.0"`: Request method, URI, and protocol.
- `500`: HTTP status code (error).
- `1458`: Response size in bytes.
- `"http:abc.comlogin.php"`: Referer (previous page).
- `"Mozilla5.0 Firefox73.0"`: Client browser and platform.
[Wed Aug 28 13:35:38.878945 2020] [core:error] [pid 12356:tid 8689896234] [client 10.0.0.8] File not
found: imagesfolderpic.jpg
Fields explained:
- `[Wed Aug 28 13:35:38.878945 2020]`: Timestamp.
- `[core:error]`: Module and severity level.
- `[pid 12356:tid 8689896234]`: Process and thread IDs.
- `[client 10.0.0.8]`: Client IP.
- `File not found: imagesfolderpic.jpg`: Error description.
- File protection status: Windows File Protection, when disabled, leaves the system vulnerable to file
modification by attackers.
- Telnet service running: Telnet is rarely used in modern environments. Its unexpected activation can
signal unauthorized remote access attempts.
- Purpose: The NetBIOS protocol over TCPIP is used for file sharing and name resolution in a Windows
environment. Monitoring NetBIOS activity can help identify unauthorized access.
- How to Investigate:
- Check the current NetBIOS sessions.
- Look for connections from untrusted or suspicious devices attempting to use NetBIOS services for data
or resource access.
- Purpose: The `net start` command lists all active network services on the server. Attackers might install
rogue services to perform malicious activities.
- How to Investigate:
- List all running network services.
- Investigate any unfamiliar services, as they could be linked to malicious software or unauthorized
activity.
Cross-Site Scripting (XSS) is a common attack where an attacker injects malicious scripts into web pages
that users view in their browsers. These scripts are often in the form of JavaScript but can also include
HTML or CSS. Attackers aim to hijack user sessions, deface websites, or spread malware.
((%3C)|<)((%2F)|)[a-zA-Z0-9%]+((%3E)|(%253E)|>)ix
- This checks for opening and closing angle brackets `< >` or their hex equivalents in a web request, which
are typical indicators of injected HTML tags.
((%3C)|<)((%69)|i|(%49))((%6D)|m|(%4D))((%67)|g|(%47))[^n]+((%3E)|>)i
- This looks specifically for obfuscated `<img>` tags, which are often used in XSS attacks to execute
arbitrary JavaScript.
(javascript|vbscript|script|embed|object|iframe|frameset)i
- This detects various HTML tags that can be used to execute malicious code within a browser.
((%3C)|<)[^n]+((%3E)|>)I
- This generic pattern detects any HTML tags that may include CSS-based XSS attempts, looking for
opening and closing tags.
- Apache Logs:
Investigators can search through web server logs, such as Apache’s `access.log`, for malicious HTML tags
and their encoded equivalents. Tools like `grep` can be used to filter relevant log entries that contain
suspected attack payloads.
- Example log entry:
GET wordpresswp-adminadmin.php?page=newsletters-subscribers&%3Cscript%3Ealert%28XSS
%29%3C%2Fscript%3E
This log entry contains an encoded XSS script, which when decoded translates to
`<script>alert(XSS)<script>`. The log reveals the page where the attack was attempted, the timestamp, and
the client’s IP address.
- Snort Alerts:
IDS tools like Snort can generate alerts for XSS attacks. These alerts will show details such as the
attacker’s IP address, source port, and destination IP address. For example:
- Source IP: 192.168.0.233
Abhi
- SIEM Systems:
SIEM tools like Splunk collect data from multiple log sources, including web servers, IDS tools, and
WAFs. They can be configured to detect XSS attack signatures and generate alerts for further investigation.
SQL Injection (SQLi) is a common attack where an attacker exploits vulnerabilities in a web application's
database query handling. They insert or "inject" SQL queries into user inputs to manipulate database
behavior, often gaining unauthorized access to sensitive data.
- In-line comments: Inserts comments within SQL queries to disrupt pattern detection.
- Char encodingdouble encoding: Encodes characters in hexadecimal or other formats to bypass filtering.
- Toggle case: Uses mixed case to avoid simple -based filters.
- White-space manipulation: Uses encoded white spaces to bypass pattern-based detection.
(%27)|(')|(--)|(%23)|()ix
- This looks for common SQL meta-characters such as single quotes, comments (`--`), and hash (``), which
are often used in SQLi attacks.
((%3D)|(=))[^n]((%27)|(')|(--)|(%3B)|(;))i
- This detects error-based SQLi attacks by looking for a combination of the equals sign (`=`) followed by
single quotes, comments, or semicolons, which are used to terminate SQL queries.
((%27)|('))unionix
- This detects SQLi attacks that use the `UNION` keyword to combine results from multiple queries.
Similar to XSS investigations, SQLi attacks can be detected by examining logs and identifying suspicious
patterns. Below are steps to investigate SQLi:
This query contains a typical SQL injection payload attempting to bypass authentication.
- Snort Alerts:
Similar to XSS detection, Snort can generate alerts for SQLi attempts, detailing the source IP, destination
port, and other relevant information.
- SIEM Systems:
SIEM tools like Splunk are valuable for SQLi detection as they consolidate data from multiple sources,
allowing investigators to search for SQLi signatures and trace attacks. An example event from Splunk might
include:
- Attacker’s IP: 10.10.10.55
- SQL query: `' OR 1=1;--`
- Timestamp: December 11, 2019, 18:37:31