Heartbreaker

Description

Delicate situation alert! The customer has just been alerted about concerning reports indicating a potential breach of their database, with information allegedly being circulated on the darknet market. As the Incident Responder, it's your responsibility to get to the bottom of it. Your task is to conduct an investigation into an email received by one of their employees, comprehending the implications, and uncovering any possible connections to the data breach. Focus on examining the artifacts provided by the customer to identify significant events that have occurred on the victim's workstation.

Files

We are given quite an extensive zip file. It contains fraction of Windows system files, with prefetches, logs, Events logs, user data, etc.

└─$ 7z x HeartBreaker.zip -P'hacktheblue'

Tasks

Task 1. The victim received an email from an unidentified sender. What email address was used for the suspicious email?

└─$ find . -iname '*mail*'
./wb-ws-01/C/Users/ash.williams/AppData/Local/Microsoft/Outlook/ashwilliams012100@gmail.com.ost
└─$ cd ./wb-ws-01/C/Users/ash.williams/AppData/Local/Microsoft/Outlook
└─$ file ashwilliams012100@gmail.com.ost
ashwilliams012100@gmail.com.ost: Microsoft Outlook Offline Storage (>=2003, Unicode, version 36), dwReserved1=0x78, dwReserved2=0x12ff86, bidUnused=0000000000000000, dwUnique=0x164f, 16818176 bytes, CRC32 0x28f18ca3
└─$ pffexport ashwilliams012100@gmail.com.ost # https://unix.stackexchange.com/a/611130
└─$ find . -empty -delete # Cleanup
└─$ tree -h -L 1
[4.0K]  .
├── [4.0K]  Contacts (This computer only)
├── [4.0K]  [Gmail]
└── [4.0K]  Inbox

4 directories, 0 files

After going through few mails in Inbox few can notice a suspicious email. Embedded file has double extension, is being served on IP rather then domain, port 9000 is also a bit sketchy and finally the sender pressures us to get it as soon as possible.

Writeup.png
circle-check
circle-check

Task 3. The threat actor managed to identify the victim's AWS credentials. From which file type did the threat actor extract these credentials?

From CTF challenges I participated the AWS key always started with AKIA after searching for it we end up on Draft email with Access keys!

Writeup-1.png

The extension is .ost because that's the file contents we are reading right now in verbose mode (like a zip file).

circle-check

Task 4. Provide the actual IAM credentials of the victim found within the artifacts.

circle-check

Task 5. When (UTC) was the malicious binary activated on the victim's workstation?

For this type of information we can refer to Master File Table. Parse the MFT with MFTECmd:

  • Created0x10: STANDARD_INFO created timestamp

  • Created0x30: FILE_NAME created timestamp [[Labs/HackTheBox/Sherlocks/DFIR/BFT/Writeup#Task 4. Analyze the $Created0x30 timestamp for the previously identified file. When was this file created on disk?|BFT Writeup]]

Writeup-2.png

Usually the MFT holds the all information about file access, but the timestamps was not accepting. We can look info Prefetch file with PECmd:

Looks like the timestamp was 10 seconds off..

circle-check

Task 6. Following the download and execution of the binary file, the victim attempted to search for specific keywords on the internet. What were those keywords?

Writeup-3.png
Writeup-4.png

nxlog: Browser history logsarrow-up-right

Writeup-5.png

Looks like Firefox was used to download malware.

Writeup-6.png
Writeup-7.png

After malware download the user searched for Superstar cafe membership

circle-check

Task 7. At what time (UTC) did the binary successfully send an identical malicious email from the victim's machine to all the contacts?

Searching for malware name we end up on Message00005 which contains all contacts that user had.

Writeup-8.png
Writeup-9.png

Mar 13, 2024 10:47:51.000000000 UTC -> 2024-05-13 10:47:51

circle-check

Task 8. How many recipients were targeted by the distribution of the said email excluding the victim's email account?

circle-check

Task 9. Which legitimate program was utilized to obtain details regarding the domain controller?

The Windows Events Log should have what we are looking for, but there are too many.

We can use Chainsaw to parse the events based on regex and find relevant info.

It was hard to filter all the events, so I focused on Event providers. Sysmon is more precise event for this task.

You can use nltest.exearrow-up-right to:

  • Get a list of domain controllers

  • Force a remote shutdown

  • Query the status of trust

  • Test trust relationships and the state of domain controller replication in a Windows domain

  • Force a user-account database to synchronize on Windows NT version 4.0 or earlier domain controllers

circle-check

Task 10. Specify the domain (including sub-domain if applicable) that was used to download the tool for exfiltration.

Sysmon > Event ID 22: DNSEvent (DNS query)arrow-up-right

circle-check

Task 11. The threat actor attempted to conceal the tool to elude suspicion. Can you specify the name of the folder used to store and hide the file transfer program?

Sysmon > Event ID 11: FileCreatearrow-up-right

WinSCParrow-up-right is an open source free SFTP client, FTP client, WebDAV client, S3 client and SCP client and file manager for Windows. Its main function is file transfer between a local and a remote computer. Beyond this, WinSCP offers scripting and basic file manager functionality

circle-check

Task 12. Under which MITRE ATT&CK technique does the action described in question #11 fall?

Easiest way if probably Google, lol D:

Writeup-10.png

Masqueradingarrow-up-right fits the profile of attacker TTP.

circle-check

Task 13: Can you determine the minimum number of files that were compressed before they were extracted?

Public Files directory, WB-WS-01.zip and WinSCP.zip can be excluded from the list as they are not relevant to exfiltration. 29 - 3 = 26 files exfiltrated from "Staging folder": Staging in this case means: the folder where the attacker works from.

circle-check

Task 14: To exfiltrate data from the victim's workstation, the binary executed a command. Can you provide the complete command used for this action?

circle-check

Last updated