SalineBreeze-2
SalineBreeze-2
Platform: HackTheBox | Type: SOC/DFIR | Difficulty: Easy | Author: D3v0o0Nu11 | Date: 2026-02-10
Scenario
Your boss was so impressed with your research skills that you've been "rewarded" with a new task: malware analysis. Your mission is to investigate a piece of malware linked to the infamous cyber espionage group, Salt Typhoon. They've been targeting critical infrastructure, and it's up to you to uncover their tactics and techniques.
Key Questions
- What indicators of compromise exist?
- What attack chain / MITRE techniques were used?
- What is the full timeline?
Investigation Timeline
| Time | Event | Evidence / Source |
|---|---|---|
| — | In this case, we are tasked with performing a malware analysis on a .ps1 file that is suspected to be linked to an in... | |
| — | Upon a quick review of the provided PowerShell script, we can clearly identify encrypted strings and an AES-based dec... | |
| — | ONEDRIVED.PS1 | |
| — | While reviewing online articles about Salt Typhoon, one article curated by [Trend Micro](https://www.trendmicro.com/e... | |
| — | Also note that it will also drop a DLL named msmp4dec.dll. | |
| — | The article also states that, based on Trend Micro telemetry, they identified specific commands used by the threat ac... | |
| — | Let's try that on our sandbox. | |
| — | Comparing the results of executing the PowerShell script with and without the password mentioned in the article shows... | |
| — | When the password is used, the script executes without errors. | |
| — | It also dropped the same DLL name documented in the article. | |
| — | This briefly concludes that we are dealing with the Demodex malware family. | |
| — | Previously we identified an encoded base64 strings which utilized as AES object creation. |
Evidence Analysed
- Tools: python, powershell, strings, ghidra.
- Artifacts: registry.
Detailed Investigation
- In this case, we are tasked with performing a malware analysis on a .ps1 file that is suspected to be linked to an infamous cyber-espionage group known as Salt Typhoon.
- Upon a quick review of the provided PowerShell script, we can clearly identify encrypted strings and an AES-based decrypt-and-execute loader logic.
ONEDRIVED.PS1
1ST QUESTION --> ANS: REDACTED
-
While reviewing online articles about Salt Typhoon, one article curated by Trend Micro describes a DEMODEX rootkit infection chain that used the same PowerShell script name as the one we have now.
-
Also note that it will also drop a DLL named
msmp4dec.dll. -
The article also states that, based on Trend Micro telemetry, they identified specific commands used by the threat actor to make the script functional.
-
Let's try that on our sandbox.
-
Comparing the results of executing the PowerShell script with and without the password mentioned in the article shows different outcomes.
-
When the password is used, the script executes without errors.
-
It also dropped the same DLL name documented in the article.
-
This briefly concludes that we are dealing with the Demodex malware family.
2ND QUESTION --> ANS: REDACTED
-
Previously we identified an encoded base64 strings which utilized as AES object creation.
-
Decoding the base64 strings shall revealed ->
System.Security.Cryptography.AesManaged. -
It means the related line actually referred as:
ps1 read-only • copy allowed$0 = New-Object System.Security.Cryptography.AesManaged
- It is also important to note that, since there is no explicit mode assignment, the AES mode defaults to CBC with PKCS7 padding.
3RD QUESTION --> ANS: REDACTED
- Upon reviewing the script again, it is clear that the variable
$kis used to store the first argument passed by the user. - The argument passed is
password@123.
4TH QUESTION --> ANS: REDACTED
- Previously we identified
password@123indeed the correct one.
5TH QUESTION --> ANS: REDACTED
- Since we already know which encryption is used to obfuscate the payload, we can attempt to decrypt it using the same encryption logic (AES-256-CBC).
- In this case, I used a customized Python script to decrypt the payload:
py read-only • copy allowedfrom Crypto.Cipher import AES import base64 def decr(enc, argp): key = argp.ljust(32, '0') keyb = key.encode('utf-8') iv = bytes(16) encr_data= base64.b64decode(enc) cipher = AES.new(key_bytes, AES.MODE_CBC, iv) decr_bytes = cipher.decrypt(encr_data) # Remove PKCS7 padding padding_length = decr_bytes[-1] decr_bytes = decr_bytes[:-padding_length] res = decr_bytes.decode('utf-8') return res encrypted_string = "" # pass the encrypted payload here key = "password@123" try: result = decr(encrypted_string, key) print(f"Decrypted content: {result}") except Exception as e: print(f"Decryption failed: {e}")
-
Great! After decrypting the payload, we can now identify the value assigned to the variable
$cregvalue. -
In the top lines of the script, the value "midihelp" is assigned to the variable
$cregvalue.
6TH QUESTION --> ANS: REDACTED
-
To identify the SHA-256 checksum, based on the script logic, we simply need to decode the Base64-encoded bytes and then calculate the checksum.
-
Since we also want to analyze the binary further, I saved the output. To decode and save it, I used a Python script.
py read-only • copy allowedimport base64, sys strings = "" # the encoded strings. res = base64.b64decode(strings) ### print(res) out = 'decode_htb.bin' with open(out, 'wb') as f: f.write(res)
GET SHA-256 CHECKSUM
O:\HTB
λ sha256sum decode_htb.bin
3b1c251b0b37b57b755d4545a7dbbe4c29c15baeca4fc2841f82bc80ea877b66 *decode_htb.bin
7TH QUESTION --> ANS: REDACTED
- To identify the name of the malicious service, we need to detonate onedrived.ps1 again. However, this time, we execute Process Hacker first.
- Using it, we were able to monitor the process names spawned by the PowerShell script.
PROCESS HACKER
- Awesome! We found the newly created service name and the it's file location.
8TH QUESTION --> ANS: REDACTED
- Based on our previous findings, the path to the malicious DLL is at
C:\Windows\System32\msmp4dec.dll
9TH QUESTION --> ANS: REDACTED
-
To identify the registry path used to associate the service group (msgroup) with the malicious service, we can start by checking the registry key for the
MsMp4Hwservice. -
Based on our findings above, we can conclude that the registry path
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchostis used to associate the msgroup with the malicious service. -
We can double-check it by visiting that location or we can also perform static analysis for the decrypted payload.
CHECKING THE REGISTRY PATH
THE LINE THAT SPECIFIES THE PATH
- Nice! It is true.
10TH QUESTION --> ANS: REDACTED
- Upon reviewing the code again, at the last line after the service installation. The service is invoked by this command ->
Start-Service -name $svcname;
11TH QUESTION --> ANS: REDACTED
- There are two ways to identify the Windows API imported by the malicious DLL to obtain the local computer name: you can use
pestudioorApiMonitor.
USING PESTUDIO
APIMONITOR
-
Now, to verify whether this is true, we can use ApiMonitor by attaching it to the PID of the malicious svchost.exe and enabling a filter for the
GetComputerNameAwin32 API function. -
Great! It clearly shows
GetComputerNameAis utilized to obtain our local computer name.
12TH QUESTION --> ANS: REDACTED
-
Again, there are several ways to identify the function responsible for initiating the service. In ApiMonitor, this can be identified by checking its threads.
-
On the other hand, using Pestudio is sufficient for static analysis by reviewing the exported functions.
13TH QUESTION --> ANS: REDACTED
-
Decompiling and pseudonym at ghidra, we can easily identified the hardcoded value for the used Sleep() function, it is 10000 milliseconds.
-
Great! We've briefly analyzed the malware.
Findings
- Persistence mechanism — An autostart/persistence mechanism was established on the host (see timeline).
- Initial access — As documented in the investigation steps.
- Impact — As documented in the investigation steps.
MITRE ATT&CK Mapping
| Tactic | Technique | ID |
|---|---|---|
| Defense Evasion | Obfuscated Files or Information | T1027 |
| Defense Evasion | Modify Registry | T1112 |
| Impact | Data Encrypted for Impact | T1486 |
| Credential Access | Credentials from Password Stores | T1555 |
Answers / Flags
- 1ST QUESTION --> ANS: REDACTED
- 2ND QUESTION --> ANS: REDACTED
- 3RD QUESTION --> ANS: REDACTED
- 4TH QUESTION --> ANS: REDACTED
- 5TH QUESTION --> ANS: REDACTED
- 6TH QUESTION --> ANS: REDACTED
- 7TH QUESTION --> ANS: REDACTED
- 8TH QUESTION --> ANS: REDACTED
- 9TH QUESTION --> ANS: REDACTED
- 10TH QUESTION --> ANS: REDACTED
- 11TH QUESTION --> ANS: REDACTED
- 12TH QUESTION --> ANS: REDACTED
- 13TH QUESTION --> ANS: REDACTED
Lessons Learned
- Demodex TTPs (associated with Demodex, Salt Typhoon / Earth Estries & Ghost Emperor).
- PowerShell deobfuscation and reverse engineering (decrypt AES-256-CBC).
- Dynamic malware analysis using FLARE-VM and Process Hacker.
- Using API Monitor to capture win32 API function.
- Static malware analysis using PEStudio and Ghidra.