FaresMorcy
  • Whoami
  • Footprinting Labs
    • Lab - Easy
    • Lab - Medium
    • Lab - Hard
  • Shells & Payloads
    • The Live Engagement
  • Password Attacks
    • Lab - Easy
    • Lab - Medium
    • Lab - Hard
  • Active Directory Enumeration & Attacks
    • Active Directory Enumeration & Attacks
    • AD Enumeration & Attacks - Skills Assessment Part I
    • AD Enumeration & Attacks - Skills Assessment Part II
  • 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
  • Malicious Document Analysis - HTB
    • Introduction
    • PDF Analysis
    • Office Files Analysis
    • Excel Macro Analysis
    • RTF Documents Analysis
  • 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)
  • 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
  • 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
  • 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
  • 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
  • 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
Powered by GitBook
On this page
  1. WEInnovate Training

Investigating Windows Scenario

Last updated 2 months ago

After successfully executing a phishing attack, the threat actor tricked an employee into downloading a malicious executable file, gaining control over the victim's machine.

The attacker disabled Windows Defender's real-time monitoring using Set-MpPreference -DisableRealtimeMonitoring $true, likely to avoid detection while executing malicious activities such as malware deployment or data exfiltration.

The attacker then attempted to establish persistence by creating a service named svehosts and proceeded to download a file called shell.ps1 onto the system.

(powershell or cmd) and "WEINNOVATE"

This command creates a malicious Windows service that automatically downloads and executes a PowerShell script from the attacker's server.

When the system starts, the service:

  • Launches cmd.exe.

  • Executes PowerShell to download shell.ps1 from 192.168.1.100.

  • Runs the malicious PowerShell script, potentially establishing remote access.

The attacker then attempted to create a service named "update" to replicate the functionality of "svehosts" service.

(powershell or cmd) and "WEINNOVATE"

Next, The attacker attempted to modify an existing Windows service (notepad.exe) to execute a malicious PowerShell command upon system startup.

This command modifies an existing Windows service (notepad.exe) to execute a malicious payload instead of its intended function. It replaces the service's execution path with a PowerShell command that downloads shell.ps1 from 192.168.100.24 and executes it, potentially establishing a reverse shell.

Then, the attacker set up an HTTP server and utilized the Invoke-WebRequest PowerShell cmdlet to download a file named scvhost.exe onto the compromised system.

http OR https

The attacker attempted to download an executable file named scvhost.exe and save it to the directory C:\Program Files.

We then applied a filter for this executable file to analyze the attacker's actions and determine its intended purpose.

"scvhost.exe"

The attacker attempted an AS-REP Roasting attack on the Windows Active Directory environment.

  • It enumerates Active Directory accounts that have the Do not require Kerberos preauthentication setting enabled.

  • Extracts AS-REP response hashes for those accounts.

  • Saves the hashes in Hashcat format for offline password cracking.

  • The attacker can then use Hashcat to brute-force weak passwords.

The attacker then attempted to automate an FTP connection to 192.168.200.124 on port 4444. Upon establishing the connection, they attempted to execute cmd.exe, potentially enabling remote command execution on the target server. This behavior is commonly associated with malicious activity, where attackers leverage FTP to establish a reverse shell or exfiltrate sensitive data.

(powershell or cmd) and "WEINNOVATE"

He attempted to establish a reverse shell, but this time, he encoded the command.

process.name: "powershell.exe" AND process.args: "-EncodedCommand"

We extracted this command and decoded it using CyberChef.

Then the attacker attempted to establish a reverse shell on port 4444 before switching to port 8080.

Next, the attacker attempted to bypass security restrictions by forcing PowerShell to execute scripts without limitations, disregarding any policies that might prevent script execution.

After this, he attempted to enumerate Active Directory users who do not require Kerberos pre-authentication.

(powershell or cmd) and "WEINNOVATE"

The attacker then attempted to download a tool named Rubeus from the HTTP server they configured, saving it to the C:\Temp directory.

The attacker downloaded this tool intending to perform an AS-REP Roasting attack but did not execute it. Instead, they prioritized establishing persistence by creating user accounts and scheduled tasks. Let's examine this further.

Next, the attacker created a user named "admin."

event.code: 4720 AND "WEINNOVATE"

He then attempted the AS-REP Roasting attack again, this time utilizing the Rubeus tool to extract hashes and save them to a file named hashes.txt.

event.code:4688 and "WEINNOVATE"

Next, the attacker established persistence by creating a scheduled task named "WindowsUpdate." This task was configured to run every five minutes and execute a file named "Windows_Update.exe."

This task runs under the SYSTEM account, meaning it has full administrative privileges.

We also identified additional persistence mechanisms attempted by the attacker, such as a randomly named pipe (wnqufs).

He then attempted the AS-REP Roasting attack again using the scvhostt.exe executable, storing the extracted hashes in the Temp directory.

After completing the attack, he opened the file updates.txt to check for any tickets that could be cracked to obtain the password.

The attacker then attempted network enumeration by executing commands such as ipconfig to display network configuration details and arp -a to retrieve the ARP table.

Next, the attacker attempted to generate a memory dump of the lsass.exe process (Local Security Authority Subsystem Service) and saved it as a file named lsass.dump.

The attacker then attempted to complete the enumeration process by listing all local user accounts using the net users command and identifying all visible computers on the network with the net view command.

Next, The attacker attempted to identify available hosts for lateral movement by using the ping command to determine which hosts were responsive.

Afterward, the attacker identified a host with the IP address 10.20.10.17 that responded to their requests. Consequently, they attempted to retrieve the machine's hostname and assess their privilege level on the system.

We believe he obtained the password of the Administrator account by cracking the ticket he acquired during the AS-REP Roasting attack.

The attacker attempted to download a file named Services.exe and saved it to the following path: C:\Users\Public\Services.exe.

He then prepared for data exfiltration by archiving all files from the Documents and Desktop folders of all user accounts, saving the compressed data as a ZIP file named backup.zip in the Public folder.

He then downloaded a file named explorer.exe onto the domain controller and saved it in C:\Windows\Temp\explorer.exe.

He then attempted to enumerate all user accounts within the Active Directory domain before creating a new user account named "systen" with the password "p@ssw0rd".

Next, the attacker attempted to retrieve a list of users belonging to the "Domain Admins" group within the Active Directory (AD) domain. Subsequently, they added the previously created user, "systen," to the local Administrators group on the compromised system.

He then utilizes NTDSUTIL, a built-in Windows utility, to generate a full backup of the Active Directory (AD) database (NTDS.DIT), storing the backup in C:\Windows\Temp\backup.

We believe the attacker returned to the PC10 device and leveraged Robocopy, a powerful command-line file copying tool in Windows, to steal user documents. The files were copied to a publicly accessible location (C:\Users\Public\backup), enabling later exfiltration of the data.

He then attempted to download a file named update.exe to the domain controller, saving it in the Temp directory under the same name.

The attacker then used WinRAR to compress, encrypt, and archive the NTDS.dit file along with the SYSTEM registry hive. This enabled them to extract Active Directory password hashes, facilitating potential credential theft and privilege escalation. The archived file was saved to C:\Windows\Temp\backup.rar.

The attacker then executed a PowerShell command to recursively search user directories for text, CSV, Excel, and Word documents containing keywords like "password," "pass," "pwd," or "credentials," to steal stored credentials or sensitive information.

Then he completed enumerating the active directory by executing some commands like tree, whoami, diskpart.

  • tree → Lists the directory structure, which can help an attacker understand the file system layout and locate sensitive files.

  • diskpart → Provides details about disk partitions, volumes, and mounted drives, which can reveal network shares and hidden storage used for data exfiltration.

  • whoami → Shows the current user’s privileges, domain, and group memberships, helping an attacker determine their level of access.

Next, he utilized WinRAR to compress the contents of the C:\DATA directory into an archive named Doms.rar.

He then completed the enumeration by searching for sensitive information within text-based files and scanning the C:\ directory for sensitive data and scripts.

He then created a scheduled task named WindowsUpdate, configured to run every five minutes, as a persistence mechanism.

The attacker proceeded to enumerate all domain users to gather information on usernames and their associated descriptions.

He then attempted to enumerate all stored credentials on the Windows system.

He then downloaded a tool called dnscat2 to exfiltrate the obtained data using DNS tunneling.

After downloading the dnscat2 tool, he manually configured the DNS server for the "Ethernet" interface to 192.168.100.179 (the attacker's IP address).

He disabled real-time monitoring on the PC10 machine, which was the initial point of compromise.

Next, the attacker began exfiltrating the acquired data, compressing it, and transmitting it to the IP addresses 192.168.100.179 and 192.168.100.24 using DNS tunneling.

Here, the attacker attempted to exfiltrate data using the dnscat tool.

The attacker then tried to disable system recovery by deleting all shadow copies, preventing file restoration and backup recovery.

This report was created by:

  • Fares Ebrahim Morcy

  • Abdelrahman Adly lofty

  • Amany Osama GadElmawla

  • Mohamed Elsayed Moghazy

  • Hoda amr Mohamed

  • Karim fathy salem

  • Youssef Khaled Sayed

  • Amjed Hatem