🔏
RootGuard
HomeSOC OperationsIncident ResponseWindows ForensicsLinux ForensicsKQL Investigations
  • Welcome
    • RootGuard
      • Who Am I?
        • Professional Profile
  • Resources Hub
    • Blogs
      • Articles
        • Safeguarding SMEs: The Strategic Importance of a Security Operations Center (SOC)
      • Posts
        • Roadmap to Becoming a Cybersecurity Specialist
        • Starting a Career in Cybersecurity
        • A Guide to Landing Your First Cybersecurity Analyst Role
        • Moving from Intermediate to Expert Incident Responder
  • SOC Operations
    • Introduction
      • Development Resources
        • SOC Analysts Roadmap
        • Becoming A SOC Analyst
        • SOC Analysts Prep Interview Questions
    • Essential Skills
      • Critical Windows EventIDs to Monitor
    • Junior Analyst Skills
      • Splunk Use Cases
      • KQL Use Cases
        • Reconnaissance (TA0043)
        • Initial Access (TA0001)
        • Execution (TA0002)
        • Persistence (TA0003)
        • Privilege Escalation (TA0004)
        • Defence Evasion (TA0005)
        • Credential Access (TA0006)
        • Discovery (TA0007)
        • Lateral Movement (TA0008)
        • Collection (TA0009)
        • Command and Control (TA0011)
        • Exfiltration (TA0010)
        • Impact (TA0040)
      • Investigating Common Attacks
        • Domain Dominance Attacks - Detection & Analysis
        • Investigating a Suspected AD FS Distributed Key Management (DKM) Attack
        • Authentication From Suspicious DeviceName
        • Identifying Interactive or RemoteInteractive Session From Service Account
        • Identifying Split or Part Archive File Transfers
        • Detect Potential Cleartext Credentials in Command Line
        • Detecting Command Line Interpreters Launched via Scheduled Tasks
        • Detecting Files Containing Potentially Sensitive Data
        • Detecting DeviceNetworkEvents From Windows Processes and Domains by TLD
        • Detecting Silent cmd.exe Execution With Redirected STDERR & STDOUT
        • Detecting Low Prevalence DLL Loaded From Process In User Downloads Directory
        • Detecting Virtual Drive Mounted From Archive
        • Identify Execution of Script From User's Downloads Folder
        • Identify Potential RDP Tunneled Sessions
        • Identify Instances of PowerShell Invoke-WebRequest, IWR or Net.WebClient
        • Identify Processes Launched by PowerShell Remoting (WSMProvHost.exe)
        • Detect DeviceNetworkEvents for LOLBAS with Download or Upload Functions
        • Detect Execution of PSEXESVC via Remote Systems
        • Identify Suspicious String in Service Creation ImagePath
        • Identify File with Double Extensions
        • Detect Potential Cleartext Credentials in Commandline
        • Detect When Large Number of Files Downloaded From OneDrive or SharePoint
        • Identify and Investigate Phishing Attacks with KQL
      • PowerShell for SecOps
        • Powershell Remoting
        • Reconnaissance Discovery
        • Initial Access Discovery
        • Execution Discovery
        • Persistence Discovery
        • Privilege Escalation Discovery
        • Defence Evasion Discovery
        • Credential Access Discovery
        • Discovery
        • Lateral Movement Discovery
        • Collection Discovery
        • Command & Control (C2) Discovery
        • Exfiltration Discovery
        • Impact Discovery
      • Packet Analysis (pcap)
        • Tcpdump
        • Tcpdump (Intermediate)
        • Tshark
        • Ngrep
      • Investigating Suspicious Emails Using KQL
    • Intermediate and Advanced Skills
      • Investigate Using MITRE ATT&CK Methodology
        • Reconnaissance (TA0043) Techniques
        • Resource Development (TA0042) Techniques
        • Initial Access (TA0001) Techniques
        • Command Execution (TA0002) Techniques
        • Persistence (TA0003) Techniques
        • Privilege Escalation (TA0004) Techniques
        • Defence Evasion (TA0005) Techniques
        • Credential Access (TA0006) Techniques
        • Discovery (TA0007) Techniques
        • Lateral Movement (TA0008) Techniques
        • Collection (TA0009) Techniques
        • Command and Control (C2) (TA0011) Techniques
        • Exfiltration (TA0010) Techniques
        • Impact (TA0040) Techniques
    • Vulnerability Management
    • Malware Analysis
  • DFIR
    • Incident Response
      • Incident Triage
        • Triage Types and Processes
        • PowerShell for Detection and Analysis
          • Malware or Compromise Investigation
          • Lateral Movement Discovery
        • Registry Analysis
        • Sysinternals Intrusion Analysis
        • PowerShell Intrusion Analysis
        • Velociraptor Intrusion Analysis
        • Zimmerman Tools Intrusion Analysis
      • KAPE Artifacts Analysis
      • Velociraptor Artifacts Analysis
      • Using The Unified Kill Chain Model to Analyse Individual Cyber Attacks
        • Phase 1 - Gaining an Initial Foothold
          • Gaining Access to the Network
          • Establishing a Foothold
          • Network Discovery
      • Response Strategies
        • Privilege Escalation Assessment
        • Command and Control Assessment
        • Command Execution Assessment
        • Defence Evasion Assessment
        • Detection Assessment
        • Discovery Assessment
        • Exfiltration Assessment
        • Initial Access Assessment
        • Initial Impact Assessment Techniques
        • Lateral Movement Assessment
        • Persistence Assessment
    • Windows Forensics
      • Evidence of Execution
      • Window Artifact Analysis
        • Account Usage
        • User Activity Tracking (Event Logs)
        • Program Execution
        • File and Folder Opening
        • File Download
        • Browser Usage
        • Deleted File or File Knowledge
        • External Device & USB Usage
    • Linux Forensics
      • Linux Commandline Basics
      • Host Compromise Assessment
    • KQL for Defender & Sentinel
      • MDO (Office)
      • MDI (Identity)
      • MDE (Endpoint)
    • Memory Forensics
      • Memory Forensics (Volatility 3)
    • Playbooks
      • First Responder DFIR Playbook
        • Device Isolation
        • Evidence Collection
          • Acquire Triage Image Using KAPE
          • Acquire Triage Data Using Velociraptor
          • Acquire Triage Data Using Powershell
          • Acquire Triage Memory Image
          • Acquire Image Using FTK
          • AXIOM Cyber Data Collection
        • Windows Forensic Artefacts
          • Application Execution
          • File & Folder Knowledge
          • External Device Usage
          • Network Activity
          • Windows Event Logs
        • Initial Analysis
          • Memory Analysis (Vol 3)
          • Axiom Cyber Examiner
  • Detection Engineering
    • AD Attack Detections & Mitigations
      • Kerberoasting
      • Authentication Server Response (AS-REP) Roasting
      • Password Spraying
      • MachineAccountQuota Compromise
      • Unconstrained Delegation
      • Password in Group Policy Preferences (GPP) Compromise
      • Active Directory Certificate Services (AD CS) Compromise
      • Golden Certificate
      • DCSync
      • Dumping ntds.dit
      • Golden Ticket
      • Silver Ticket
      • Golden Security Assertion Markup Language (SAML)
      • Microsoft Entra Connect Compromise
      • One-way Domain Trust Bypass
      • Security Identifier (SID) History Compromise
      • Skeleton Key
      • Active Directory Security Controls
      • Active Directory Events for Detecting Compromise
    • Attack Triage Playbooks (KQL Triage)
      • Windows Malware Detection Playbook
      • Linux Host Intrusion Detection Playbook (CLI)
      • Linux Intrusion Detection Playbook
      • Large-Scale Compromise Detection Playbook
      • Ransomware Detection Playbook
      • Phishing Email Compromise Detection Playbook
      • Scam Detection Playbook
      • Customer Phishing Detection Playbook
      • Insider Abuse Detection Playbook
      • Information Leakage Detection Playbook
      • Social Engineering Detection Playbook
      • Malicious Network Behaviour Detection Playbook
      • Windows Intrusion Detection Playbook
      • Vulnerability Detection Playbook
      • Business Email Compromise Detection Playbook
    • Process Execution (KQL Triage)
    • Threat Hunting
      • Hunting Ransomware Indicators
      • Hunting With KQL
        • Detecting Malware Infection (MITRE ATT&CK: T1566, T1059)
        • Discovery Activities (MITRE ATT&CK: T1016, T1083, T1046)
        • Credential Theft (MITRE ATT&CK: T1003, T1078)
        • Lateral Movement (MITRE ATT&CK: T1076, T1021)
        • Data Theft (MITRE ATT&CK: T1041, T1071)
        • Detecting CommandLine Executions (MITRE ATT&CK: T1059)
        • Windows Security Logs (Identity and Logon Activities)
      • Hunting With Splunk
