FaresMorcy
  • Whoami
  • Footprinting Labs
    • Lab - Easy
    • Lab - Medium
    • Lab - Hard
  • Shells & Payloads
    • The Live Engagement
  • Password Attacks
    • Lab - Easy
    • Lab - Medium
    • Lab - Hard
  • SOC Hackthebox Notes & Labs
    • Security Monitoring & SIEM Fundamentals Module
    • Windows Event Logs & Finding Evil Module
    • Introduction to Threat Hunting & Hunting With Elastic Module
    • Understanding Log Sources & Investigating with Splunk Module
      • Introduction To Splunk & SPL
      • Using Splunk Applications
      • Intrusion Detection With Splunk (Real-world Scenario)
      • Detecting Attacker Behavior With Splunk Based On TTPs
      • Detecting Attacker Behavior With Splunk Based On Analytics
      • Skills Assessment
    • Windows Attacks & Defense
      • Kerberoasting
      • AS-REProasting
      • GPP Passwords
      • GPO Permissions/GPO Files
      • Credentials in Shares
      • Credentials in Object Properties
      • DCSync
      • Golden Ticket
      • Kerberos Constrained Delegation
      • Print Spooler & NTLM Relaying
      • Coercing Attacks & Unconstrained Delegation
      • Object ACLs
      • PKI - ESC1
      • Skills Assessment
    • Intro to Network Traffic Analysis Module
    • YARA & Sigma for SOC Analysts Module
      • Developing YARA Rules
      • Hunting Evil with YARA (Windows Edition)
      • Hunting Evil with YARA (Linux Edition)
      • Sigma and Sigma Rules
      • Developing Sigma Rules
      • Hunting Evil with Sigma (Chainsaw Edition)
      • Hunting Evil with Sigma (Splunk Edition)
      • Skills Assessment
  • TryHackme SOC 1
    • TShark
      • TShark: The Basics
      • TShark: CLI Wireshark Features
      • TShark Challenge I: Teamwork
      • TShark Challenge II: Directory
    • Tempest
    • Boogeyman 1
    • Boogeyman 2
    • Boogeyman 3
  • TryHackme SOC 2
    • Advanced Splunk
      • Splunk: Exploring SPL
      • Splunk: Setting up a SOC Lab
      • Splunk: Dashboards and Reports
      • Splunk: Data Manipulation
      • Fixit
    • Advanced ELK
      • Slingshot
    • Threat Hunting
      • Threat Hunting: Foothold
      • Threat Hunting: Pivoting
      • Threat Hunting: Endgame
  • TryHackme Rooms
    • Investigating Windows
    • Splunk 2
    • Windows Network Analysis
  • Powershell Scripting Fundamentals
  • SANS SEC504 & Labs
    • Book one
      • Live Examination
      • Network Investigations
      • Memory Investigations
      • Malware Investigations
      • Accelerating IR with Generative AI
      • Bootcamp: Linux Olympics
      • Bootcamp: Powershell Olympics
    • Book Two
      • Hacker Tools and Techniques Introduction
      • Target Discovery and Enumeration
      • Discovery and Scanning with Nmap
      • Cloud Spotlight: Cloud Scanning
      • SMB Security
      • Defense Spotlight: Hayabusa and Sigma Rules
    • Book Three
      • Password Attacks
      • Cloud Spotlight: Microsoft 365 Password Attacks
      • Understanding Password Hashes
      • Password Cracking
      • Cloud Spotlight: Insecure Storage
      • Multipurpose Netcat
    • Book Four
      • Metasploit Framework
      • Drive-By Attacks
      • Command Injection
      • Cross-Site Scripting
      • SQL Injection
      • Cloud Spotlight: SSRF and IMDS
    • Book Five
      • Endpoint Security Bypass
      • Pivoting and Lateral Movement
      • Hijacking Attacks
      • Establishing Persistence
      • Defense Spotlight: RITA
      • Cloud Spotlight: Cloud Post-Exploitation
  • SANS SEC511 & Labs
    • Resources
      • Primers
      • References
      • Tools
        • Network
        • Elastic Stack
      • Printable Versions
    • Book One
      • Part One
      • Part Two
      • Part Three
    • Book Two
      • Part One
      • Part Two
      • Part Three
      • Part Four
    • Book Three
      • Part One
      • Part Two
      • Part Three
      • Part Four
    • Book Four
      • Part One
      • Part Two
      • Part Three Lab
      • Part Four Lab
    • Book Five
      • Part One Lab
      • Part Two Lab
      • Part Three Lab
  • CyberDefenders
    • XXE Infiltration Lab
    • T1594 Lab
    • RetailBreach Lab
    • DanaBot Lab
    • OpenWire Lab
    • BlueSky Ransomware Lab
    • Openfire Lab
    • Boss Of The SOC v1 Lab
    • GoldenSpray Lab
    • REvil Lab
    • ShadowRoast Lab
    • SolarDisruption Lab
    • Kerberoasted Lab
    • T1197 Lab
    • Amadey Lab
    • Malware Traffic Analysis 1 Lab
    • Insider Lab
    • Volatility Traces Lab
    • FalconEye Lab
    • GitTheGate Lab
    • Trident Lab
    • NerisBot Lab
  • Practical Windows Forensics
    • Data Collection
    • Examination
    • Disk Analysis Introduction
    • User Behavior
    • Overview of disk structures, partitions and file systems
    • Finding Evidence of Deleted Files with USN Journal Analysis
    • Analyzing Evidence of Program Execution
    • Finding Evidence of Persistence Mechanisms
    • Uncover Malicious Activity with Windows Event Log Analysis
    • Windows Memory Forensic Analysis
  • Hackthebox Rooms
    • Campfire-1
    • Compromised
    • Brutus
    • Trent
    • CrownJewel-1
  • WEInnovate Training
    • Weinnovate - Active Directory Task One
    • Build ELK Lab
      • Configure Elasticsearch and Kibana setup in ubuntu
      • Configure Fluent-Bit to send logs to ELK
      • Set up Winlogbeat & Filebeat for log collection
      • Send Logs from Winlogbeat through Logstash to ELK
      • Enable Windows Audit Policy & Winlogbeat
      • Elasticsearch API and Ingestion Pipeline
    • SOAR
      • Send Alerts To Email & Telegram Bot
      • Integrate Tines with ELK
    • SOC Practical Assessment
    • Lumma C2
    • Network Analysis
  • Build ELK Lab
    • Configure Elasticsearch and Kibana setup in ubuntu
    • Configure Fluent-Bit to send logs to ELK
    • Set up Winlogbeat & Filebeat for log collection
    • Send Logs from Winlogbeat through Logstash to ELK
    • Enable Windows Audit Policy & Winlogbeat
    • Elasticsearch API and Ingestion Pipeline
  • Build Home Lab - SOC Automation
    • Install & configure Sysmon for deep Windows event logging
    • Set up Wazuh & TheHive for threat detection & case management
    • Execute Mimikatz & create detection rules in Wazuh
    • Automate everything with Shuffle
    • Response to SSH Attack Using Shuffle, Wazuh, and TheHive
  • Home Lab (Attack & Defense Scenarios)
    • Pass-the-Hash Attack & Defense
    • Scheduled Task Attack & Defense
    • Kerberoasting Attack & Defense
    • Kerberos Constrained Delegation
    • Password Spraying Attack & Defense
    • Golden Ticket Attack & Defense
    • AS-REProasting Attack & Defense
    • DCSync Attack & Defense
  • Home Lab (FIN7 (Carbanak Group) – Point of Sale (POS) Attack on Hospitality Chains)
  • Home Lab (Lumma Stealer)
