T1531

Account Access Removal

Adversaries may interrupt availability of system and network resources by inhibiting access to accounts utilized by legitimate users. Accounts may be deleted, locked, or manipulated (changed credentials, revoked permissions) to remove access. In Windows, the Net utility, Set-LocalUser, and Set-ADAccountPassword PowerShell cmdlets may be used to modify user accounts. In Linux, the passwd utility may be used to change passwords. Ransomware families such as LockerGoga, MegaCortex, and Akira use this technique to impede incident response before completing their encryption objective. LAPSUS$ has removed global admin accounts to lock organizations out of all access.

Microsoft Sentinel / Defender
kusto
let SuspiciousAccountOps = dynamic(["net user", "net.exe user", "Set-LocalUser", "Set-ADAccountPassword", "Disable-ADAccount", "Remove-ADUser", "Remove-LocalUser"]);
// Branch 1: Security Event Log — account deletion, password reset, account disable
let SecurityEventAlerts = SecurityEvent
| where TimeGenerated > ago(24h)
| where EventID in (4723, 4724, 4725, 4726, 4740)
| extend ActionType = case(
    EventID == 4723, "PasswordChangeAttempt",
    EventID == 4724, "PasswordResetAttempt",
    EventID == 4725, "AccountDisabled",
    EventID == 4726, "AccountDeleted",
    EventID == 4740, "AccountLockedOut",
    "Unknown"
)
| extend RiskScore = case(
    EventID == 4726, 90,
    EventID == 4725, 70,
    EventID == 4724, 60,
    EventID == 4723, 40,
    EventID == 4740, 30,
    10
)
| project TimeGenerated, Computer, SubjectUserName, SubjectDomainName, TargetUserName, TargetDomainName, EventID, ActionType, RiskScore, Activity
| where TargetUserName !endswith "$"
| sort by TimeGenerated desc;
// Branch 2: Process events — command-line based account manipulation
let ProcessAlerts = DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (SuspiciousAccountOps)
| extend IsNetUserDelete = ProcessCommandLine has "net user" and (ProcessCommandLine has "/delete" or ProcessCommandLine has "/del")
| extend IsNetUserPasswordChange = ProcessCommandLine has "net user" and not (ProcessCommandLine has "/delete" or ProcessCommandLine has "/del" or ProcessCommandLine has "/domain" or ProcessCommandLine has "/add")
| extend IsPowerShellAccountMod = ProcessCommandLine has_any ("Set-LocalUser", "Set-ADAccountPassword", "Disable-ADAccount", "Remove-ADUser", "Remove-LocalUser")
| extend IsLinuxPasswd = FileName =~ "passwd" and ProcessCommandLine !has "--status"
| extend RiskScore = case(
    IsNetUserDelete, 90,
    IsPowerShellAccountMod, 75,
    IsNetUserPasswordChange, 65,
    IsLinuxPasswd, 50,
    40
)
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, IsNetUserDelete, IsNetUserPasswordChange, IsPowerShellAccountMod, RiskScore
| sort by Timestamp desc;
// Branch 3: Bulk account operations — high risk signal
let BulkAccountOps = SecurityEvent
| where TimeGenerated > ago(1h)
| where EventID in (4725, 4726)
| summarize OperationCount = count(), AffectedAccounts = make_set(TargetUserName), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by Computer, SubjectUserName
| where OperationCount >= 3
| extend AlertType = "BulkAccountRemoval", RiskScore = 100;
SecurityEventAlerts
| union (ProcessAlerts | project TimeGenerated=Timestamp, Computer=DeviceName, SubjectUserName=AccountName, SubjectDomainName="", TargetUserName="", TargetDomainName="", EventID=0, ActionType="ProcessBasedAccountOp", RiskScore, Activity=ProcessCommandLine)
| union (BulkAccountOps | project TimeGenerated=FirstSeen, Computer, SubjectUserName, SubjectDomainName="", TargetUserName=tostring(AffectedAccounts), TargetDomainName="", EventID=0, ActionType=AlertType, RiskScore, Activity=tostring(OperationCount))
| sort by RiskScore desc, TimeGenerated desc
high severity high confidence

Data Sources

User Account: User Account Deletion User Account: User Account Modification User Account: User Account Authentication Process: Process Creation Command: Command Execution Windows Security Event Log Microsoft Defender for Endpoint

Required Tables

SecurityEvent DeviceProcessEvents

False Positives

  • IT help desk staff routinely resetting user passwords (Event ID 4724) during service desk ticket resolution — correlate with ticketing system activity
  • Automated account provisioning/deprovisioning via IAM tools (SailPoint, CyberArk, BeyondTrust) generating bulk account disable/delete events during employee offboarding cycles
  • Active Directory cleanup scripts run by domain admins to remove stale or orphaned computer and service accounts
  • Password policy enforcement tools forcing password resets at expiry, generating high volumes of 4723/4724 events
  • Security testing or red team exercises simulating ransomware precursor behavior in lab environments

Unlock Pro Content

Get the full detection package for T1531 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections