Skip to main content

The Mindset

The Windows file system isn’t just trivia — it’s a map. As a pentester you care about:
  • Where can I write?C:\ProgramData, C:\Temp, user AppData — writable spots for payloads and hijacks
  • Where do credentials hide?AppData, registry hives, config files
  • Where does the OS keep its core files?System32, WinSxS — for DLL hijacking and binary replacement

The Root Directory

In Windows the root directory is a drive letter, usually C:\ (the boot partition where the OS is installed). Other drives get other letters — D:, E:, and so on. The key directories on the boot partition:
C:\ProgramData is the Windows equivalent of Linux’s /tmp for an attacker — it’s hidden, accessible by every user, and frequently has loose permissions. The scheduled-task script in the enumeration example lived here for exactly this reason.

AppData — Where User Secrets Live

Each user profile has a hidden AppData folder with three subfolders: AppData is where applications stash saved passwords, session tokens, and config files — always worth digging through during pillaging.

File Systems

Windows supports several file systems. Three are relevant today: FAT32, exFAT, and NTFS. NTFS is the one that matters most for pentesting because it carries the permission model. Why NTFS matters to you:
  • It enforces granular file and folder permissions (the ACLs you analyze with icacls)
  • It has journaling — file additions, modifications, and deletions are logged
  • Permissions inherit from parent folders by default, which is exactly how the writable-script misconfigs happen (a loose permission high up gets inherited all the way down)
NTFS permissions are covered in depth on the Permissions & icacls page.

Exploring the File System — Command Line

dir — List Directory Contents

The /a flag shows hidden and system entries you’d otherwise miss — including things like $Recycle.Bin, pagefile.sys, and hidden config folders.

tree — Visualize Directory Structure

tree is useful for quickly understanding how an application or directory is laid out without clicking through it.

PowerShell Equivalents


Hunting Interesting Locations

A quick tour of where to look once you’ve got a shell:
The -ErrorAction SilentlyContinue flag is the PowerShell equivalent of Linux’s 2>/dev/null — it suppresses the access-denied errors that flood your output when recursing through directories you can’t fully read.

Next: NTFS Permissions & icacls — reading ACLs, spotting writable misconfigurations, and turning them into escalation.