🔏
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 Impact Discovery in DFIR
  • Efficiency Provided by PowerShell in Impact Discovery
  • Impact Discovery
  • 1. Data Destruction and Manipulation
  • 2. System and Service Disruption
  • 3. Ransomware and Encryption
  • 4. System Integrity and Configuration Changes
  • 5. Security Tool Tampering
  • 6. Data Integrity and Backup Manipulation
  • 7. Application and Software Integrity
  • 8. Log and Audit Manipulation
  • 9. System Resource Abuse
  • 10. Website Defacement and System Messaging
Edit on GitHub
  1. SOC Operations
  2. Junior Analyst Skills
  3. PowerShell for SecOps

Impact Discovery

Introduction

PowerShell is a powerful tool for security operations (SecOps), providing extensive capabilities for managing systems, automating tasks, and conducting detailed investigations in enterprise environments. Its deep integration with Windows and robust scripting capabilities make it essential for Digital Forensics and Incident Response (DFIR) investigations. One of its critical applications is in uncovering Impact Discovery activities, where attackers seek to disrupt, degrade, or destroy systems, data, and operations. PowerShell enables SecOps teams to efficiently detect, analyse, and respond to these activities, minimising damage and ensuring the swift recovery of enterprise operations.


Capabilities of PowerShell for Impact Discovery in DFIR

1. Detecting File Deletion or Encryption Attempts:

PowerShell allows analysts to monitor file system activities, such as mass file deletions, unauthorised modifications, or the use of encryption tools, which are often indicative of ransomware or destructive attacks.

2. Monitoring Process Execution:

PowerShell can identify suspicious processes that indicate impact activities, such as ransomware binaries, wipers, or destructive scripts. It can also detect abnormal parent-child process relationships often used in such attacks.

3. Analysing System Configuration Changes:

Attackers may alter system configurations to cause disruptions, such as disabling critical services or modifying startup parameters. PowerShell can query and audit these changes to identify malicious activity.

4. Investigating Disk and Volume Modifications:

PowerShell enables the monitoring of disk and volume changes, such as the deletion of partitions, formatting of drives, or disabling of shadow copies, which attackers often leverage to maximise the impact of their activities.

5. Identifying Account Lockouts and Privilege Abuse:

Attackers may attempt to lock out accounts or escalate privileges to increase their impact. PowerShell provides the ability to track account activity, detect unauthorised privilege changes, and monitor account lockout events.

6. Examining Service and Task Modifications:

PowerShell can analyse modifications to scheduled tasks, services, or system jobs that may be used to execute impact activities, such as deploying destructive payloads or disabling key functionalities.

7. Detecting Network Disruptions:

PowerShell can monitor for network-related disruptions, such as modifying firewall rules, DNS settings, or routing tables, which may indicate an attempt to impact connectivity or isolate systems.

8. Event Log Analysis for Impact Indicators:

PowerShell allows analysts to query and analyse event logs for evidence of impact activities, such as critical service failures, mass access attempts, or patterns of malicious execution.


Efficiency Provided by PowerShell in Impact Discovery

  1. Comprehensive System Visibility: PowerShell provides detailed access to system configurations, processes, file systems, and logs, enabling analysts to uncover impact activities across various components of the enterprise.

  2. Real-Time Detection: PowerShell’s ability to monitor and query system activities in real-time allows security teams to identify and respond to impact-related threats as they unfold.

  3. Scalability: With PowerShell Remoting, SecOps teams can simultaneously perform impact discovery across multiple endpoints, ensuring efficiency in large-scale enterprise environments.

  4. Automation of Investigation Tasks: PowerShell scripts can automate repetitive discovery tasks, such as scanning for unauthorised modifications or querying event logs, ensuring consistent and efficient workflows.

  5. Customisation for Threat Models: PowerShell allows for the creation of tailored scripts to detect specific impact techniques aligned with frameworks like the MITRE ATT&CK, enabling targeted detection.

  6. Integration with Security Tools: PowerShell integrates seamlessly with platforms like Microsoft Sentinel, Defender for Endpoint, and SIEM solutions, enabling enriched detection, automated alerts, and effective incident response workflows.


By leveraging PowerShell’s capabilities, SecOps teams can efficiently detect and mitigate Impact Discovery activities during DFIR investigations, minimising the potential damage and ensuring the swift restoration of enterprise operations.

Impact Discovery

1. Data Destruction and Manipulation

1.1. Detecting Mass File Deletions

Purpose: Identify mass deletions of files, which may indicate a destructive action.

Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4663} | Where-Object {$_.Properties[8].Value -match 'Delete'} | Select-Object TimeCreated, @{n='ObjectName';e={$_.Properties[6].Value}}

1.2. Monitoring File Modifications

Purpose: Detect unauthorised modifications to critical files.

Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4663} | Where-Object {$_.Properties[8].Value -match 'WriteData'} | Select-Object TimeCreated, @{n='ObjectName';e={$_.Properties[6].Value}}

2. System and Service Disruption

2.1. Detecting Service Stoppages

Purpose: Identify unexpected stoppages of critical services.

Get-WinEvent -FilterHashtable @{LogName='System'; ID=7036} | Where-Object {$_.Message -match 'stopped'} | Select-Object TimeCreated, @{n='ServiceName';e={$_.Message -match 'The (.*) service' -replace 'The | service'}}

2.2. Monitoring Unexpected System Shutdowns or Restarts

Purpose: Detect system shutdowns or restarts that may indicate malicious activity.

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

3. Ransomware and Encryption

3.1. Detecting File Encryption Activity

Purpose: Identify signs of ransomware encrypting files.

Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4663} | Where-Object {$_.Properties[8].Value -match 'ReadData'} | Select-Object TimeCreated, @{n='ObjectName';e={$_.Properties[6].Value}}

3.2. Monitoring for Ransomware Note Creation

Purpose: Detect the creation of ransomware notes in directories.

Get-ChildItem -Path "C:\Users\*\Documents\*" -Recurse -Include *.txt | Where-Object {($_.Name -match 'READ_ME') -or ($_.Name -match 'DECRYPT_INSTRUCTIONS')} | Select-Object FullName, CreationTime

4. System Integrity and Configuration Changes

4.1. Monitoring for Unauthorised Changes to System Files

Purpose: Detect unauthorised changes to important system files.

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

4.2. Detecting Group Policy Object Modifications

Purpose: Identify unauthorised modifications to Group Policy Objects (GPOs).

Get-WinEvent -FilterHashtable @{LogName='Security'; ID=5136} | Where-Object {$_.Message -match 'groupPolicyContainer'} | Select-Object TimeCreated, @{n='AttributeName';e={$_.Properties[9].Value}}

5. Security Tool Tampering

5.1. Detecting Disabling of Security Software

Purpose: Identify attempts to disable antivirus or other security tools.

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

5.2. Monitoring Changes to Firewall Settings

Purpose: Detect unauthorised changes to firewall rules that may expose systems to attacks.

Get-NetFirewallRule -PolicyStore ActiveStore | Where-Object {($_.Action -eq 'Allow') -and ($_.Enabled -eq 'True')} | Select-Object Name, Action, Enabled, Direction, LocalAddress, RemoteAddress

6. Data Integrity and Backup Manipulation

6.1. Detecting Deletion of Backup Files

Purpose: Identify the deletion of backup files, which may prevent recovery from an attack.

Get-ChildItem -Path "C:\Backups\*" -Recurse -Include *.bak | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-1)}

6.2. Monitoring Shadow Copy Deletions

Purpose: Detect the deletion of Volume Shadow Copies, which may indicate ransomware activity.

Get-WinEvent -FilterHashtable @{LogName='System'; ID=8224} | Where-Object {$_.Message -match 'The VSS service is shutting down'} | Select-Object TimeCreated, @{n='Message';e={$_.Message}}

7. Application and Software Integrity

7.1. Detecting Unauthorised Software Installations

Purpose: Identify the installation of unauthorised or malicious software.

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

7.2. Monitoring Changes to Software Configurations

Purpose: Detect unauthorised changes to critical software configurations.

Get-WmiObject -Class Win32_Product |  Where-Object {$_.InstallDate -gt (Get-Date).AddDays(-1)} | Select-Object Name, Version, InstallDate

8. Log and Audit Manipulation

8.1. Detecting Clearing of Event Logs

Purpose: Identify attempts to clear event logs, which may indicate an effort to cover tracks.

Get-WinEvent -FilterHashtable @{LogName='Security'; ID=1102}

8.2. Monitoring Changes to Audit Policy

Purpose: Detect unauthorised changes to audit policy settings.

Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Security" -Name MaxSize

9. System Resource Abuse

9.1. Detecting Cryptocurrency Mining Activity

Purpose: Identify unauthorised use of system resources for cryptocurrency mining.

Get-Process | Where-Object {$_.ProcessName -match 'xmrig|miner'} | Select-Object ProcessName, Id, StartTime

9.2. Monitoring Unusual CPU and Memory Usage

Purpose: Detect abnormal spikes in CPU and memory usage, indicating potential resource abuse.

Get-Counter -Counter "\Processor(_Total)\% Processor Time" -SampleInterval 5 -MaxSamples 3 | Where-Object {$_.CounterSamples.CookedValue -gt 80}

10. Website Defacement and System Messaging

10.1. Detecting Website Defacement

Purpose: Identify unauthorised changes to website content.

Get-Content -Path "C:\inetpub\wwwroot\index.html" | Where-Object {$_ -match 'Hacked by|Defaced by'}

10.2. Monitoring System Message Display

Purpose: Detect the display of unauthorised system messages or pop-ups.

Get-EventLog -LogName Application -Source "Windows Error Reporting" | Where-Object {$_.Message -match 'Ransom Note|Warning Message'} | Select-Object TimeGenerated, EntryType, Message
PreviousExfiltration DiscoveryNextPacket Analysis (pcap)

Last updated 4 months ago