[Day 3] 1. Disk imaging in Cyber Forensics
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 is valid but may add that it’s being phased out in favor of
netstaton modern Linux systems.ss
Netstat Options in Windows and Linux
- Important Options:
- : Displays all active connections.
-a - : Displays the executable involved.
-b - : Displays addresses and port numbers in numerical form.
-n - : Displays the routing table.
-r - : Displays per-protocol statistics.
-s - : Displays the TCP connections.
-t
Showing All Processes
- Linux Command:
ps - Windows Command:
tasklist - provides detailed process information on Linux, and
ps auxin Windows adds verbose output.tasklist /v
First Responder Steps at a Cybercrime Scene
- Scenario: Hacked mail server.
- Secure the scene and prevent tampering.
- Document the state of the system.
- Take backups and imaging of critical data.
- Analyze logs for anomalies.
- 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
dd- 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.
-
Identify the disk using
.sudo fdisk -l -
Create and mount a partition:
bashsudo fdisk /dev/sda sudo mkfs.ext4 /dev/sda1 sudo mkdir /mnt/test sudo mount -t auto /dev/sda1 /mnt/test -
Perform operations, e.g., creating files, copying configuration files.
bashsudo nano report.txt sudo cp /etc/fstab . -
Unmount the partition and image it:
bashsudo umount /dev/sda1 sudo dd if=/dev/sda1 of=/image/case1.img
-
Verifying Integrity with Hashing
-
Use hashing to verify image integrity:
bashsudo 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:
bashsudo 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.
-
Mount the image:
bashsudo mkdir /mnt/dd-demo sudo mount -t auto /demo/case1.img /mnt/dd-demo/ -
Work with the mounted image:
bashsudo nano test.txt sudo umount /mnt/dd-demo
Changing Image Extensions
-
Rename the image and mount it:
bashsudo mv /demo/case1.img /demo/case1.pdf sudo mount -t auto /demo/case1.pdf /mnt/dd-demo/ -
Verify file type:
bashsudo file /demo/case1.pdf sudo file /etc/hosts
Mounting Commands Verification
-
Check mounting commands:
bashsudo 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:
bashsudo 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:
bashsudo dd if=/dev/sda1 of=/image/case1.img
-
Read Next
[Day 3] 2. Memory Forensics
**1. Information Stored in RAM for Forensics:** - RAM can contain critical evidence such as: - **Running processes**: Information about active...
[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...