unpack#4

Malware unpacking · 6 objects · 6 static reports · generated 2026-10-16 17:07:18 UTC

Task outcome

3 unpacked objects

AI report excerpt

The submitted root is not an archive or installer — it is a raw PowerShell text script, so there are no container members, resources or transport wrappers to extract and return. All recovered objects are genuine transform outputs (see below), not extracted members. No #UPX.Unpacked or other virtual files exist on the beacon (virtual-file and carved-file listings are empty). No multi-file containers were involved at any stage.

Read full analysis

Kesakode detections

1 match

Highest recorded code-similarity score per name across analysed objects.

  • CobaltStrike64.0%
Unpacked objects

stage2_loader.ps1

ID 6687
File type text/utf8
Category DOCUMENT
Architecture NONE
Size 275.7 KiB
Kesakode No verdict available
SHA256 b154b7681167bd4a61c54b543126f31d0ecca4c71846d5fe35a677c908fae3d1

beacon.dll

ID 6688
File type PE
Category PROGRAM
Architecture X86
Size 205.0 KiB
Kesakode match CobaltStrike (64.0%)
SHA256 bd46714acbcdf56115425b9e1ee0b19e47c72db1633713c0f962c0181bed772d

beacon_config_decoded.bin

ID 6691
File type ?
Category UNKNOWN
Architecture NONE
Size 8.5 KiB
Kesakode No verdict available
SHA256 b03294d304cfb91d24e14b73ab14987346f276dc813f9d7d1f443e7192c455d8
Unpacking report

Malcat Static Unpacking Report — "unpack#4" (Cobalt Strike multi-stage PowerShell dropper)

File description

  • Submitted sample unpack#4 — analysis , 195,252 bytes, detected text/utf8 (PowerShell), entropy 159, SHA-256 4109d17d439e425d24e9d11956adcc63ff8e24ccfffe21dd8c5431fe969d2783. It is a single-line PowerShell dropper: $s=New-Object IO.MemoryStream(,[Convert]::FromBase64String("<blob>"));IEX (New-Object IO.StreamReader(New-Object IO.Compression.GzipStream($s,[IO.Compression.CompressionMode]::Decompress))).ReadToEnd(); The Base64 blob sits at file offset #0x3c, length 195,056 (0x2F9F0) bytes, ending at #0x2fa2b; it begins with H4sIA (gzip magic).
  • Stage 2 — analysis , 282,367 bytes, SHA-256 b154b7681167bd4a61c54b543126f31d0ecca4c71846d5fe35a677c908fae3d1: a PowerShell here-string ($DoIt = @' ... '@) containing classic in-memory injection helpers (func_get_proc_address, func_get_delegate_type), a Base64 payload blob at #0x692 (length 279,910 = 0x44566, ending #0x44bf7), a per-byte XOR-decode loop, then VirtualAlloc (0x3000/0x40) → Marshal.Copy → delegate call (in-memory shellcode execution); on 64-bit PowerShell it re-runs itself 32-bit via start-job -RunAs32.
  • Stage 3 (final payload) — analysis , 209,923 bytes, PE32 (X86) DLL named beacon.dll, SHA-256 bd46714acbcdf56115425b9e1ee0b19e47c72db1633713c0f962c0181bed772d, entrypoint 0x100161fa, image base 0x10000000, export date 2021-03-02 12:20:45. Malcat verdict: CobaltStrike 64/100. Exports _ReflectiveLoader@4 at 0x10008852 (reflective loader). CAPA confirms full C2 implant behavior: HTTP/DNS/socket C2, process creation (incl. suspended), PPID spoofing, token impersonation, RWX allocation + indirect call (shellcode execution), stack strings, runtime linking/PE-export parsing, AES/SHA-256/Base64/XOR, import-by-hash-style resolution (24 hits), 30 XOR-in-loop routines.
  • Decrypted C2 configuration — analysis (XOR-0xE9-decoded .data of the beacon, 8,704 bytes, SHA-256 b03294d304cfb91d24e14b73ab14987346f276dc813f9d7d1f443e7192c455d8): the beacon's obfuscated configuration block at VA 0x10032020 (RVA @0x32020, file offset #0x30220), preceded by 0xFF padding.

Container handling

The submitted root is not an archive or installer — it is a raw PowerShell text script, so there are no container members, resources or transport wrappers to extract and return. All recovered objects are genuine transform outputs (see below), not extracted members. No #UPX.Unpacked or other virtual files exist on the beacon (virtual-file and carved-file listings are empty). No multi-file containers were involved at any stage.

