Cyber Forensics

[Day 3] 1. Disk imaging in Cyber Forensics

D
DITISS Admin
••6 min read

Using Containers for Anonymity

  • Containers allow the use of tools without installation or leaving a trace.
  • Dockerfiles of images are stored locally and can be retrieved even after deletion.
  • Solution:
    • Pull an Ubuntu image.
    • Access the shell inside the container.
    • Perform tasks; commands will be removed with the container. However, container logs or misconfigured Docker setups might still leave traces. Deleting images doesn't remove associated Docker metadata unless explicitly cleared.

BitLocker Key Storage

  • The BitLocker key is stored securely in the system.
  • If the motherboard fails, accessing the encrypted hard disk may require recovery keys stored elsewhere.
  • Recovery keys are often stored in Microsoft accounts, Active Directory, or printed/saved during setup.

Checking Machine Communication

  • Command:
    netstat
  • The use of
    netstat
    is valid but may add that it’s being phased out in favor of
    ss
    on modern Linux systems.

Netstat Options in Windows and Linux

  • Important Options:
    • -a
      : Displays all active connections.
    • -b
      : Displays the executable involved.
    • -n
      : Displays addresses and port numbers in numerical form.
    • -r
      : Displays the routing table.
    • -s
      : Displays per-protocol statistics.
    • -t
      : Displays the TCP connections.

Showing All Processes

  • Linux Command:
    ps
  • Windows Command:
    tasklist
  • ps aux
    provides detailed process information on Linux, and
    tasklist /v
    in Windows adds verbose output.

First Responder Steps at a Cybercrime Scene

  • Scenario: Hacked mail server.
    1. Secure the scene and prevent tampering.
    2. Document the state of the system.
    3. Take backups and imaging of critical data.
    4. Analyze logs for anomalies.
    5. Identify potential entry points and mitigate them.

Port Mirroring

  • Port mirroring copies traffic from one port to another for monitoring.
  • Supported by some firewalls for analysis.

Imaging with
dd
Command

  • Disk/Partition Imaging: Imaging refers to creating an exact copy of the entire disk or partition, capturing all data, including files, metadata, and unused space, for analysis or backup purposes.
    1. Identify the disk using

      sudo fdisk -l
      .

    2. Create and mount a partition:

      bash
      sudo fdisk /dev/sda
      sudo mkfs.ext4 /dev/sda1
      sudo mkdir /mnt/test
      sudo mount -t auto /dev/sda1 /mnt/test
      
    3. Perform operations, e.g., creating files, copying configuration files.

      bash
      sudo nano report.txt
      sudo cp /etc/fstab .
      
    4. Unmount the partition and image it:

      bash
      sudo umount /dev/sda1
      sudo dd if=/dev/sda1 of=/image/case1.img
      

Verifying Integrity with Hashing

  • Use hashing to verify image integrity:

    bash
    sudo md5sum /dev/sda1
    md5sum /image/case1.img
    sudo sha1sum /dev/sda1
    sudo sha1sum /image/case1.img
    
    • Take screenshots of hash values.

Copying Images

  • Copy and verify integrity:

    bash
    sudo cp /image/case1.img /demo/
    sudo md5sum /image/case1.img
    sudo md5sum /demo/case1.img
    

Mounting DD Raw Format Images

The image must have a recognizable filesystem to be mounted directly.

  1. Mount the image:

    bash
    sudo mkdir /mnt/dd-demo
    sudo mount -t auto /demo/case1.img /mnt/dd-demo/
    
  2. Work with the mounted image:

    bash
    sudo nano test.txt
    sudo umount /mnt/dd-demo
    

Changing Image Extensions

  • Rename the image and mount it:

    bash
    sudo mv /demo/case1.img /demo/case1.pdf
    sudo mount -t auto /demo/case1.pdf /mnt/dd-demo/
    
  • Verify file type:

    bash
    sudo file /demo/case1.pdf
    sudo file /etc/hosts
    

Mounting Commands Verification

  • Check mounting commands:

    bash
    sudo tail -20 /var/log/auth.log | grep mount
    
  • Look for suspicious activity, e.g., mounting PDFs.

Live Hard Disk Imaging

  • Live hard disk imaging captures the state of a disk while the system is running, preserving data in its current state, including any active processes or temporary files. This contrasts with regular imaging, which is performed on a powered-off or disconnected disk to ensure data consistency and avoid changes during the imaging process.

  • Live imaging carries risks of data inconsistency and should be done cautiously.

  • Commands:

    bash
    sudo mount -t auto /dev/sda1 /mnt/test
    sudo dd if=/dev/sda1 of=/image/case2.img
    
    • Regular imaging does not involve mounting and typically uses:

      bash
      sudo dd if=/dev/sda1 of=/image/case1.img
      

Read Next

8/26/2026

[Day 3] 2. Memory Forensics

**1. Information Stored in RAM for Forensics:** - RAM can contain critical evidence such as: - **Running processes**: Information about active...

8/26/2026

[Day 3] 3. Assignment

1. Attach a 2GB hard disk to your Virtual Machine. 2. Create a partition on the attached disk and format it. 3. Mount the partition. 4. Create a di...