Summery
accesschk.exe is a Sysinternals tool that checks your effective permissions on Windows objects. It is useful for privilege escalation because it can identify files, folders, services, registry keys, and other objects you can modify. Instead of enumerating everything first, you can use it to find what your current account can influence. A writable object is interesting when a privileged process, service, or scheduled task uses it. accesschk therefore helps narrow the attack surface before investigating individual execution mechanisms.
Commands
Permissions
accesschk.exe /accepteula -uws "<USER>" C:\ - Find writable files/directories recursively
accesschk.exe /accepteula -quvcw "<USER>" * or accesschk.exe /accepteula -qvcw "<GROUP>" * - Find services where your user/group has write/change permissions
accesschk.exe /accepteula -quvcw <SERVICE NAME> - Check your rights over a specific service
accesschk.exe /accepteula "<USER>" -kvuqsw hklm\System\CurrentControlSet\Services - Check what user can do to a specific Windows service registry keys
.\accesschk64.exe /accepteula -s -d C:\Scripts\ - Checks permissions of a folder and everything in it
Named pipes
accesschk.exe /accepteula -w \pipe\* -v - View all named pipes that allow write access
.\accesschk.exe /accepteula \pipe\ - View DACLs of all named pipes
.\accesschk.exe /accepteula \\.\Pipe\lsass -v - View DACLs of a specific named pipes
Flags
-q - Omit banner
-u - Suppress errors
-v - Verbose
-c - Specify name of a Windows service
-w - Show only objects that have write access
-s - Recursively scans subdirectories
-d - Shows only directories
Rights
SERVICE_ALL_ACCESS - Means full read/write control over it
FILE_ALL_ACCESS - All possible access rights