Packing evidence

  • Stages 1–2: text scripts; concealment is purely encoding/compression/encryption (Base64 + gzip; Base64 + single-byte XOR). No PE packing involved.
  • Stage 3 (beacon.dll, ): not packed. Evidence: normal MSVC 2008 linker/Rich header; section entropies are unremarkable (.text 139, .rdata 128, .data 70, .reloc 59 — no high-entropy packed section); standard section layout (.text VA 0x10001000 152,064 B RX; .rdata VA 0x10027000 39,936 B; .data VA 0x10031000 8,704 B file / 45,056 B virtual; .reloc VA 0x1003c000 8,192 B); no UPX; no resources; only a 3-byte overlay at #0x33400; no virtual or carved files; no embedded PE and no Base64-encoded PE (a YARA rule searching "User-Agent", "http://", "https://", ".dll", "\\\\.\\pipe\\", "Content-Type" under all 255 single-byte XOR keys produced exactly one hit — the config string at VA 0x100327de — and no embedded MZ/TVq payload). The obfuscation observed inside the beacon (import-by-hash, stack strings, spaghetti code, XOR loops) is the standard Cobalt Strike beacon design, not an additional packer. The beacon is the terminal payload; no further concealed executable stage is supported by evidence.

Encryption/packing methods and keys found

  1. Stage 1 → Stage 2 ( → ) — Base64 + gzip. Blob at #0x3c (195,056 bytes). Recovered with Malcat transforms base64 decode + gzip decompress on that interval. Genuine unpacking (compression reversed), not ordinary extraction.
  2. Stage 2 → Stage 3 ( → ) — Base64 + single-byte XOR, key 35 (decimal) = 0x23, per the script's loop $var_code[$x] = $var_code[$x] -bxor 35. Blob at #0x692 (279,910 chars). Recovered with base64 decode + xor (key 23). The output is a fully valid PE32 with correct MZ/PE headers and consistent section layout — strong static validation of the key. Genuine unpacking. (The decoded buffer is what the script copies into VirtualAlloc'd memory and calls.)
  3. Beacon-internal C2 configuration ( → ) — the Cobalt Strike configuration block embedded in .data is obfuscated with single-byte XOR key 0xE9. The key was found empirically: the YARA single-byte-XOR search matched "Content-Type" at VA 0x100327de; 0xAA ^ 'C'(0x43) = 0xE9, verified across the whole string. (The commonly cited CS key 0x2E was tested first and yielded no valid strings — those test transforms / are failed experiments, not deliverables.) The config was recovered by XOR-0xE9-transforming .data (VA 0x10031000, 8,704 bytes). Genuine decryption of concealed data (not an executable stage).
    • Empirical setting format: 6-byte header — u16 BE setting ID, u16 BE type (1 = 2-byte int, 2 = 4-byte int, 3 = blob), u16 BE length — followed by the value.
    • Key recovered settings (offsets are within the decoded .data buffer ):
      • 0x0001 BeaconType = 8 (raw; consistent with an HTTPS-class beacon given port 443)
      • 0x0002 Port = 443 (0x01BB)
      • 0x0003 Sleep time = 60000 ms; 0x0004 Max get size = 1,048,576; 0x0005 Jitter = 0
      • 0x0007 Public key: 256-byte blob containing a 162-byte RSA-1024 public-key DER (modulus 128 bytes starting A9 2C FC 93 14 F4 77 6E 07 26 72 44 FB 30 DE 5E E9 15 72 E8 71 00 A7 CA 9E AE 6B 82 A1 4D 47 1C B1 90 44 B8 7A 08 0D F9 9F 21 3A 4F 54 F2 24 6F EA 2…, ending …33 50 1A DA EC 18 D1, exponent 65537)
      • 0x0008 C2 server = "120.48.85.228,/cm" (zero-padded 256-byte blob) → C2 IP 120.48.85.228
      • 0x0009 = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)" (user agent)
      • 0x000a = "/submit.php" (C2 URI)
      • 0x001b = "POST" (HTTP verb)
      • 0x001d = %windir%\syswow64\rundll32.exe and 0x001e = %windir%\sysnative\rundll32.exe (spawnto paths)
      • 0x000c (512-byte blob) contains "Cookie"; 0x000d (512-byte blob) contains "&Content-Type: application/octet-stream" plus binary transform fragments
      • 0x0043 = 0; 0x0044/0x0045/0x0046 = 0xFFFFFFFF; 0x0032 = 1; 0x0023 = 2; 0x0025 = 520; 0x0036/0x0039/0x003a = 128-byte binary blobs
    • Setting semantic names follow the standard Cobalt Strike configuration layout; raw IDs and values are reported exactly as observed.

Extraction vs. unpacking distinction: no ordinary archive extraction occurred (no containers existed). Stage 2 and stage 3 are genuine unpacking results (Base64+gzip and Base64+XOR reversed with precise Malcat transforms); the beacon config is a genuine decryption of concealed embedded data, not a further payload.

Unresolved blockers / limitations:

  • The configuration TLV walk was not completed to the final byte (analysis budget exhausted while enumerating settings; the block continues past decoded offset 0x1B78, after setting 0x0039; regions 0x18F0–0x192F and 0x1B40–0x1B6F are zero padding inside blobs). All security-relevant settings (C2, port, URI, UA, key, timing) were recovered.
  • No behavioral/dynamic validation was performed (per task limits); recovery is validated statically (valid PE output; self-consistent setting chain across 20+ settings).
  • Runtime C2 session decryption (per-session RSA/AES keys) is not statically recoverable and was not attempted.