🔏
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
  • Capabilities of PowerShell for Persistence Discovery in DFIR
  • Efficiency Provided by PowerShell in Persistence Discovery
  • Persistence Discovery
  • 1. Registry-Based Persistence
  • 2. Scheduled Tasks and Services
  • 3. WMI Persistence
  • 4. Startup Folder Persistence
  • 5. GPO and Logon Scripts
  • 6. Binary and Script-Based Persistence
  • 7. Malicious Use of Scripting Languages
  • 8. Registry Persistence
  • 9. Boot and Auto-Start Configuration
  • 10. Persistence via Network and Remote Services
  • Additional Discovery Techniques
  • 1. Registry and Autoruns Monitoring
  • 2. Service and Scheduled Task Persistence
  • 3. WMI and COM Object Persistence
  • 4. Startup Scripts and Logon Hooks
  • 5. Malicious Use of Scheduled Jobs and Cron Jobs
  • 6. Persistence via System Services
  • 7. Browser Extensions and Plug-Ins
  • 8. DLL Hijacking and Injection
  • 9. Remote Access and Backdoors
  • 10. Persistence via System and Network Configuration
Edit on GitHub
  1. SOC Operations
  2. Junior Analyst Skills
  3. PowerShell for SecOps

Persistence Discovery

Introduction

PowerShell is an essential tool for SecOps teams, offering a powerful and versatile platform for managing systems, automating tasks, and investigating security incidents. Its integration with Windows, extensive library of cmdlets, and scripting capabilities make it particularly effective for uncovering Persistence Discovery activities during digital forensics and incident response (DFIR) investigations. Persistence techniques are used by attackers to maintain long-term access to compromised systems, enabling them to return even after detection or remediation. PowerShell empowers SecOps teams to identify these techniques efficiently, facilitating swift containment and strengthening the organisation’s security posture.


Capabilities of PowerShell for Persistence Discovery in DFIR

1. Startup and Autorun Location Analysis:

PowerShell enables analysts to investigate startup items, registry keys, and scheduled tasks that attackers might abuse to establish persistence. This includes inspecting common persistence points such as Run registry keys, startup folders, and HKLM\Software\Microsoft\Windows\CurrentVersion\Run.

2. Scheduled Task Inspection:

Attackers often create or modify scheduled tasks to execute malicious payloads persistently. PowerShell can enumerate all scheduled tasks, analyse their configurations, and identify suspicious or unauthorised entries that deviate from normal operations.

3. Service Configuration and Abuse Detection:

Malicious actors may create or modify Windows services to run their code persistently. PowerShell allows for detailed inspection of service configurations, including service types, startup modes, and associated binaries, helping to uncover evidence of misuse.

4. Registry and WMI Persistence Monitoring:

Windows Management Instrumentation (WMI) and registry keys are common avenues for persistence. PowerShell provides the ability to query and analyse WMI event subscriptions and registry entries, helping to detect malicious alterations designed to maintain attacker footholds.

5. User Account and Credential Persistence:

PowerShell can monitor for the creation of rogue user accounts, unauthorised changes to user privileges, or misuse of credentials that attackers may leverage for persistent access. It can also help detect changes to Active Directory objects or policies related to persistence.

6. File and Binary Inspection:

Attackers may deploy or modify binaries, scripts, or libraries to ensure persistence. PowerShell allows for searching, analysing, and verifying the integrity of these files, including identifying anomalous or unsigned executables.

7. Event Log Analysis:

Persistence activities often leave traces in Windows event logs. PowerShell enables querying of security, application, and system logs for events indicative of persistence techniques, such as service creation, task scheduling, or registry modifications.