Powered by GitBook
On this page
  • Introduction
  • Using KQL to Investigate Privilege Escalation Activities in an Environment Using Defender/Sentinel
  • 1. T1055 - Process Injection
  • 2. T1543 - Create or Modify System Process
  • 3. T1068 - Exploitation for Privilege Escalation
  • 4. T1548 - Abuse Elevation Control Mechanism
  • 5. T1134 - Access Token Manipulation
  • 6. T1078 - Valid Accounts
  • 7. T1547 - Boot or Logon Autostart Execution
  • 8. T1055.001 - Dynamic-link Library Injection
Edit on GitHub
  1. SOC Operations
  2. Intermediate and Advanced Skills
  3. Investigate Using MITRE ATT&CK Methodology

Privilege Escalation (TA0004) Techniques

Introduction

Investigating privilege escalation incidents forensically on workstations and server systems is critical in identifying how an attacker or malicious user gained elevated access. Privilege escalation can occur in various ways, such as exploiting system vulnerabilities, misconfigurations, or leveraging stolen credentials.

Understanding Privilege Escalation

  • Vertical Escalation: Attacker gains higher-level privileges (e.g., regular user to administrator).

  • Horizontal Escalation: Attacker expands access across accounts at the same privilege level.

  • Common Techniques: Exploiting vulnerabilities, password cracking, manipulating user accounts, token manipulation, etc.