Powered by GitBook
On this page
  1. SANS SEC511 & Labs
  2. Book Five

Part Two Lab

Lab 5.2 - Windows Event Logs

Objectives:

  • Analyze Windows Event logs.

  • Perform hands-on long tail analysis of Windows event logs.

  • Provide hands-on experience with PowerShell.

This lab uses these .evtx files, located in c:\labs:

  • pegasus-security.evtx (domain controller)

These logs are from the compromised PC:

  • valkyrie-defender.evtx

  • valkyrie-security.evtx

  • valkyrie-security-logons.evtx

  • valkyrie-sysmon.evtx

  • valkyrie-system.evtx

Challenges:

  1. Perform long tail analysis on valkyrie-security.evtx

  2. Locate all service creation events in valkyrie-system.evtx

  3. Identify all process creation events that reference "powershell.exe -nop" in valkyrie-security.evtx

  4. Identify all process creation events that reference "ADMIN$" in valkyrie-security.evtx

  5. Identify the RDP events that reference "The start type of the Remote Desktop Services service was changed..." in valkyrie-system.evtx

  6. Identify the event that references "A new self-signed certificate..." in valkyrie-system.evtx

  7. Identify the user creation event for the account NumberSix in pegasus-security.evtx

  8. Identify the event where users were added to the domain administrators group pegasus-security.evtx

  9. Identify all events in valkyrie-defender.evtx that reference "Microsoft Defender Antivirus has taken action to protect this machine from malware or other potentially unwanted software."

  10. Identify the event in in valkyrie-defender.evtx where Microsoft Defender Antivirus Real-time Protection was disabled

  11. Identify the events in both valkyrie-system.evtx and valkyrie-security.evtx where the event log was cleared

  12. Bonus step: count the number of failed logons in valkyrie-security-logons.evtx

