Skip to main content
4798SecurityAccount ManagementSecurity tier 1

Event ID 4798: A user's local group membership was enumerated

Event ID 4798 records that a process queried a specific account's local group memberships. It is one of the noisiest security events on a healthy host, so the useful signal is not the event itself but the CallerProcessName, net.exe, whoami.exe, or an unfamiliar PowerShell session, paired with a sweep across many target accounts.

What Triggers Event 4798

Event 4798 fires whenever a process asks Windows which local groups a specific user account belongs to. That question gets asked constantly by entirely benign machinery: logon processing itself checks group membership to build the user's access token, management agents check it as part of routine health reporting, and countless application installers and configuration tools query it in passing. The result is one of the highest-volume, lowest-signal-per-occurrence events in the entire Security log on a healthy host.

SubjectUserSid, SubjectUserName, and SubjectLogonId identify the account under whose session the enumeration ran. TargetUserName and TargetSid identify the account whose local group memberships were listed, the account being inspected, not the one doing the inspecting. CallerProcessId and CallerProcessName are the two fields that actually make this event usable: they name the specific executable that performed the query, and that is the only practical way to separate a system health check from a reconnaissance script.

Because raw volume is meaningless here, detection has to start from the process, not the event. A small set of tools shows up disproportionately in real-world enumeration abuse: net.exe and net1.exe, the classic net user command-line path, whoami.exe, particularly whoami /groups, and PowerShell sessions invoking equivalent .NET membership APIs. None of these are inherently malicious; system administrators use them constantly for entirely legitimate troubleshooting. What matters is the context around the call, not the call itself.

The single most useful pattern to build detection around is breadth: one Subject account enumerating the local group membership of many distinct Target accounts within a short window. A legitimate administrator troubleshooting a specific user's access checks that one user, maybe a handful if the ticket touches multiple accounts. A discovery script or an attacker mapping the environment after an initial foothold checks dozens, systematically, often alphabetically or against a harvested list of usernames, a shape that has no ordinary operational reason to occur.

Target sensitivity compounds the breadth signal. Enumeration of a privileged or service account's group membership by an account outside your designated help-desk or IT-admin group is worth flagging even in isolation, since the only realistic legitimate reason to check a service account's local group memberships is troubleshooting by someone specifically responsible for that system, a narrow population that should already be known and allowlisted.

MITRE catalogs this behavior under T1069, Permission Groups Discovery, one of the standard early steps in an intrusion where an attacker who has landed on a host tries to understand what access is actually available before deciding where to move next. 4798 covers the user-centric direction of that discovery question; its sibling event, 4799, covers the same discovery goal from the opposite direction, listing who belongs to a specific group rather than what groups a specific user belongs to.

Event 4798 Fields

FieldWhat it tells youSimulated value
SubjectUserSidSID of the account that requested the enumeration.S-1-5-21-424242-1104
SubjectUserNameAccount name that requested the enumeration.j.smith
SubjectLogonIdLogon session ID of the Subject, correlates back to their 4624.0x7b2e19
TargetUserNameAccount whose local group memberships were listed.j.smith
TargetSidSID of the account whose local group memberships were listed.S-1-5-21-424242-1104
CallerProcessIdPID of the process that performed the enumeration, e.g. net.exe or whoami.exe.0xd6b5
CallerProcessNameFull path of the process that performed the enumeration.C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Inspect Event 4798 Values

Click a field to inspect the full simulated value, the way you would expand it in a SIEM event view.

Example Event 4798 Log

A representative Security entry for Event 4798, generated deterministically by our telemetry engine so every field holds a realistic, internally consistent value.

Simulated example generated by SOCSimulator Research
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Security-Auditing" />
    <EventID>4798</EventID>
    <Version>0</Version>
    <Level>0</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8020000000000000</Keywords>
    <TimeCreated SystemTime="2025-10-15T02:10:14.000Z" />
    <EventRecordID>106197</EventRecordID>
    <Channel>Security</Channel>
    <Computer>WS-SIM-001.corp.socsimulator.example</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="SubjectUserSid">S-1-5-21-424242-1104</Data>
    <Data Name="SubjectUserName">j.smith</Data>
    <Data Name="SubjectLogonId">0x7b2e19</Data>
    <Data Name="TargetUserName">j.smith</Data>
    <Data Name="TargetSid">S-1-5-21-424242-1104</Data>
    <Data Name="CallerProcessId">0xd6b5</Data>
    <Data Name="CallerProcessName">C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</Data>
  </EventData>
</Event>

Detecting Event 4798

Enumeration via a known recon binary (net.exe, whoami.exe, PowerShell) shortly after an interactive logon

Lucene is the base filter; match CallerProcessName in your SIEM.

index=wineventlog sourcetype=WinEventLog:Security EventCode=4798
| where match(Process_Name, "(?i)net\.exe|net1\.exe|whoami\.exe|powershell\.exe")
| table _time, Subject_Account_Name, Process_Name, Target_Account_Name

One Subject enumerating many distinct Target accounts in a short window (host/account discovery sweep)

index=wineventlog sourcetype=WinEventLog:Security EventCode=4798
| bucket _time span=10m
| stats dc(Target_Account_Name) as targets by _time, Subject_Account_Name
| where targets >= 15

Enumeration of a privileged account's local group membership by a non-admin

index=wineventlog sourcetype=WinEventLog:Security EventCode=4798
| lookup privileged_accounts.csv Target_Account_Name OUTPUT is_privileged
| where is_privileged="true"
| lookup helpdesk_admins.csv Subject_Account_Name OUTPUT is_helpdesk
| where isnull(is_helpdesk)
| table _time, Subject_Account_Name, Target_Account_Name