Data Collection and Preservation

  • Forensic Imaging: Create forensic images of affected systems using tools like FTK Imager or dd.

  • Memory Capture: Use tools like WinPmem or Magnet RAM Capture to capture live memory.

  • Log Collection: Collect relevant logs, including security logs, system logs, application logs, and audit logs.

Initial Analysis and Identification

  • Security Logs Analysis: Look for anomalous login activities, especially Event IDs 4624 (successful login), 4625 (failed login), and 4672 (special privileges assigned).

  • Account Review: Examine user accounts for unauthorised creation, modification, or elevation of privileges.

  • System and Application Logs: Check for logs indicating changes in system settings or application configurations that could lead to privilege escalation.

In-Depth Investigation

  • Vulnerability Exploitation: Identify if any known vulnerabilities have been exploited for privilege escalation. Tools like Nessus or OpenVAS can help retrospectively identify vulnerabilities.

  • Group Policy Analysis: Review group policies for misconfigurations that may have allowed privilege escalation.

  • File and Registry Analysis: Look for unauthorised modifications in critical system files and registry entries that could indicate privilege changes.

Artifact Analysis

  • Windows Registry: Investigate keys related to user accounts and privileges.

  • Event Tracing Logs: Examine ETL files for evidence of privilege escalation activities.

  • Scheduled Tasks: Check for any scheduled tasks created or modified by unauthorised users.

  • Service Configuration: Analyse services to see if any have been modified to run with higher privileges.

Network Analysis (if applicable)

  • Analyse network traffic for signs of lateral movement or external communications that might be related to the privilege escalation.

Use of Specialised Forensic Tools

  • Forensic Suites: Tools like EnCase, X-Ways Forensics, or Autopsy for comprehensive analysis.

  • Windows-specific Tools: Windows Event Viewer, Sysinternals Suite, AccessChk, and Process Monitor.

Documentation and Reporting

  • Detailed Documentation: Document every step, including tools used, findings, and methodologies.

  • Forensic Report: Prepare a comprehensive report detailing the privilege escalation incident and its impact.

Post-Investigation Actions

  • Remediation and Mitigation: Implement necessary fixes, security updates, and policy changes.

  • Recovery: Restore systems and data from backups if necessary.

  • Lessons Learned: Conduct a review to improve security posture and response strategies.

Key Considerations

  • Legal and Compliance: Ensure all investigative actions comply with legal and organisational guidelines.

  • Chain of Custody: Maintain a clear chain of custody for all forensic evidence.

  • Confidentiality and Integrity: Handle all data securely and maintain its integrity.

Each privilege escalation incident is unique and might require a customised approach. Tailor the investigation to the specifics of the case and the environment in which you are operating.

Using KQL to Investigate Privilege Escalation Activities in an Environment Using Defender/Sentinel

Privilege Escalation techniques allow adversaries to gain higher-level permissions on a system. These elevated privileges may be used to execute malicious actions, access sensitive data, or move laterally across the network.

1. T1055 - Process Injection

Objective: Detect attempts to inject code into the address space of another process to gain elevated privileges or evade detection.

  1. Detect Remote Thread Injection

DeviceProcessEvents | where ProcessCommandLine has_any ("CreateRemoteThread", "NtCreateThreadEx", "QueueUserAPC") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify remote thread injection attempts used for privilege escalation.

  1. Monitor for DLL Injection Techniques

DeviceProcessEvents | where ProcessCommandLine has_any ("LoadLibrary", "RtlCreateUserThread", "WriteProcessMemory") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect DLL injection techniques that may be used to gain elevated privileges.

  1. Identify Process Hollowing Attempts

DeviceProcessEvents | where ProcessCommandLine has_any ("ZwUnmapViewOfSection", "SetThreadContext", "ResumeThread") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for process hollowing attempts where the memory of a legitimate process is replaced with malicious code.

  1. Detect APC Injection

DeviceProcessEvents | where ProcessCommandLine has "NtQueueApcThread" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify APC (Asynchronous Procedure Call) injection used for executing code in the context of another process.

  1. Monitor for PowerShell Injection Attempts

DeviceProcessEvents | where ProcessCommandLine has "powershell" and ProcessCommandLine has "Invoke-Expression" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect PowerShell commands attempting process injection for privilege escalation.

  1. Identify Shellcode Injection

DeviceProcessEvents | where ProcessCommandLine has_any ("VirtualAllocEx", "WriteProcessMemory", "CreateRemoteThread") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for shellcode injection techniques.

  1. Detect Process Doppelgänging

DeviceProcessEvents | where ProcessCommandLine has_any ("NtCreateTransaction", "TxF") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify process doppelgänging techniques that exploit NTFS transactions.

  1. Monitor for Windows API Calls Related to Injection

DeviceProcessEvents | where ProcessCommandLine has_any ("NtMapViewOfSection", "SetThreadContext", "RtlCreateUserThread") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect Windows API calls commonly used in process injection techniques.

  1. Identify Process Injection via Code Cavitation

DeviceProcessEvents | where ProcessCommandLine has_any ("ZwMapViewOfSection", "ZwCreateSection", "ZwCreateThreadEx") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for code cavitation, where code is injected into a remote process using lesser-known API functions.

  1. Detect Hijacking of Process Execution

DeviceProcessEvents | where ProcessCommandLine has_any ("Image File Execution Options", "Debugger") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify the use of Image File Execution Options (IFEO) to hijack process execution for privilege escalation.

2. T1543 - Create or Modify System Process

Objective: Detect the creation or modification of system processes (e.g., services, daemons) to gain elevated privileges.

  1. Detect New Service Creation with Elevated Privileges

DeviceServiceEvents | where ActionType == "ServiceInstalled" and InitiatingProcessAccountName == "SYSTEM" | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine

Purpose: Identify the creation of new services running with elevated privileges.

  1. Monitor for Modifications to Existing Services

DeviceServiceEvents | where ActionType == "ServiceModified" | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect modifications to existing services that may be used for privilege escalation.

  1. Identify Services Configured to Auto Start

DeviceServiceEvents | where ActionType == "ServiceInstalled" and ServiceStartType == "Auto" | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for services configured to start automatically, potentially providing persistence with elevated privileges.

  1. Detect Services Executing Suspicious Commands

DeviceServiceEvents | where ActionType == "ServiceInstalled" and InitiatingProcessCommandLine has_any ("powershell.exe", "cmd.exe", "wscript.exe") | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify services executing commands commonly used for malicious activities.

  1. Monitor for Services Running from Non-Standard Locations

DeviceServiceEvents | where ActionType == "ServiceInstalled" and InitiatingProcessFolderPath has_not "C:\\Windows\\System32" | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect services running executables from unusual or non-standard locations, which may indicate privilege escalation.

  1. Identify Suspicious Service Names or Descriptions

DeviceServiceEvents | where ActionType == "ServiceInstalled" and (ServiceName has_any ("backdoor", "rat", "trojan") or ServiceDescription has_any ("backdoor", "rat", "trojan")) | project Timestamp, DeviceName, ServiceName, ServiceDescription, InitiatingProcessAccountName

Purpose: Monitor for services with suspicious names or descriptions that may indicate malicious intent.

  1. Detect Service Installation by Non-Admin Accounts

DeviceServiceEvents | where ActionType == "ServiceInstalled" and InitiatingProcessAccountName != "Administrator" | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify services installed by non-administrative accounts.

  1. Monitor for Service Execution Using System Accounts

DeviceServiceEvents | where ActionType == "ServiceInstalled" and InitiatingProcessAccountName == "SYSTEM" | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine

Purpose: Detect services installed with the SYSTEM account, potentially indicating an attempt to gain SYSTEM-level privileges.

  1. Identify Unusual Service Start Types

DeviceServiceEvents | where ActionType == "ServiceInstalled" and ServiceStartType in ("Manual", "DelayedAutoStart") | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for services with unusual start types that may indicate malicious persistence mechanisms.

  1. Detect Services Associated with Common Attack Tools

DeviceServiceEvents | where ActionType == "ServiceInstalled" and InitiatingProcessCommandLine has_any ("mimikatz", "metasploit", "cobalt strike") | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify services installed with commands associated with common attack tools.

3. T1068 - Exploitation for Privilege Escalation

Objective: Detect the exploitation of vulnerabilities that allow an adversary to escalate privileges.

  1. Detect Known Exploits for Privilege Escalation

DeviceProcessEvents | where ProcessCommandLine has_any ("CVE-2017-0144", "CVE-2018-8453", "CVE-2019-0841") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify attempts to exploit known vulnerabilities for privilege escalation.

  1. Monitor for Exploit-Related Processes

DeviceProcessEvents | where ProcessCommandLine has_any ("exploit", "overflow", "buffer") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect processes related to exploitation activities.

  1. Identify Unusual Kernel Driver Loads

DeviceDriverEvents | where DriverFileName has_any ("exploit.sys", "malware.sys") | project Timestamp, DeviceName, DriverFileName, DriverSigned

Purpose: Monitor for the loading of kernel drivers associated with exploitation.

  1. Detect PowerShell Execution of Exploit Code

DeviceProcessEvents | where ProcessCommandLine has "powershell" and ProcessCommandLine has_any ("Invoke-Exploit", "Invoke-Native") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify PowerShell commands executing exploit code.

  1. Monitor for Privilege Escalation via Exploited Services

DeviceServiceEvents | where ActionType == "ServiceModified" and InitiatingProcessCommandLine has_any ("exploit", "buffer") | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect modifications to services that may indicate privilege escalation through exploitation.

  1. Identify Exploit Attempts Targeting System Processes

DeviceProcessEvents | where ProcessCommandLine has_any ("lsass.exe", "winlogon.exe") and ProcessCommandLine has_any ("overflow", "exploit") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for exploit attempts targeting critical system processes.

  1. Detect Use of Exploitation Frameworks

DeviceProcessEvents | where ProcessCommandLine has_any ("metasploit", "cobalt strike", "empire") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify the use of exploitation frameworks commonly used for privilege escalation.

  1. Monitor for Malicious Use of Debugging Tools

DeviceProcessEvents | where ProcessCommandLine has_any ("windbg.exe", "ntsd.exe", "ollydbg.exe") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect the use of debugging tools that may be used to exploit vulnerabilities.

  1. Identify Vulnerability Scanners Running on High Privileged Accounts

DeviceProcessEvents | where ProcessCommandLine has_any ("nmap", "nessus", "openvas") and TokenElevationType == "Full" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for vulnerability scanners running with elevated privileges, potentially used to identify exploitable vulnerabilities.

  1. Detect Attempts to Exploit Privilege Escalation Vulnerabilities via Scripts

DeviceProcessEvents | where ProcessCommandLine has_any (".ps1", ".vbs", ".bat") and ProcessCommandLine has_any ("exploit", "elevation") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify scripts attempting to exploit privilege escalation vulnerabilities.

4. T1548 - Abuse Elevation Control Mechanism

Objective: Detect abuse of elevation control mechanisms (e.g., UAC bypass) to gain elevated privileges.

  1. Detect UAC Bypass via Fodhelper

DeviceProcessEvents | where ProcessCommandLine has "fodhelper.exe" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify attempts to bypass User Account Control (UAC) using Fodhelper.

  1. Monitor for UAC Bypass via Event Viewer

DeviceProcessEvents | where ProcessCommandLine has "eventvwr.exe" and ProcessCommandLine has "mmc.exe" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect UAC bypass attempts using the Event Viewer.

  1. Identify UAC Bypass via ComputerDefaults

DeviceProcessEvents | where ProcessCommandLine has "ComputerDefaults.exe" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for UAC bypass attempts using ComputerDefaults.

  1. Detect UAC Bypass via SilentCleanup

DeviceProcessEvents | where ProcessCommandLine has "SilentCleanup" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify UAC bypass attempts using the SilentCleanup task.

  1. Monitor for UAC Bypass via sdclt.exe

DeviceProcessEvents | where ProcessCommandLine has "sdclt.exe" and ProcessCommandLine has "Control_RunDLL" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect UAC bypass attempts using sdclt.exe.

  1. Identify UAC Bypass via Registry Key Modification

DeviceRegistryEvents | where RegistryKey has "HKCU\\Software\\Classes\\ms-settings\\Shell\\Open\\command" | project Timestamp, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessAccountName

Purpose: Monitor for registry key modifications used in UAC bypass attacks.

  1. Detect UAC Bypass via wscript.exe

DeviceProcessEvents | where ProcessCommandLine has "wscript.exe" and ProcessCommandLine has_any ("cscript", "vbscript") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify UAC bypass attempts using wscript.exe.

  1. Monitor for UAC Bypass via DllHost.exe

DeviceProcessEvents | where ProcessCommandLine has "dllhost.exe" and ProcessCommandLine has_any ("comsvcs.dll", "mmc.exe") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect UAC bypass attempts using DllHost.exe.

  1. Identify UAC Bypass via Sysprep

DeviceProcessEvents | where ProcessCommandLine has "sysprep.exe" and ProcessCommandLine has "unattend.xml" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for UAC bypass attempts using the Sysprep tool.

  1. Detect UAC Bypass via Task Scheduler

DeviceProcessEvents | where ProcessCommandLine has "schtasks" and ProcessCommandLine has "/RL HIGHEST" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify UAC bypass attempts using the Task Scheduler with elevated privileges.

5. T1134 - Access Token Manipulation

Objective: Detect manipulation of access tokens to impersonate other users or escalate privileges.

  1. Detect Token Impersonation Attempts

DeviceProcessEvents | where ProcessCommandLine has_any ("ImpersonateLoggedOnUser", "DuplicateTokenEx", "SetThreadToken") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify attempts to impersonate another user's token.

  1. Monitor for Use of Mimikatz to Steal Tokens

DeviceProcessEvents | where ProcessCommandLine has_any ("mimikatz", "sekurlsa::pth", "sekurlsa::tspkg") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect the use of Mimikatz to steal tokens for privilege escalation.

  1. Identify Process Privilege Elevation via Token Duplication

DeviceProcessEvents | where ProcessCommandLine has_any ("DuplicateTokenEx", "CreateProcessWithTokenW") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for token duplication attempts that may indicate privilege escalation.

  1. Detect Manipulation of Tokens via PowerShell

DeviceProcessEvents | where ProcessCommandLine has "powershell" and ProcessCommandLine has_any ("Invoke-TokenManipulation", "Get-TokenPrivs") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify PowerShell commands attempting token manipulation.

  1. Monitor for Token Privileges Adjustments

DeviceProcessEvents | where ProcessCommandLine has_any ("AdjustTokenPrivileges", "SetTokenInformation") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect adjustments to token privileges that may be used to gain elevated access.

  1. Identify Token Manipulation Using WinAPI Calls

DeviceProcessEvents | where ProcessCommandLine has_any ("OpenProcessToken", "SetTokenInformation", "AdjustTokenPrivileges") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for attempts to manipulate access tokens using Windows API calls.

  1. Detect Token Manipulation by Non-Admin Accounts

DeviceProcessEvents | where ProcessCommandLine has_any ("DuplicateTokenEx", "ImpersonateLoggedOnUser") and InitiatingProcessAccountName != "Administrator" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify token manipulation attempts by non-administrative users.

  1. Monitor for Process Creation Using Stolen Tokens

DeviceProcessEvents | where ProcessCommandLine has "CreateProcessWithTokenW" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect the creation of processes using stolen or duplicated tokens.

  1. Identify Suspicious Token Privilege Enabling

DeviceProcessEvents | where ProcessCommandLine has_any ("SeDebugPrivilege", "SeImpersonatePrivilege") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for suspicious enabling of token privileges that may indicate an attempt to escalate privileges.

  1. Detect Token Manipulation Using Third-Party Tools

DeviceProcessEvents | where ProcessCommandLine has_any ("incognito", "privilege escalation") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify token manipulation attempts using third-party tools.

6. T1078 - Valid Accounts

Objective: Detect the use of valid accounts to gain elevated privileges.

  1. Detect Use of Default or Well-Known Accounts

IdentityLogonEvents | where AccountDomain == "NT AUTHORITY" or AccountDomain == "BUILTIN" | project Timestamp, AccountName, AccountDomain, LogonType, DeviceName

Purpose: Identify logons using default or well-known accounts that may be used for privilege escalation.

  1. Monitor for Unusual Account Activity by Admin Users

IdentityLogonEvents | where AccountDomain != "NT AUTHORITY" and AccountDomain != "BUILTIN" | where AccountName endswith "admin" or AccountName endswith "administrator" | project Timestamp, AccountName, AccountDomain, LogonType, DeviceName

Purpose: Detect unusual activity by accounts with administrative privileges.

  1. Identify Logons Using Service Accounts

IdentityLogonEvents | where AccountName startswith "svc_" or AccountName endswith "_svc" | project Timestamp, AccountName, AccountDomain, LogonType, DeviceName

Purpose: Monitor for logons using service accounts that may indicate privilege escalation.

  1. Detect Lateral Movement Using Valid Accounts

IdentityLogonEvents | where LogonType == "RemoteInteractive" or LogonType == "Network" | where AccountName has_any ("admin", "administrator", "svc_") | project Timestamp, AccountName, AccountDomain, LogonType, DeviceName

Purpose: Identify lateral movement attempts using valid accounts.

  1. Monitor for Logon Attempts by Non-Privileged Accounts

IdentityLogonEvents | where AccountName has_not_any ("admin", "administrator", "svc_") | where LogonType == "Interactive" or LogonType == "RemoteInteractive" | project Timestamp, AccountName, AccountDomain, LogonType, DeviceName

Purpose: Detect logon attempts by non-privileged accounts that may be attempting privilege escalation.

  1. Identify Attempted Use of Disabled or Expired Accounts

IdentityLogonEvents | where AccountEnabled == "false" or AccountExpires < now() | project Timestamp, AccountName, AccountDomain, LogonType, DeviceName

Purpose: Monitor for attempts to use disabled or expired accounts.

  1. Detect Suspicious Use of Local Administrator Accounts

IdentityLogonEvents | where AccountName == "Administrator" and AccountDomain == "DeviceName" | project Timestamp, AccountName, AccountDomain, LogonType, DeviceName

Purpose: Identify suspicious logon attempts using local Administrator accounts.

  1. Monitor for Account Usage Outside of Normal Hours

IdentityLogonEvents | where LogonTime between (datetime(22:00:00) .. datetime(06:00:00)) | project Timestamp, AccountName, AccountDomain, LogonType, DeviceName

Purpose: Detect account usage outside of normal business hours that may indicate privilege escalation.

  1. Identify Use of Stolen Credentials

IdentityLogonEvents | where LogonResult == "Failed" and AccountName has_any ("admin", "administrator", "svc_") | project Timestamp, AccountName, AccountDomain, LogonType, DeviceName

Purpose: Monitor for failed logon attempts that may indicate the use of stolen credentials.

  1. Detect Use of Valid Accounts by Non-Standard Processes

DeviceProcessEvents | where InitiatingProcessAccountName has_any ("admin", "administrator", "svc_") | where ProcessCommandLine has_not_any ("cmd.exe", "powershell.exe", "explorer.exe") | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify use of valid accounts by processes that are not typically associated with administrative tasks.

7. T1547 - Boot or Logon Autostart Execution

Objective: Detect mechanisms that automatically execute code with elevated privileges upon boot or user logon.

  1. Detect Modifications to Registry Run Keys

DeviceRegistryEvents | where RegistryKey has_any ("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run") | project Timestamp, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessAccountName

Purpose: Identify changes to registry keys that execute programs at startup, which may be used for privilege escalation.

  1. Monitor for New Entries in the Startup Folder

DeviceFileEvents | where FolderPath endswith "Startup" and FileOperation == "Create" | project Timestamp, DeviceName, FileName, FolderPath, InitiatingProcessAccountName

Purpose: Detect new files added to the Startup folder that may be used to execute code with elevated privileges.

  1. Identify Modifications to Winlogon Keys

DeviceRegistryEvents | where RegistryKey == "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit" | project Timestamp, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessAccountName

Purpose: Monitor for changes to Winlogon keys that may indicate privilege escalation attempts.

  1. Detect Creation of New Services Set to Auto Start

DeviceServiceEvents | where ActionType == "ServiceInstalled" and ServiceStartType == "Auto" | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify the creation of new services configured to start automatically, potentially providing elevated privileges.

  1. Monitor for New Logon Scripts

DeviceFileEvents | where FolderPath has "Scripts\\Logon" and FileOperation == "Create" | project Timestamp, DeviceName, FileName, FolderPath, InitiatingProcessAccountName