Q1) Perform long tail analysis on valkyrie-security.evtx

Get-WinEvent -Path C:\labs\valkyrie-security.evtx | Group-Object Id -NoElement | sort Count

Q2) Locate all service creation events in valkyrie-system.evtx.

Get-WinEvent @{Path="C:\labs\valkyrie-system.evtx"; Id=7045} | fl | more

Service creation events involving PowerShell are unusual and often associated with malicious activity. Additionally, running powershell.exe through cmd.exe is highly suspicious, especially when using flags like -nop (no profile) and -w hidden (hidden window).

Q3) Identify all process creation events that reference "powershell.exe -nop" in valkyrie-security.evtx

Get-WinEvent @{Path="C:\labs\valkyrie-security.evtx"; Id=4688} 
| Where-Object {$_.Message -like "*powershell.exe -nop*"} | fl | more

Windows clients can now log full command-line details instead of just the process name. However, this feature is not enabled by default. It should be activated on all systems running Windows 7 or later.

Q4) Identify all process creation events that reference "ADMIN$" in valkyrie-security.evtx

Get-WinEvent @{Path="C:\labs\valkyrie-security.evtx"; Id=4688} 
| Where-Object {$_.Message -like "*ADMIN$*"} | fl | more

The WmiPrvSe.exe process, known as the WMI Provider Host, is being used here to launch cmd.exe. Attackers are increasingly using WMI to exploit systems, as psexec-based attacks are often blocked by antivirus or EDR solutions. SOC teams should monitor WmiPrvSe.exe for launching any processes, especially cmd.exe or powershell.exe, and investigate such activity.

Q5) Identify the RDP events that reference "The start type of the Remote Desktop Services service was changed..." in valkyrie-system.evtx

Get-WinEvent @{Path="C:\labs\valkyrie-system.evtx";id=7040} | Where-Object {$_.Message -like "*Remote Desktop*"} | fl

The change in the start type of the Remote Desktop Services (RDP) service from demand start to auto start could indicate an attempt to persistently enable RDP for remote access, potentially signaling suspicious activity.

Q6) Identify the event that references "A new self-signed certificate..." in valkyrie-system.evtx

Get-WinEvent @{Path="C:\labs\valkyrie-system.evtx"; Id=1056} | fl

Q7) Identify the user creation event for the account NumberSix in pegasus-security.evtx

Get-WinEvent @{Path="C:\labs\pegasus-security.evtx"; Id=4720} | fl

Q8) Identify the event where users were added to the domain administrators group in pegasus-security.evtx

Get-WinEvent @{Path="\labs\\pegasus-security.evtx"; Id=4728} | fl
 Get-WinEvent @{Path="\labs\\pegasus-security.evtx"; Id=4737} | fl

Security event 4737 is particularly critical and should be closely monitored. Any changes should be immediately reviewed by the SOC to confirm if they are authorized. Unauthorized changes must be escalated to incident handlers without delay.

Q9) Identify all events in valkyrie-defender.evtx that reference "Microsoft Defender Antivirus has taken action to protect this machine from malware or other potentially unwanted software."

Get-WinEvent @{Path="C:\labs\valkyrie-defender.evtx"; Id=1117} | fl | more

Q10) Identify the event in in valkyrie-defender.evtx where Microsoft Defender Antivirus Real-time Protection was disabled

Get-WinEvent @{Path="C:\labs\valkyrie-defender.evtx"; Id=5001} | fl

Q11) Identify the events in both valkyrie-system.evtx and valkyrie-security.evtx where the event log was cleared

Get-WinEvent @{Path="C:\labs\valkyrie-security.evtx"; Id=1102} | fl
Get-WinEvent @{Path="C:\labs\valkyrie-system.evtx"; Id=104} | fl

Clear the logs for Event ID 1102 in the security log and Event ID 104 in the system log.

Q12) Bonus step: count the number of failed logons in valkyrie-security-logons.evtx

Get-WinEvent -Path C:\labs\valkyrie-security-logons.evtx | Group-Object Id -NoElement | sort count

Event 4624 indicates a successful account logon, while Event 4625 represents a failed logon attempt. In this case, there were 18,311 failed logon attempts.

PreviousPart One LabNextPart Three Lab

Last updated 4 months ago