True Positive vs False Positive

Given how constantly this event fires from routine system activity, the honest starting point is that the overwhelming majority of 4798 events on any host are not worth an analyst's attention individually, and any detection strategy that tries to alert on raw occurrence will drown in noise within hours. Real signal requires narrowing to CallerProcessName, volume shape, and target sensitivity together, not any one of them alone.

CallerProcessName narrows the field meaningfully but does not resolve it on its own. Seeing net.exe or whoami.exe in this field is common during legitimate troubleshooting, scripted health checks, and countless management-tool workflows; it becomes worth a closer look specifically when it appears on a host or from an account where that kind of manual command-line troubleshooting is unusual, for example a database server that should only ever see automated management-agent queries, never an interactive net.exe invocation.

The breadth pattern, one Subject sweeping many Target accounts in a short window, is the strongest independent signal this event offers, because it has almost no benign equivalent at scale. A single administrator troubleshooting a handful of tickets in a day produces a low, irregular count; a discovery script produces a rapid, mechanical count against many accounts in a tight time window. Set the volume threshold against your own environment's baseline rather than a fixed number, since a shared IT-admin workstation used by a busy help-desk team will naturally run higher than a typical end-user machine.

Enumeration of a privileged account's memberships by a non-admin account is the clearest individual true-positive shape available from this event, since there is rarely a legitimate reason for a standard user session to be checking a service account's group memberships at all. Pair this check against your existing privileged-account inventory and an allowlist of accounts authorized to administer those systems, and the false-positive rate on this specific pattern should be close to zero.

The pattern to watch for as an escalation trigger, not just a discovery signal, is a 4798 sweep followed shortly afterward by an actual privilege-relevant action, a group-membership change, a password reset, or a new logon type the Subject account has not used before. Discovery alone is common and often benign; discovery immediately followed by action against one of the specific accounts or groups just enumerated is the correlation that turns a noisy, low-priority event into a genuine indicator worth immediate review.

Practice Investigating Event 4798

No published room targets Event 4798 directly yet. The detection skills transfer, though: practice alert triage on realistic consoles across 37 free rooms in SOCSimulator Operations.

Browse free operations

Frequently Asked Questions

What does event ID 4798 mean?
It means a process queried which local groups a specific user account belongs to. It fires extremely often from benign system and login processes, which is why the CallerProcessName field, not the event's mere existence, is what makes it useful for detection.
Why does event 4798 generate so much noise?
Windows itself checks local group membership as part of routine logon processing, application launches, and management tooling, so 4798 fires constantly in a healthy environment. A SOC has to filter to specific CallerProcessName values or unusual enumeration volume rather than alert on the raw event.
What is the difference between event 4798 and event 4799?
4798 enumerates the local group memberships of a specific USER account, TargetUserName is the account being inspected. 4799 enumerates the MEMBERS of a specific GROUP, TargetUserName is the group being inspected. Both are Permission Groups Discovery (T1069) but from opposite directions of the same query.

Sources

“Field schema (SubjectUserSid/SubjectLogonId/TargetUserName/TargetSid/CallerProcessId/CallerProcessName) for the local group membership enumeration event, and that it fires from routine system activity”

“T1069 Permission Groups Discovery is the current MITRE ATT&CK Enterprise technique covering enumeration of local and domain group membership for privilege-escalation targeting”

Event ID

Event ID 4720: User Account Created & How to Detect It

Event ID 4720 logs every new user account, local or domain. Learn the SubjectUserName vs TargetUserName fields and detec…

Read more
Event ID

Event ID 4723: Password Change Attempt (Self-Service) & Detection

Event ID 4723 fires when a user changes their own password. Learn the difference from 4724, the Audit Failure signal, an…

Read more
Event ID

Event ID 4724: Password Reset Attempt & How to Catch Mass Resets

Event ID 4724 fires when someone resets another account's password. Learn the Subject/Target fields, the 4724 vs 4723 di…

Read more
Glossary

What is Persistence? SOC Glossary

Persistence is the set of techniques an adversary uses to keep access to a compromised system after whatever gave them t…

Read more
Glossary

What is Least Privilege? SOC Glossary

The principle of least privilege states that users, processes, and systems should hold only the minimum access rights re…

Read more
Glossary

What is SIEM? SOC Glossary

Security Information and Event Management (SIEM) is a platform that aggregates, normalizes, and correlates log data from…

Read more
Career Path

SOC Analyst (Tier 1) Career Guide: Salary & Skills

Tier 1 SOC Analysts are the front line. You monitor alert queues, triage incoming detections, classify them as true or f…

Read more
Career Path

Incident Responder Career Guide: Salary & Skills

Incident Responders lead the technical response when confirmed breaches happen. You coordinate containment, run forensic…

Read more
Comparison

SOCSimulator vs. LetsDefend: Platform Comparison

SOCSimulator wins on operational realism. You get multi-tool shift simulation with SLA pressure, noise injection, and al…

Read more
Event ID

Windows Event ID Library: SOC Reference

Windows Security and Sysmon event IDs with simulated log samples, field tables, and tested detection queries.

Read more
Feature

Shift Mode: Real-Time SOC Simulation

Practice alert triage under realistic time pressure with SLA timers and noise injection.

Read more
Feature

Operations: Guided Training Operations

Structured CTF-style investigation operations covering real-world attack scenarios.

Read more