#Why this matters
On Linux, permissions rest on UIDs, GIDs, rwx mode bits, and systemd unit files. Windows addresses the same problem with Security Identifiers (SIDs), fine-grained NTFS Access Control Lists (ACLs), and the Service Control Manager (services.exe).
Getting these three layers right is central to Windows hardening. Most local privilege escalation paths on Windows hosts do not rely on exotic kernel exploits; they happen because an administrator ran a third-party service as LocalSystem or left a service folder writable by Users. Knowing how to inspect accounts, ACLs, and services lets you catch those gaps before anyone abuses them.
#Users, groups and Security Identifiers
Windows tracks principals internally by an immutable Security Identifier (SID) rather than by display name. For example, S-1-5-18 always identifies NT AUTHORITY\SYSTEM, and S-1-5-32-544 always identifies the local Administrators group, regardless of OS language.
You can enumerate local accounts and privileged groups with the classic net tool (or PowerShell's Get-LocalUser and Get-LocalGroupMember):
$ net user
User accounts for \\WORKSTATION-01
-------------------------------------------------------------------------------
Administrator DefaultAccount Guest
labuser WDAGUtilityAccount
$ net localgroup Administrators
Alias name Administrators
Comment Administrators have complete and unrestricted access to the computer/domain
Members
-------------------------------------------------------------------------------
Administrator
labuserBeyond human accounts, background services run under built-in service identities with very different privilege footprints:
| Identity | Local privilege | Network identity |
|---|---|---|
NT AUTHORITY\SYSTEM (LocalSystem) |
Full control of the local machine | Machine account on the domain |
NT AUTHORITY\LOCAL SERVICE |
Reduced local rights | Anonymous credentials |
NT AUTHORITY\NETWORK SERVICE |
Reduced local rights | Machine account on the domain |
Follow least privilege: services that do not need full machine control should never run as LocalSystem.
#NTFS ACLs and icacls
Linux rwx bits give permissions to one owner, one group, and everyone else. An NTFS file or directory instead carries a Discretionary Access Control List (DACL) made of ordered Access Control Entries (ACEs), allowing multiple users and groups to hold different rights on the same object.
- Access RequestUser presents token SIDs and requested right
- Explicit Deny CheckAny matching Deny ACE blocks access immediately
- Allow CheckMatching Allow ACEs accumulate requested rights
- Implicit DenyNo matching Allow ACE results in Access Denied
The golden rule of Windows ACL evaluation is that explicit Deny overrides Allow. Use icacls to inspect permissions without changing anything:
$ icacls "C:\Lab\App"
C:\Lab\App BUILTIN\Administrators:(OI)(CI)(F)
NT AUTHORITY\SYSTEM:(OI)(CI)(F)
BUILTIN\Users:(OI)(CI)(RX)Each ACE shows Principal:Flags(Permissions):
- Basic permissions:
(F)Full Control,(M)Modify,(RX)Read & Execute,(R)Read,(W)Write. - Inheritance flags:
(OI)Object Inherit (files inside inherit it),(CI)Container Inherit (subfolders inherit it),(I)Inherited from a parent folder.
If BUILTIN\Users had (M) or (W) instead of (RX) on C:\Lab\App, any signed-in standard user could modify or replace executables inside that folder.
#Auditing Windows services with sc.exe
Windows services are long-running background programs managed by services.exe, much like systemd units on Linux. Their configuration lives under HKLM\SYSTEM\CurrentControlSet\Services, and you can inspect them from the command line using sc.exe (in PowerShell, always type sc.exe, because bare sc is an alias for Set-Content).
$ sc.exe qc LabInventory
[SC] QueryServiceConfig SUCCESS
SERVICE_NAME: LabInventory
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : C:\Program Files\Lab Inventory\invsvc.exe
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : Lab Inventory Agent
DEPENDENCIES :
SERVICE_START_NAME : LocalSystemCheck three fields during every service audit:
SERVICE_START_NAME: Does the service really needLocalSystem, or should it useNT AUTHORITY\LocalServiceor a dedicated low-privilege service account?- Binary and folder ACLs: Run
icaclson bothinvsvc.exeand its parent directory. Standard users must never have(W),(M), or(F)on binaries executed by a privileged service. - Quoting of
BINARY_PATH_NAME: If a path contains spaces and lacks surrounding quotes (for example,C:\Program Files\Lab Inventory\invsvc.exewithout quotes), Windows probesC:\Program.exeandC:\Program Files\Lab.exebefore reachinginvsvc.exe. Wrapping paths with spaces in double quotes prevents this ambiguity.
#Defending and common mistakes
- Running bare
scinside PowerShell:scresolves toSet-Contentin PowerShell, which fails or overwrites files when you meantsc.exe. Always include.exe. - Leaving installer folders writable by
Users: Custom software installed directly intoC:\App\inherits permissive root-drive ACLs whereAuthenticated Userscan create or modify files. Install applications underC:\Program Files\and verify ACLs withicacls. - Granting
LocalSystemby habit: Vendors often configureLocalSystemto avoid troubleshooting permissions. Test services underLOCAL SERVICEor a dedicated account with minimal file and Registry access. - Forgetting Deny precedence: When a user is unexpectedly blocked even though their group has
(F), look for an explicitDenyACE on the resource or a parent directory.
#Summary
Windows identifies users and groups by SIDs and enforces file access through ordered ACEs inside NTFS DACLs, where explicit Deny overrides Allow. Tools such as net, icacls, and sc.exe let you audit group membership, check file inheritance flags, and verify service accounts and binary paths. Applying least privilege to service accounts and locking down service directories removes one of the most common Windows escalation paths.