The Mindset
On Windows, permissions are controlled by ACLs (Access Control Lists). Every file and folder has one, and it lists exactly which users and groups can do what. Your job as a pentester:- Find what you can write to — especially scripts and binaries that run as a higher-privileged user
- Find what you can read that you shouldn’t — config files, credential stores
- Spot inheritance mistakes — a loose permission set high in the tree gets inherited all the way down
How NTFS Permissions Work
An ACL is made up of ACEs (Access Control Entries). Each ACE grants or denies a specific permission to a specific user or group. The basic permission types, from least to most access:icacls — Reading Permissions
icacls is the primary command-line tool for viewing and modifying NTFS permissions.
Permission Codes
Inheritance Codes
These appear in parentheses alongside the permission and tell you where the permission comes from:
So
BUILTIN\Users:(I)(M) means the Users group has Modify rights, inherited from the parent. If your user is in Users, you can modify everything in that folder — including any script a privileged task runs from it.
Finding Writable Misconfigurations
This is the core pentest workflow. You’re looking for files or folders writable by your user (or a group you’re in) that are executed by something more privileged.Check a Specific File or Folder
Hunt Writable Files with PowerShell
accesschk (Sysinternals) — The Cleaner Way
accesschk from Sysinternals is purpose-built for this and far faster:
Modifying Permissions
Once you’ve escalated (or if you already have the rights),icacls also grants and revokes permissions:
NTFS vs Share Permissions
When accessing files over the network (SMB), two permission layers apply, and the most restrictive one wins:
So a folder might grant Everyone Full Control at the share level, but if NTFS only grants Read, you get Read. Conversely, generous NTFS permissions don’t help over the network if the share permission is restrictive. This matters when you’re enumerating SMB shares — covered on the SMB & Network Shares page.
Next: Command Line: CMD, PowerShell & WMI — the interfaces you’ll work through and how to get the most out of each.