Module21
Module21
Forensics
Ansh Bhawnani
Introduction to
Forensics
Module 21
Computer Forensics
▰ Digital forensic science is a branch of forensic science that focuses on the recovery
and investigation of material found in digital devices related to cybercrime.
▰ Digital forensics is the process of identifying, preserving, analyzing, and
documenting digital evidence. This is done in order to present evidence in a court of
law when required.
▰ Mainly four types:
▻ Computer Forensics
▻ Mobile Forensics
▻ Network Forensics
▻ Cloud Forensics
3
Computer Forensics
4
Forensic Career
Paths
Module 21
Computer Forensics
▰ Prerequisites
▻ Basic Computer Fundamentals (A+, Network+, Sec+ or equivalent)
▰ Job Titles
▻ Cyber Crime Investigator
▻ Cyber Forensic Investigator/Analyst/Examiner
▻ Incident Response Analyst
▰ Supplementary knowledge
▻ Pentesting
▻ Malware Analysis
▻ Security Consulting
6
Computer Forensics
Module 21
Computer Forensics
8
Computer Forensics
9
Computer Forensics
10
Computer Forensics
11
Investigation
Process
Module 21
Investigation Process
13
Investigation Process
▰ Personnel
▻ The stages of the digital forensics process require different specialist training
and knowledge
▻ Digital forensic technician: Technicians gather or process evidence at
crime scenes
▻ Digital Evidence Examiners: Examiners specialize in one area of digital
evidence
14
Investigation Process
▰ Seizure
▻ Prior to the actual examination
▻ In criminal cases this will often be performed to facilitate the preservation of
evidence.
▻ In criminal matters, law related to search warrants is applicable.
▻ Crime scene, Quarantine, Recording Status, Network and Communication,
Power, Additional items, threats and risks
15
Investigation Process
▰ Acquisition
▻ Exact sector level duplicate (or "forensic duplicate") of the media is
created, usually via a write blocking device. Also called imaging.
▻ The original drive is then returned to secure storage to prevent
tampering.
▻ The acquired image is verified by using the SHA-1 or MD5 hash
functions.
▻ Given the problems associated with imaging large drives, multiple
networked computers, file servers that cannot be shut down and cloud
resources new techniques have been developed 16
Investigation Process
▰ Analysis
▻ “An in-depth systematic search of evidence related to the suspected crime".
▻ An investigator usually recovers evidence material using a number of different
methodologies and tools The type of data include email, chat logs, images, internet
history or documents.
▻ The data can be recovered from accessible disk space, deleted (unallocated) space or
from within operating system cache files.
▻ Techniques involve keyword searching within the acquired image file, to filter out known
file types. If identified, a deleted file can be reconstructed. Acquired data is hashed and
compared to pre-compiled lists such as the Reference Data Set (RDS)
17
Investigation Process
▰ Reporting
▻ When an investigation is completed the information is often reported in a form
suitable for non-technical individuals.
▻ Reports may also include audit information and other meta-documentation.[3]
▻ When completed, reports are usually passed to those commissioning the
investigation, such as law enforcement (for criminal cases) or the employing
company (in civil cases), who will then decide whether to use the evidence in
court.
▻ Generally, the report package will consist of a written expert conclusion of the
evidence as well as the evidence itself (often presented on digital media)
18
Incident Response
Module 21
Incident Response
20
Incident Response
▰ Incident Reporting
▻ Intensity of the security breach
▻ Circumstances, which revealed vulnerability
▻ Shortcomings in the design and impact or level of weakness
▻ Entry logs related to intruder’s activity
▻ Specific help needed should be clearly defined
▻ Correct time-zone of the region and synchronization information of the system
with a National time server via NTP (Network Time Protocol)
23
Incident Response
▰ Category of Incidents
▻ Low level
▻ Loss of personal password
▻ Suspected sharing of organization’s accounts
▻ Unsuccessful scans and probes
▻ Presence of any computer virus or worms
24
Incident Response
▰ Category of Incidents
▻ Mid Level
▻ Violation of special access to a computer or computing facility
▻ Unfriendly employee termination
▻ Unauthorized storing and processing data
▻ Destruction of property related to a computer incident (less than
$100,000)
▻ Computer virus or worms of comparatively larger intensity
▻ Illegal access to buildings 25
Incident Response
▰ Category of Incidents
▻ High Level
▻ Denial of Service attacks
▻ Suspected computer break-in
▻ Computer virus or worms of highest intensity; e.g.Trojan back door.
▻ Changes to system hardware, firmware or software without
authentication.
▻ Destruction of property exceeding $100,000.
▻ Any kind of pornography, gambling or violation of law. 26
Incident Response
▰ What Is CSIRT?
▻ A team of trained professionals
▻ CSIRT members detect incidents at early stages and make reports to prevent
further incidents
▻ It secures organization’s data, hardware, and critical business policy
▻ It provides training on security awareness, intrusion detection, and penetration
testing
▻ It strengthens organization’s security
▻ Decreases the response time during future security breach
28
Hard Disks and File
Systems
Module 21
1. Hard Disks
Module 21
Hard Disks and File Systems
▰ Hard Disks
▻ A rapidly spinning platter is used as the recording medium. Heads just above the surface
of the platter are used to read data from and write data to the platter. A standard
interface connects a hard disk to a computer. Two common interfaces are IDE and SCSI.
▻ Characteristics
▻ Capacity of the hard disk
▻ Interface used
▻ Speed in rotations per minute
▻ Seek time
▻ Access time
31
▻ Transfer time
Hard Disks and File Systems
32
Hard Disks and File Systems
33
Hard Disks and File Systems
34
Hard Disks and File Systems
37
Hard Disks and File Systems
38
Hard Disks and File Systems
39
2. Master Boot
Record
Module 21
Hard Disks and File Systems
42
Hard Disks and File Systems
43
Hard Disks and File Systems
▰ MBR characteristics:
▻ Supports upto 2 TB disk
▻ Maximum 4 primary partitions, supports extended partitioning
▻ Compatible with UEFI
44
Hard Disks and File Systems
Module 21
Hard Disks and File Systems
47
Hard Disks and File Systems
48
Hard Disks and File Systems
▰ The various registry hives and their supporting files in Windows are listed below:
▻ HKEY_LOCAL_MACHINE\SAM Sam, Sam.log, Sam.sav
▻ HKEY_LOCAL_MACHINE\Security Security, Security.log, Security.sav
▻ HKEY_LOCAL_MACHINE\Software Software, Software.log, Software.sav
▻ HKEY_LOCAL_MACHINE\System System, System.alt, System.log,
System.sav
▻ HKEY_CURRENT_CONFIG System, System.alt, System.log,
System.sav, Ntuser.dat, Ntuser.dat.log
▻ HKEY_USERS\DEFAULT Default, Default.log, Default.sav
49
4. Boot Sequence
Module 21
Hard Disks and File Systems
▰ Boot Loader: A boot loader or boot manager is a program that loads the operating
system into a computer’s memory when the system is booted. Multiple-stage boot
loaders—where a number of small programs call each other, and the last program
loads the operating system —are common.
▰ Boot Sector: A boot sector is a memory sector of a hard disk, floppy disk, or similar
data storage device that contains code for bootstrapping systems. The boot sector
on a disk is always the first sector on the first track.
51
Hard Disks and File Systems
▰ If there is no battery failure, POST checks the inventoried hardware devices such as
the video card; secondary storage devices, such as hard drives and floppy drives;
ports; and other hardware devices, such as the keyboard and mouse, to check
whether they are functioning properly.
▰ CPU initialization is completed if everything is fine.
▰ The BIOS looks into the CMOS chip to find the drive where the OS is installed.
▰ The BIOS then checks the boot record of the drive to find the beginning of the OS
and the subsequent program file that initializes the OS.
▰ The BIOS copies its files into memory after OS initialization.
53
Hard Disks and File Systems
54
Windows Forensics
Module 21
1. Volatile
Information
Module 21
Windows Forensics
▻ Process memory
▻ Network status
▻ Clipboard contents
▻ Service/driver information
▻ Command history
▻ Mapped drives
▻ Shares
58
2. Non-Volatile
Information
Module 21
Windows Forensics
Module 21
Windows Forensics
63
Windows Forensics
▰ Autostart Locations
▰ USB Removable Storage Devices
▰ MountedDevices
▰ Finding Users
▰ Tracking User Activity
▰ Analyzing Restore Point Registry Settings
▰ Determining the Startup Locations
64
4. MD5 Calculation
Module 21
Windows Forensics
▰ MD5 Calculation
▻ The main MD5 algorithm operates on a 128-bit state, divided into four 32-bit
words, denoted A, B, C, and D.
▻ These are initialized to certain fixed constants. The main algorithm then
operates on each 512-bit message block in turn, each block modifying the
state. The processing of a message block consists of four similar stages,
termed rounds; each round is composed of 16 similar operations based on a
nonlinear function F, modular addition, and left rotation.
66
Windows Forensics
▰ MD5 Calculation
▻ The main MD5 algorithm operates on a 128-bit state, divided into four 32-bit
words, denoted A, B, C, and D.
▻ These are initialized to certain fixed constants. The main algorithm then
operates on each 512-bit message block in turn, each block modifying the
state. The processing of a message block consists of four similar stages,
termed rounds; each round is composed of 16 similar operations based on a
nonlinear function F, modular addition, and left rotation.
▰ Tools: ChaosMD5, Secure Hash Signature Generator, MatMD5, MD5 Checksum
Verifier
67
5. Recycler Bin
Module 21
Windows Forensics
▰ Forensic investigators are aware of the old adage that when a file is deleted, it is not
really gone.
▰ The file is simply moved to the Recycle Bin, which appears by default as the
Recycler directory at the root of each drive.
▰ As a user on a system begins to delete files through the shell, a subdirectory is
created for that user within the Recycler directory; that subdirectory is named with
the user’s security identifier, or SID. For example, the subdirectory will look
something like this:
▻ C:\RECYCLER\S-1-5-21-1454471165-630328440-725345543-1003
69
Windows Forensics
▰ When an investigator opens the Recycle Bin from the desktop, the current user’s
subdirectory is automatically opened for view. Files sent to the Recycle Bin are
maintained according to a specific naming convention. When a file is moved to the
Recycle Bin, it is renamed using the following convention:
▻ D<original drive letter of file><#>.<original extension>
70
6. NTFS Alternate
Data Streams
Module 21
Windows Forensics
▰ ADSs were added to the file system to support the Hierarchal File System (HFS)
used by the Macintosh. HFS employs resource forks so that the file system can
maintain metadata about the file, such as icons, menus, or dialog boxes.
▰ The simplest way to create an ADS is to type the following command:
▻ notepad myfile.txt:ads.txt
▻ Add some text to the Notepad window, save the file, and then close Notepad.
▻ Another way to create an ADS is to use the echo command:
▻ echo “This is another ADS test file” > myfile.txt:ads2.txt
72
Windows Forensics
▰ Typing dir or viewing the contents of the directory in Windows Explorer will show
that the file will be zero bytes in size.
▰ Yet another way to create an ADS is to use the type command to copy another file
into the ADS:
▻ type c:\windows\system32\sol.exe > myfile.txt:ads3.exe
▰ ADSs can be added to directory listings as well, using the following syntax:
▻ echo “This is an ADS attached to a directory” > :ads.txt
73
Windows Forensics
▰ Enumerating ADSs
▻ Vista allows a user to enumerate ADSs with dir using the /r switch. Lads.exe is
another tool that a user can use to list ADSs and can be run against any
directory.
▰ Removing ADSs
▻ One way to remove an ADS is to simply delete the file to which the ADS is
attached.
▻ Another option is to copy the file to a non-NTFS media like a partition
formatted in FAT, FAT32, or some other file system.
74
7. Executable File
Analysis
Module 21
Windows Forensics
76
Windows Forensics
77
Windows Forensics
78
Linux Forensics
Module 21
Linux Forensics
▰ Linux has a number of simple utilities for imaging and basic disk analysis, including
the following:
▻ dd: Copies data from an input file or device to an output file or device
▻ sfdisk and fdisk: Determines the disk structure
▻ grep: Searches files for instances of an expression or pattern
▻ md5sum and sha1sum: Create and store an MD5 or SHA-1 hash of a file or list
of files (including devices)
▻ file: Reads file header information in an attempt to ascertain its type,
regardless of name or extension
▻ xxd: Command-line hex dump tool 80
1. Data collection
Module 21
Linux Forensics
▰ Media mounting:
▻ Mount the toolkit on the external media:
▻ mount -n /mnt/cdrom
▻ Calculate the hash value of the collected file:
▻ md5sum date_compromised > date_compromised.md5
▰ Current date:
▻ Collect the current date result, presented in UTC format:
▻ nc -l -p port > date_compromised
▻ /mnt/cdrom/date -u | /mnt/cdrom/nc <remote port>
82
▻ md5sum date_compromised > date_compromised.md5
Linux Forensics
▰ Cache tables:
▻ Collect the Mac address cache table:
▻ nc -l -p <port> > arp_compromised
▻ /mnt/cdrom/arp -an | /mnt/cdrom/nc <remote port>
▻ md5sum arp_compromised > arp_compromised.md5
▰ Collect the kernel route cache table:
▻ nc -l -p <port> > route_compromised
▻ /mnt/cdrom/route -Cn | /mnt/cdrom/nc <remote port>
▻ md5sum route_compromised > route_compromised.md5 83
Linux Forensics
86
Mobile Forensics
Module 21
Mobile Forensics
▰ Seizure
▻ Digital forensics operates on the principle that evidence should always be
adequately preserved, processed, and admissible in a court of law. Some legal
considerations go hand in hand with the confiscation of mobile devices.
▰ Airplane Mode
▻ Mobile devices are often seized switched on; and since the purpose of their
confiscation is to preserve evidence, the best way to transport them is to
attempt to keep them turned on to avoid a shutdown, which would inevitably
alter files.
90
Mobile Forensics
▰ Phone Jammer
▻ A mobile phone jammer or blocker is a device which deliberately transmits
signals on the same radio frequencies as mobile phones, disrupting the
communication between the phone and the cell-phone base station.
91
Mobile Forensics
▰ Faraday bag
▻ It is a container specifically designed to isolate mobile devices from network
communications. Before putting the phone in the Faraday bag, disconnect it
from the network, disable all network connections (Wi-Fi, GPS, Hotspots, etc.),
and activate the flight mode
92
Mobile Forensics
▰ Acquisition
▻ The goal of this phase is to retrieve data from the mobile device. A locked
screen can be unlocked with the right PIN, password, pattern, or biometrics.
▻ Investigators should be attentive to any indications that may transcend the
mobile device as a physical object, because such an occurrence may affect the
collection and even preservation process.
▻ The forensic examiner should make a use of SIM Card imaging – a procedure
that recreates a replica image of the SIM Card content. As with other replicas,
the original evidence will remain intact while the replica image is being used for
analysis.
93
Mobile Forensics
94
Mobile Forensics
▰ Non-invasive methods
▻ Non-invasive methods can deal with other tasks, such as unlocking the SIM
lock or/and the operator lock, the operating system update, IMEI number
modification, etc.
▻ Manual extraction: Merely browses through the data using the mobile
device’s touchscreen or keypad. Information of interest discovered on the
phone is photographically documented.
▻ Logical extraction: Instituting a connection between the mobile device
and the forensic workstation using a USB cable, Bluetooth, Infrared or RJ-
45 cable.
95
Mobile Forensics
▰ Non-invasive methods
▻ JTAG method: Could extract data from a mobile device even when data
was difficult to access through software avenues because the device is
damaged, locked or encrypted.
▻ Hex Dump: It is performed by connecting the forensic workstation to the
device and then tunneling an unsigned code or a bootloader into the
device, each of them will carry instructions to dump memory from the
phone to the computer.
96
Mobile Forensics
▰ Invasive Methods
▻ In cases where the device is entirely non-functional due to some severe
damage, it is very likely the only way to retrieve data from the device might be
to manually remove and image the flash memory chips of the device.
▻ Chip-off: A process that refers to obtaining data straight from the mobile
device’s memory chip.
▻ Detect the memory chip typology of the device
▻ Physical extraction of the chip (for example, by unwelding it)
▻ Interfacing of the chip using reading/programming software
▻ Reading and transferring data from the chip to a PC
97
▻ Interpretation of the acquired data (using reverse engineering)
Mobile Forensics
▰ Invasive Methods
▻ Micro read: This method refers to manually taking an all-around view
through the lenses of an electron microscope and analyzing data seen on
the memory chip, more specifically the physical gates on the chip.
▻ In a nutshell, micro read is a method that demands utmost level of
expertise, it is costly and time-consuming, and is reserved for serious
national security crises.
98
Forensic Reporting
Module 21
Investigation Process
▰ Reporting
▻ When an investigation is completed the information is often reported in a form
suitable for non-technical individuals.
▻ Reports may also include audit information and other meta-documentation.[3]
▻ When completed, reports are usually passed to those commissioning the
investigation, such as law enforcement (for criminal cases) or the employing
company (in civil cases), who will then decide whether to use the evidence in
court.
▻ Generally, the report package will consist of a written expert conclusion of the
evidence as well as the evidence itself (often presented on digital media)
100
Forensic Reporting
101
HACKING
Is an art, practised through a creative mind.
102