Efficiency Provided by PowerShell in Persistence Discovery

  1. Comprehensive Visibility: PowerShell provides detailed insights into critical system components like registry keys, services, tasks, and user accounts, ensuring thorough persistence detection.

  2. Scalability: With PowerShell Remoting, analysts can perform persistence discovery across multiple systems simultaneously, making it ideal for large-scale investigations.

  3. Real-Time Analysis: PowerShell supports real-time querying of persistence mechanisms, enabling teams to identify and respond to ongoing threats more quickly.

  4. Automation: PowerShell scripts can automate routine discovery tasks, such as scanning for scheduled tasks or analysing registry changes, ensuring efficiency and consistency.

  5. Custom Detection Rules: PowerShell can be tailored to focus on specific persistence techniques outlined in the MITRE ATT&CK framework, enabling precise detection aligned with known adversarial tactics.

  6. Integration with Security Tools: Seamless integration with security platforms like Microsoft Defender for Endpoint, Azure Sentinel, and SIEMs allows for enhanced detection and automated responses to persistence activities.


By leveraging PowerShell's capabilities, SecOps teams can efficiently uncover and analyse persistence techniques, minimising the attacker’s ability to maintain access and improving the enterprise network's overall resilience.

4o

Persistence Discovery

1. Registry-Based Persistence

1.1. Registry Run Key Modifications

Purpose: Detect changes to registry keys that run programs at startup.

Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Run" | Select-Object PSChildName, *
Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" | Select-Object PSChildName, *

1.2. AppInit_DLLs Changes

Purpose: Identify modifications to the AppInit_DLLs registry value, often used for DLL injection.

Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" -Name AppInit_DLLs

2. Scheduled Tasks and Services

2.1. Listing Suspicious Scheduled Tasks

Purpose: Detect the creation of scheduled tasks that may indicate persistence.

Get-ScheduledTask | Where-Object {$_.State -eq 'Ready' -or $_.State -eq 'Running'} | Select-Object TaskName, @{n='Actions';e={$_.Actions}}

2.2. Service Installation Events

Purpose: Identify the installation of unusual services, which may be used for persistence.

Get-WinEvent -FilterHashtable @{LogName='System'; ID=7045} |  Where-Object {$_.Properties[1].Value -notin 'KnownGoodServices'}

3. WMI Persistence

3.1. Detecting WMI Event Consumers

Purpose: Identify WMI event consumers, which can be used for persistence.

Get-WmiObject -Namespace "root\subscription" -Class __EventConsumer | Select-Object Name, CommandLineTemplate

3.2. Monitoring WMI Event Filters

Purpose: Detect suspicious WMI event filters.

Get-WmiObject -Namespace "root\subscription" -Class __EventFilter | Select-Object Name, Query

4. Startup Folder Persistence

4.1. Listing Items in Startup Folders

Purpose: Detect suspicious scripts or executables placed in startup folders.

Get-ChildItem -Path "C:\Users\*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" | Select-Object FullName, CreationTime
Get-ChildItem -Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" | Select-Object FullName, CreationTime

5. GPO and Logon Scripts

5.1. Detecting GPO Logon Scripts

Purpose: Identify logon scripts configured via Group Policy Objects.

Get-GPRegistryValue -All | Where-Object {$_.ValueName -like '*logon*script*'} | Select-Object PolicyName, KeyPath, ValueName, Value

5.2. Enumerating Local Logon Scripts

Purpose: Detect logon scripts configured locally.

Get-ChildItem -Path "C:\Windows\System32\GroupPolicy\User\Scripts\Logon" | Select-Object FullName, CreationTime

6. Binary and Script-Based Persistence

6.1. Monitoring Changes in Common System Directories

Purpose: Detect unauthorized binaries or scripts in common system directories.

Get-ChildItem -Path "C:\Windows\System32" -Filter "*.exe, *.dll" | Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-1)}

6.2. Detecting PowerShell Profile Changes

Purpose: Identify modifications to PowerShell profiles, which can be used for persistence.

Get-Content -Path $PROFILE

7. Malicious Use of Scripting Languages

7.1. Monitoring for Suspicious PowerShell Scripts

Purpose: Detect suspicious PowerShell scripts, especially those that could establish persistence.

Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-PowerShell/Operational'; ID=4104} | Where-Object {$_.Message -match 'Invoke-Mimikatz|New-Object'}

7.2. Detecting JScript and VBScript Persistence

Purpose: Identify suspicious JScript or VBScript files that may be used for persistence.

Get-ChildItem -Path "C:\Windows\Temp" -Filter "*.js, *.vbs" | Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-1)}

8. Registry Persistence

8.1. Checking for Winlogon Shell Modifications

Purpose: Detect modifications to the Winlogon Shell registry key, which can be used to start malware.

Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name Shell

8.2. Investigating Userinit Key Modifications

Purpose: Identify unauthorized changes to the Userinit registry key.

Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name Userinit

9. Boot and Auto-Start Configuration

9.1. Checking for Boot Configuration Data (BCD) Changes

Purpose: Detect unauthorized changes to the Boot Configuration Data.

bcdedit /enum all

9.2. Detecting Changes to Auto-Start Services

Purpose: Identify unauthorized changes to services set to auto-start.

Get-Service | Where-Object {$_.StartType -eq 'Automatic'} | Select-Object Name, DisplayName, Status

10. Persistence via Network and Remote Services

10.1. Monitoring Remote Desktop Protocol (RDP) Changes

Purpose: Detect changes to RDP settings that could indicate persistence mechanisms.

Get-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name fDenyTSConnections

10.2. Detecting Changes to Remote Management Settings

Purpose: Identify changes to Windows Remote Management (WinRM) settings.

Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\Client" -Name AllowBasic

Additional Discovery Techniques

1. Registry and Autoruns Monitoring

1.1. Detecting Autorun Entries in the Registry

Purpose: Identify suspicious autorun entries that may indicate persistence mechanisms.

Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" | Select-Object PSChildName, @{n='Value';e={$_ -replace '.*\\'}}

1.2. Monitoring for Changes in Startup Folders

Purpose: Detect changes in startup folders that may indicate unauthorized persistence.

Get-ChildItem -Path "C:\Users\*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" | Select-Object FullName, LastWriteTime

2. Service and Scheduled Task Persistence

2.1. Detecting Creation of New Services

Purpose: Identify the creation of new services, which can be used for persistence.

Get-WinEvent -FilterHashtable @{LogName='System'; ID=7045} | Select-Object TimeCreated, @{n='ServiceName';e={$_.Properties[0].Value}}, @{n='ServiceFile';e={$_.Properties[5].Value}}

2.2. Monitoring for New or Modified Scheduled Tasks

Purpose: Detect the creation or modification of scheduled tasks for persistence.

Get-ScheduledTask | Where-Object {$_.Principal.UserId -like "*"} | Select-Object TaskName, Principal, @{n='Actions';e={$_.Actions}}

3. WMI and COM Object Persistence

3.1. Detecting WMI Event Subscription Persistence

Purpose: Identify persistent WMI event subscriptions used for persistence.

Get-WmiObject -Namespace "root\subscription" -Class __EventFilter | Select-Object Name, Query

3.2. Monitoring for Suspicious COM Object Creation

Purpose: Detect the creation of suspicious COM objects that may indicate persistence.

Get-ItemProperty -Path "HKLM:\Software\Classes\CLSID" -Recurse | Where-Object {$_.PSChildName -match ".*\{.*\}.*"} | Select-Object PSChildName, @{n='Value';e={$_.Property}}

4. Startup Scripts and Logon Hooks

4.1. Detecting Changes in Group Policy Logon Scripts

Purpose: Identify changes to logon scripts set by Group Policy for persistence.

Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logon" | Select-Object ScriptList, GPOID

4.2. Monitoring for Logon Hook Injections

Purpose: Detect the injection of logon hooks for persistence.

Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4672} | Where-Object {$_.Properties[9].Value -match "SeTcbPrivilege"} | Select-Object TimeCreated, @{n='AccountName';e={$_.Properties[5].Value}}

5. Malicious Use of Scheduled Jobs and Cron Jobs

5.1. Detecting Creation of New Scheduled Jobs

Purpose: Identify new scheduled jobs that may indicate persistence mechanisms.

Get-WmiObject -Class Win32_ScheduledJob | Select-Object JobID, Name, Status, Command

5.2. Monitoring for Changes in Existing Scheduled Jobs

Purpose: Detect modifications to existing scheduled jobs for persistence.

Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4698} | Select-Object TimeCreated, @{n='JobName';e={$_.Properties[0].Value}}, @{n='Operation';e={$_.Properties[1].Value}}

6. Persistence via System Services

6.1. Detecting Changes to System Services

Purpose: Monitor changes to system services that may indicate persistence.

Get-WinEvent -FilterHashtable @{LogName='System'; ID=7040} | Where-Object {($_.Properties[2].Value -match "start type changed")} | Select-Object TimeCreated, @{n='ServiceName';e={$_.Properties[0].Value}}, @{n='Change';e={$_.Properties[2].Value}}

6.2. Monitoring for New or Suspicious Service Installations

Purpose: Detect the installation of new services that may be used for persistence.

Get-WinEvent -FilterHashtable @{LogName='System'; ID=7030} | Select-Object TimeCreated, @{n='ServiceName';e={$_.Properties[0].Value}}, @{n='ServiceFile';e={$_.Properties[1].Value}}

7. Browser Extensions and Plug-Ins

7.1. Detecting Malicious Browser Extensions

Purpose: Identify browser extensions that may be used for persistence.

Get-ChildItem -Path "C:\Users\*\AppData\Local\Google\Chrome\User Data\Default\Extensions" -Recurse | Select-Object FullName, LastWriteTime

7.2. Monitoring for New or Unusual Plug-Ins

Purpose: Detect the installation of new or unusual browser plug-ins.

Get-ChildItem -Path "C:\Program Files (x86)\Mozilla Firefox\browser\extensions" -Recurse | Select-Object FullName, LastWriteTime

8. DLL Hijacking and Injection

8.1. Detecting DLL Hijacking Attempts

Purpose: Monitor for attempts to hijack DLLs for persistence.

Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4688} | Where-Object {($_.Properties[9].Value -match "rundll32.exe") -and ($_.Properties[9].Value -match "DLL_Path")} | Select-Object TimeCreated, @{n='CommandLine';e={$_.Properties[9].Value}}

8.2. Monitoring for Suspicious DLL Injections

Purpose: Identify DLL injections used to maintain persistence.

Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4656} | Where-Object {($_.Properties[9].Value -match "0x1F0FFF") -and ($_.Properties[5].Value -match "DLL_Path")} | Select-Object TimeCreated, @{n='ProcessName';e={$_.Properties[5].Value}}

9. Remote Access and Backdoors

9.1. Detecting Remote Access Tools (RATs)

Purpose: Identify the presence of remote access tools used for persistence.

Get-Process | Where-Object {$_.ProcessName -match "TeamViewer|AnyDesk|RAT_Tool"} | Select-Object ProcessName, Id, StartTime

9.2. Monitoring for Backdoor Installations

Purpose: Detect installations of backdoors for unauthorized remote access.

Get-WinEvent -FilterHashtable @{LogName='System'; ID=7035} | Where-Object {$_.Properties[0].Value -match "backdoor_service_name"} | Select-Object TimeCreated, @{n='ServiceName';e={$_.Properties[0].Value}}

10. Persistence via System and Network Configuration

10.1. Detecting Changes in Network Configuration

Purpose: Monitor changes in network configurations, such as proxy settings, which can be used for persistence.

Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer

10.2. Monitoring System Boot Configuration Changes

Purpose: Detect changes to system boot configurations that may indicate persistence.

bcdedit /enum all | Select-String "path"
PreviousExecution DiscoveryNextPrivilege Escalation Discovery

Last updated 4 months ago