Skip to main content
Windows Users, Groups, ACLs & Services
Lesson 8 of 10

Windows Users, Groups, ACLs & Services

Inspect Windows local accounts, built-in service identities, NTFS access control lists with icacls, and service configurations with sc.exe to spot privilege risks.

Intermediate 22 min Linux & Windows
Authorised environments only — The techniques described here are used only in training labs and on systems you own or have written permission to test.

Learning objectives

  • Explain how Security Identifiers (SIDs) and local groups govern Windows access control
  • Read NTFS Discretionary Access Control Lists (DACLs) and inheritance flags using icacls
  • Distinguish LocalSystem, LOCAL SERVICE and NETWORK SERVICE privileges
  • Audit Windows service accounts, binary permissions and quoted paths using sc.exe

Recommended first: Windows Architecture, Processes & Registry BasicsPowerShell Cmdlets, Objects & PipelineLinux Users, Groups & Sudo Basics

#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):

Listing local users and Administrators members
$ 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
labuser

Beyond 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.

  1. Access RequestUser presents token SIDs and requested right
  2. Explicit Deny CheckAny matching Deny ACE blocks access immediately
  3. Allow CheckMatching Allow ACEs accumulate requested rights
  4. 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:

Reading NTFS permissions with icacls
$ 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).

Inspecting a service configuration with sc.exe
$ 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 : LocalSystem

Check three fields during every service audit:

  1. SERVICE_START_NAME: Does the service really need LocalSystem, or should it use NT AUTHORITY\LocalService or a dedicated low-privilege service account?
  2. Binary and folder ACLs: Run icacls on both invsvc.exe and its parent directory. Standard users must never have (W), (M), or (F) on binaries executed by a privileged service.
  3. Quoting of BINARY_PATH_NAME: If a path contains spaces and lacks surrounding quotes (for example, C:\Program Files\Lab Inventory\invsvc.exe without quotes), Windows probes C:\Program.exe and C:\Program Files\Lab.exe before reaching invsvc.exe. Wrapping paths with spaces in double quotes prevents this ambiguity.

#Defending and common mistakes

  • Running bare sc inside PowerShell: sc resolves to Set-Content in PowerShell, which fails or overwrites files when you meant sc.exe. Always include .exe.
  • Leaving installer folders writable by Users: Custom software installed directly into C:\App\ inherits permissive root-drive ACLs where Authenticated Users can create or modify files. Install applications under C:\Program Files\ and verify ACLs with icacls.
  • Granting LocalSystem by habit: Vendors often configure LocalSystem to avoid troubleshooting permissions. Test services under LOCAL SERVICE or 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 explicit Deny ACE 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.

Knowledge check

Sign in to take the test, complete lessons and save your progress. Log in

Practice: test your knowledge