Purpose: Detect the creation of new logon scripts that may be used for privilege escalation.

  1. Identify Modifications to the Shell Registry Key

DeviceRegistryEvents | where RegistryKey == "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Shell" | project Timestamp, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessAccountName

Purpose: Monitor for changes to the Shell registry key that can be used to persist elevated privileges.

  1. Detect New DLLs Added to Startup Folders

DeviceFileEvents | where FolderPath endswith "Startup" and FileExtension == ".dll" | project Timestamp, DeviceName, FileName, FolderPath, InitiatingProcessAccountName

Purpose: Identify DLL files added to startup folders for privilege escalation.

  1. Monitor for Creation of WMI Event Subscriptions

DeviceProcessEvents | where ProcessCommandLine has "wmic" and ProcessCommandLine has "EventFilter" and ProcessCommandLine has "create" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect the creation of WMI event subscriptions that can be used for persistent privilege escalation.

  1. Identify Modifications to the Userinit Key

DeviceRegistryEvents | where RegistryKey == "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Userinit" | project Timestamp, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessAccountName

Purpose: Monitor for changes to the Userinit registry key, which can be used to launch programs with elevated privileges at logon.

  1. Detect Creation of Hidden Scheduled Tasks

DeviceProcessEvents | where ProcessCommandLine has "schtasks /create" and ProcessCommandLine has "/RU SYSTEM" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify the creation of hidden or system-level scheduled tasks that may be used to persist elevated privileges.

8. T1055.001 - Dynamic-link Library Injection

Objective: Detect DLL injection techniques used to execute code in the context of another process, potentially with elevated privileges.

  1. Detect DLL Injection Using LoadLibrary

DeviceProcessEvents | where ProcessCommandLine has "LoadLibrary" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify the use of the LoadLibrary API for DLL injection.

  1. Monitor for DLL Injection Using CreateRemoteThread

DeviceProcessEvents | where ProcessCommandLine has "CreateRemoteThread" and ProcessCommandLine has ".dll" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect attempts to inject DLLs using the CreateRemoteThread API.

  1. Identify DLL Injection via NtMapViewOfSection

DeviceProcessEvents | where ProcessCommandLine has "NtMapViewOfSection" and ProcessCommandLine has ".dll" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for DLL injection attempts using the NtMapViewOfSection API.

  1. Detect DLL Injection via AppInit_DLLs

DeviceRegistryEvents | where RegistryKey == "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\AppInit_DLLs" | project Timestamp, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessAccountName

Purpose: Identify modifications to the AppInit_DLLs registry key, which can be used for DLL injection.

  1. Monitor for DLL Injection via SetWindowsHookEx

DeviceProcessEvents | where ProcessCommandLine has "SetWindowsHookEx" and ProcessCommandLine has ".dll" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect attempts to inject DLLs using the SetWindowsHookEx API.

  1. Identify DLL Injection via RtlCreateUserThread

DeviceProcessEvents | where ProcessCommandLine has "RtlCreateUserThread" and ProcessCommandLine has ".dll" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for DLL injection attempts using the RtlCreateUserThread API.

  1. Detect DLL Injection Using CreateProcessWithTokenW

DeviceProcessEvents | where ProcessCommandLine has "CreateProcessWithTokenW" and ProcessCommandLine has ".dll" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify DLL injection attempts using the CreateProcessWithTokenW API.

  1. Monitor for DLL Injection via Code Cavitation

DeviceProcessEvents | where ProcessCommandLine has "ZwMapViewOfSection" and ProcessCommandLine has ".dll" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Detect code cavitation techniques where DLLs are injected using lesser-known API functions.

  1. Identify DLL Injection via Process Hollowing

DeviceProcessEvents | where ProcessCommandLine has_any ("ZwUnmapViewOfSection", "NtCreateSection", "SetThreadContext") and ProcessCommandLine has ".dll" | project Timestamp, DeviceName, ProcessCommandLine, InitiatingProcessAccountName

Purpose: Monitor for DLL injection attempts using process hollowing techniques.

  1. Detect DLL Injection via Malicious Services

DeviceServiceEvents | where ActionType == "ServiceInstalled" and InitiatingProcessCommandLine has ".dll" | project Timestamp, DeviceName, ServiceName, InitiatingProcessCommandLine, InitiatingProcessAccountName

Purpose: Identify DLL injection attempts via malicious services.

PreviousPersistence (TA0003) TechniquesNextDefence Evasion (TA0005) Techniques

Last updated 4 months ago