0. Preface
This sample came filed under LummaStealer as a password-protected ZIP,
which I treat as the initial dropper. Inside is one PE32 executable. The
family label turns out to be right: the restored binary is a LummaC2 4.0
build that identifies itself on the wire as
act=recive_message&ver=4.0&lid=tXk9hs--Linkedin.
The interesting part is not the stealer. The executable inside the archive does not parse. Its import directory points into x86 code, there is a 17 KB “overlay” of what looks like relocation data, and recognisable instruction sequences are broken up by the same odd byte runs again and again. Section 4 shows how the damage was reversed: two hex-level substitutions, each turning one nibble into seven, applied 5,747 times. Undoing them gives a binary that is exactly the right size, has a clean import table, and disassembles as ordinary compiled code. Everything after that is ordinary LummaC2 config extraction.
Everything below is static analysis. Nothing was executed, and none of the
recovered domains were contacted. Tools: pefile and capstone for parsing
and the linear sweep, radare2 for targeted disassembly, and unicorn to
emulate the string decoders.
1. The Threat at a Glance
| Attribute | Assessment |
|---|---|
| Malware type | Infostealer |
| Family | LummaC2 4.0 (self-identified: ver=4.0 in the C2 protocol) |
| Delivery | AES-encrypted ZIP → PE32 GUI executable |
| Payload | PE32 i386 GUI, MSVC-style C, not packed; 311,808 bytes once repaired |
| Build / LID | tXk9hs--Linkedin |
| Compile time | 0x67253391 → 2024-11-01 20:01:21 UTC |
| C2 | 9 domains (*.shop ×8, one .fun), base64 with a 32-byte XOR key; HTTP POST /api |
| Protocol | act=life check-in (expects ok) → act=recive_message&ver=4.0&lid=…&j=… config request → multipart/form-data upload |
| Targets | Chromium/Edge (Local State key, cookies, extensions), Firefox (key4.db, extension storage), Windows Mail / Thunderbird .eml, Steam config.vdf, clipboard, screenshot, process list, WMI system info |
| Evasion | Per-string stack-string encryption with MBA-obfuscated decoders; control-flow flattening through XOR-encoded indirect jumps; self-delete command line |
| Persistence | None identified |
| Sample condition | Hex-corrupted as received: cannot be loaded until repaired (§4) |
| Confidence | High for the repair, C2 table, LID, check-in and config request strings (byte-exact, reproduced offline). Medium for the theft targets (from decoded strings and imports, not traced collectors) |
2. Infection Chain Overview
![Infection chain: an AES-encrypted ZIP (7f76536f….zip) extracts cdff50f4….exe, a LummaC2 4.0 PE32; an analysis note explains that the EXE as shipped is hex-corrupted and is repaired by undoing two nibble substitutions, giving e9c8edff…; at runtime it decodes nine C2 domains from base64 with a 32-byte XOR key and decrypts stack strings with per-string ((i+K1)^b)+K2 loops; it checks in with POST /api act=life against each C2 in table order and keeps the first to answer ok; it requests its stealer config with act=recive_message&ver=4.0&lid=tXk9hs–Linkedin&j=; it steals Chromium/Edge and Firefox data, mail, Steam config, clipboard, screenshots, process list and system info; it exfiltrates with multipart/form-data POST /api to burnbravedhj[.]fun and eight .shop domains; it carries a cmd timeout-and-delete self-delete command](/malware-analysis/posts/lummac2-4-0-repairing-a-hex-corrupted-sample-to-recover-nine-c2s/infection-chain.png)
| Stage | File | SHA-256 | Role |
|---|---|---|---|
| 0 | 7f76536f….zip (179,583 B) | 7f76536fc2cb747da0329d261abf8162f8b3ae75857a873525584835b0d141af | AES-encrypted archive; initial dropper |
| 1 | cdff50f4….exe (329,049 B), as shipped | cdff50f4126445f55098d307fa40396a80396cc50d4d94c0c8a849b4de2b7da2 | LummaC2 payload, hex-corrupted, does not load |
| 1′ | repaired image (311,808 B) | e9c8edfff4fbb85755236636f1e3fca1312f80dbce63235c7042cf0e1bb10fcf | The same payload after §4: the binary that would actually run |
The archive extracts with the conventional sample-sharing password
infected. How it reached a victim — email attachment, download link,
anything earlier in the chain — isn’t visible from the archive itself.
3. Triage: A PE That Doesn’t Add Up
file reports PE32 executable for MS Windows 6.00 (GUI), Intel i386, 4 sections, and diec finds nothing. The section table itself is sane:
| Section | RVA | VSize | Raw size | Entropy |
|---|---|---|---|---|
.text | 0x1000 | 0x3f65a | 0x3f800 | 6.69 |
.rdata | 0x41000 | 0x255d | 0x2600 | 6.72 |
.data | 0x44000 | 0xf070 | 0x5e00 | 6.87 |
.reloc | 0x54000 | 0x413c | 0x4200 | 6.36 |
Three things are wrong, though.
- No imports. The data directory points the import table at RVA
0x43038, inside.rdata, butpefileandrabin2both return nothing. Dumping the descriptors by hand shows why: they are x86 code (56 8b 74 24 08 c7 06 00 00 00 00 e8 e0 ff ff ff …—push esi; mov esi,[esp+8]; mov dword [esi],0; call …). The Windows loader would fail at the same place. - A 17,241-byte overlay. Sections end at file offset
0x4c200(311,808), but the file is 329,049 bytes. The tail is clearly relocation-block data: page RVA / block size pairs followed by0x3xxxHIGHLOWentries. It isn’t an appended payload; it is the end of.relocpushed past the end of the section. - Recurring byte runs in the middle of instructions. The 4-grams
00 e0 4e b7(1,405×),f0 e0 4e b7(620×) and80 38 13 ad(543×) are among the most common in the file, right after90 90 90 90and00 00 00 00. They sit where opcodes should be:
… 83 0e 04 eb 78 23 75 08 … expected 83 f8 23 75 08 cmp eax,0x23 ; jne
… 83 f8 00 00 e0 4e b7 95 c0 … expected 83 f8 00 0f 95 c0 cmp eax,0 ; setne al
… 55 53 57 56 80 38 13 ad ec 28 expected 55 53 57 56 83 ec 28 push… ; sub esp,0x28
So something was inserted into the file, shifting everything after the
first insertion forwards. That explains all three symptoms at once: the
import descriptors were pushed past the RVA that points at them, and the end
of .reloc was pushed into what now looks like an overlay.
4. Repairing the Binary
4.1 The insertions are nibble-aligned
Look at the first example again in hex text instead of bytes:
seen 8 3 0 e 0 4 e b 7 8 2 3 7 5 0 8
expected 8 3 f 8 2 3 7 5 0 8
The f nibble has been replaced by the seven nibbles 0e04eb7. That is why
the 4-gram counts above came in several shifted forms: the token can start on
either half of a byte. Counting in the hex string instead of in bytes settles
it:
| Hex substring | Occurrences | Neighbour |
|---|---|---|
e04eb7 | 3,564 | always preceded by 0 → token 0e04eb7 |
3813ad | 2,183 | always followed by e; preceded only by 0, 4, 8 or c |
Each token replaces one nibble with seven, adding six nibbles. Across both:
(3,564 + 2,183) × 6 nibbles = 34,482 nibbles = 17,241 bytes
329,049 − 17,241 = 311,808 = PointerToRawData + SizeOfRawData of .reloc
The arithmetic closes exactly, so these two tokens account for all of the damage. There is no third pattern hiding elsewhere.
4.2 What each token stands for
Token 1, 0e04eb7. Its right-hand neighbours are dominated by b6, b7,
84, 85 and 95, and its left-hand neighbour is always 0. That is the
0F two-byte opcode escape: 0f b6 / 0f b7 (movzx), 0f 84 / 0f 85
(je / jne rel32), 0f 95 (setne). Token 1 replaces f.
Token 2, 3813ad. This one is less direct. The e that always follows it
is genuine original data, and the nibble immediately before it has been
altered. In the sub esp,0x28 example:
seen 8 [0 3 8 1 3 a d] e c 2 8
expected 8 3 e c 2 8
and in a mov eax,0xffffffff that ends just before a jmp:
seen … f f f [c 3 8 1 3 a d] e 9 d 8 0 0 0 0 0 0 (b8 ff ff ff ?? / e9 …)
expected … f f f f e 9 d 8 0 0 0 0 0 0
The preceding nibble N is only ever 0, 4, 8 or c, meaning its two low
bits are clear, and the originals are 3, 7, b and f. The rule is: drop
3813ad, and set the two low bits of the nibble before it: N3813ad → N|3.
N seen | Count | Restored |
|---|---|---|
0 | 894 | 3 |
c | 756 | f |
4 | 278 | 7 |
8 | 255 | b |
Not every f, 3, 7 or b was rewritten; most literal ff ff ff ff
immediates are intact. So this is a selective substitution, not a fixed
encoding of the whole file. Who did it, and why, isn’t determinable from the
file: it may be deliberate tampering to break hash- and parser-based tooling,
or damage introduced while the sample was being handled. Either way the
result can’t run, and the payload’s own code contains nothing that undoes it.
4.3 The repair
import re, sys
h = open(sys.argv[1], "rb").read().hex()
h = h.replace("0e04eb7", "f")
h = re.sub("([0-9a-f])3813ad", lambda m: "%x" % (int(m.group(1), 16) | 3), h)
open(sys.argv[2], "wb").write(bytes.fromhex(h))
The two tokens never touch each other in this file (no 0e04eb7 is directly
followed by 3813ad, or the other way round), so the order of the two
replacements doesn’t matter.
4.4 Verifying it
The tokens are fully constrained by context, but the fix still needs checking against something independent. Three checks, in increasing order of strength:
- Size. The output is 311,808 bytes: exactly the end of
.reloc, with no overlay left over. - Layout. The import directory now parses into six DLLs with real names (§5). Taken alone this proves little: brute-forcing all 256 possible (token 1, token 2) replacement pairs shows every pair fixes the layout, because what was wrong was the length. Choosing the right values needs the next check.
- Code. A linear capstone sweep over all of
.textin the repaired file hits only 9 positions it can’t decode. The ones I inspected sit in junk bytes right after the flattenedjmp eax/jmp ecxdispatchers (§5), which a linear sweep can’t tell apart from code. The obvious-but-wrong reading, replacing the whole3813adewith one fixed nibble, gives 121 (as3) to 253 (asf) undecodable positions. It also gives 37583 ec(sub esp, imm8) sequences against 572 for the correct rule.
| Hash | As shipped | Repaired |
|---|---|---|
| SHA-256 | cdff50f4126445f55098d307fa40396a80396cc50d4d94c0c8a849b4de2b7da2 | e9c8edfff4fbb85755236636f1e3fca1312f80dbce63235c7042cf0e1bb10fcf |
| SHA-1 | 0bdd79513dd36d56299b403b60bb2aca03db8baa | 21673f07d72450b0f6d69bc1c8b67677fc2bb4a3 |
| MD5 | 7e7a8d2d7b5c0cdbbcd532e16dc05391 | 6d825a46f2be17d80c85036cfea388c2 |
5. The Repaired Binary
The import table is the familiar LummaC2 shape: small, because most APIs are resolved at runtime, but enough to see what it is for:
| DLL | Imports |
|---|---|
KERNEL32 | CopyFileW, ExitProcess, GetCommandLineW, GetCurrentProcessId, GetCurrentThreadId, GetLogicalDrives, GetSystemDirectoryW, GlobalLock, GlobalUnlock |
USER32 | OpenClipboard, GetClipboardData, CloseClipboard, GetForegroundWindow, FindWindowExW, GetWindowThreadProcessId, GetWindowLongW, IsWindowVisible, IsWindowEnabled, GetSystemMetrics, GetDC, ReleaseDC |
GDI32 | CreateCompatibleDC, CreateCompatibleBitmap, CreateDIBSection, BitBlt, StretchBlt, GetDIBits, GetPixel, GetObjectW, GetCurrentObject, SelectObject, DeleteObject, DeleteDC |
ole32 | CoInitializeEx, CoInitializeSecurity, CoCreateInstance, CoSetProxyBlanket, CoUninitialize |
SHELL32 | SHGetFileInfoW, SHEmptyRecycleBinW |
OLEAUT32 | SysReAllocString, SysStringLen, VariantCopy, VariantClear (by ordinal) |
Read across: clipboard theft (USER32), screenshot capture (GDI32), WMI
queries over COM (CoInitializeSecurity + CoSetProxyBlanket is the
standard WMI client setup), and drive enumeration. There are no network APIs.
WinHTTP is loaded at runtime.
The control flow is flattened. Branches are replaced with indirect jumps whose
targets come from a table in .data XORed with a constant:
mov eax, dword [eax*4 + 0x444ab4] ; pick slot by a 0/1 condition
mov ecx, 0xc26630c9
xor ecx, dword [0x444abc] ; decode the bias
add eax, ecx
inc eax
jmp eax
That defeats naive recursive-descent disassembly and confuses decompilers about function boundaries. It doesn’t hide data references, which is enough for what follows.
6. Configuration
6.1 The C2 table
Nine base64 strings sit in .rdata starting at 0x442b31, 0x81 bytes
apart, all sharing the same 43-character prefix:
Zv9Bhrl8esJEig2zi1epvJ34JPZ/rDRM3JvXXl3ygn8LkDTy0RkMpyr+eMDjLYfP9ZdU
Zv9Bhrl8esJEig2zi1epvJ34JPZ/rDRM3JvXXl3ygn8UmjL23B8OoyblftrxedrU8og=
…
The shared prefix is the key. Each decodes to 32 bytes of XOR key followed by the ciphertext, which is the scheme LummaC2 builds of this period use:
d = base64.b64decode(s)
key, ct = d[:32], d[32:]
host = bytes(b ^ key[i % 32] for i, b in enumerate(ct))
Every one of the nine decodes to a clean hostname.
6.2 Check-in order
The strings aren’t used in the order they appear in .rdata. A pointer
table at 0x4426d8 lists them in reverse, and the selection loop walks it
4 bytes at a time until offset 0x24, which is nine entries:
0x40e6af add edx, 4
0x40e6b4 cmp edx, 0x24 ; 9 entries
… ; flattened branch
0x40e6da push dword [edx + 0x4426d8] ; encoded C2 string
0x40e6e0 call 0x436490 ; base64 + XOR decode
…
0x40e6fc call 0x40f0b0 ; check-in (§7.1) → bool
… ; on success, copy host to 0x449d1c
| Order | Pointer | Domain |
|---|---|---|
| 1 | 0x442f39 | burnbravedhj[.]fun |
| 2 | 0x442eb8 | worddosofrm[.]shop |
| 3 | 0x442e37 | mutterissuen[.]shop |
| 4 | 0x442db6 | standartedby[.]shop |
| 5 | 0x442d35 | nightybinybz[.]shop |
| 6 | 0x442cb4 | conceszustyb[.]shop |
| 7 | 0x442c33 | bakedstusteeb[.]shop |
| 8 | 0x442bb2 | respectabosiz[.]shop |
| 9 | 0x442b31 | moutheventushz[.]shop |
The one .fun domain is tried first, and the eight .shop domains are its
fallbacks.
6.3 The build ID
The plaintext string tXk9hs--Linkedin sits at 0x442b10, just before the
C2 strings. It is reached through a small config structure in .data at
0x444720, which also points at a 32-byte blob at 0x44300e:
0x444720: 00000001 0c5d0d2e 00000000 00000000
0x444730: 00442b10 0044300d … ; → "tXk9hs--Linkedin", → 32-byte blob
[0x444730] is read at 0x410cb6, directly beside the decoded
act=recive_message&ver=4.0&lid= string, so this is the LID. It has the
<id>--<tag> shape of Lumma build IDs; the tag is chosen by whoever built
the sample.
[0x444734] is read near the decoded &j=, so the blob most likely supplies
the j parameter. I didn’t confirm how it is encoded on the wire.
7. String Obfuscation
Apart from the C2 table and the LID, the strings that matter are built on the stack and decrypted in place, one loop per string. The simplest form:
mov dword [esp + 0x34], 0x1b8f15b9 ; … 20+ immediates …
mov word [esp + 0x70], 0x5150
xor eax, eax
loop:
mov ecx, eax
add cl, 0x8a ; K1
xor cl, byte [esp + eax + 0x18]
add cl, 0x4e ; K2
mov byte [esp + eax + 0x18], cl
inc eax
cmp eax, 0x5f ; length
jne loop
That is b[i] = ((i + K1) ^ b[i]) + K2 with per-string constants. That is
only the easiest variant, though. Classifying every short backward loop that
writes to [esp + reg + disp] turns up roughly ten shapes. Most are the same
transform rewritten with mixed boolean-arithmetic identities, for example:
movzx edx, byte [esp+ecx+K] ; mov ebx, edx ; and ebx, ecx ; add bl, bl
sub dl, bl ; movzx edx, dl ; add edx, ecx ; add dl, K ; mov [esp+ecx+K], dl
(x - 2·(x & i) + i is x ^ i.) Writing a pattern for each shape is
tedious and brittle, so I emulated them instead. For each decoder loop, walk
backwards to the start of its straight-line setup block, emulate from there
to the loop exit in unicorn (skipping calls and mapping unmapped pages on
demand), then read the buffer back. The connectivity probe (§7.1) needed one
loop run by hand because its setup is split across a flattened branch.
Readable output, grouped:
| Area | Decoded strings |
|---|---|
| Protocol | /api, POST, act=life, ok, act=recive_message&ver=4.0&lid=, &j=, act, pid, Content-Type: application/x-www-form-urlencoded\r\n, Content-Type: multipart/form-data; boundary=, \r\nContent-Disposition: form-data; name=" |
| Chromium / Edge | \Local State, os_crypt.encrypted_key, Network\Cookies, host_key, value, http_only, Default, profile.info_cache, /Extensions/, \Sync Extension Settings\, Chrome_WidgetWin_1, msedge.exe |
| Firefox | \key4.db, \storage\default\moz-extension+++ |
\Microsoft\Windows Mail\Local Folders, Mails/Windows Mail, \Packages, *.eml, Thunderbird | |
| Steam | steam.exe, \config\config.vdf |
| Output files | Processes.txt, Debug.txt, /New.txt |
| Cleanup | cmd.exe "start /min cmd.exe "/c timeout /t 3 /nobreak & del " |
Chrome_WidgetWin_1 (the Chromium top-level window class) together with
msedge.exe and the FindWindowExW / GetWindowThreadProcessId imports
suggests it looks for running Chromium/Edge windows. I didn’t trace what it
does with them.
7.1 The check-in
0x40f0b0, called once per C2 from the loop in §6.2, decodes three strings
and one comparison constant:
act=life
Content-Type: application/x-www-form-urlencoded\r\n
/api
ok
So the check-in is POST /api with body act=life, and the host is accepted
if the reply is ok. Once a C2 is chosen, the config request is
act=recive_message&ver=4.0&lid=tXk9hs--Linkedin&j=… (the misspelled
recive is the malware’s own and makes a good network signature). Stolen
data then goes up as multipart/form-data to the same /api path. LummaC2
4.x fetches much of its collection list (wallet extensions, file-grab rules)
from the C2 config at runtime, which fits how thin the static target strings
are here. I didn’t see that config, because no C2 was contacted.
8. Indicators of Compromise
Files
| Item | SHA-256 |
|---|---|
| ZIP (initial dropper) | 7f76536fc2cb747da0329d261abf8162f8b3ae75857a873525584835b0d141af |
| EXE as shipped (corrupted) | cdff50f4126445f55098d307fa40396a80396cc50d4d94c0c8a849b4de2b7da2 |
| EXE repaired | e9c8edfff4fbb85755236636f1e3fca1312f80dbce63235c7042cf0e1bb10fcf |
The repaired hash is a research identifier, not a scanning IOC: this exact file was never observed, only reconstructed. If the original build exists in the wild, this is what its hash should be, but that is an inference.
Network
burnbravedhj[.]fun
worddosofrm[.]shop
mutterissuen[.]shop
standartedby[.]shop
nightybinybz[.]shop
conceszustyb[.]shop
bakedstusteeb[.]shop
respectabosiz[.]shop
moutheventushz[.]shop
POST /api body: act=life (expects "ok")
POST /api body: act=recive_message&ver=4.0&lid=tXk9hs--Linkedin&j=…
POST /api Content-Type: multipart/form-data (exfiltration)
Host
cmd.exe "start /min cmd.exe "/c timeout /t 3 /nobreak & del "<self>"
Staged output names: Processes.txt, Debug.txt
Constants for hunting / YARA
| Value | Use |
|---|---|
Zv9Bhrl8esJEig2zi1epvJ34JPZ/rDRM3JvXXl3ygn8 | base64 of the shared 32-byte C2 XOR key (build-specific) |
tXk9hs--Linkedin | LID, plaintext in .rdata |
0e04eb7, 3813ad (hex text) | corruption tokens; useful for spotting other copies of the same damaged file |
9. Detection Opportunities
- Network. An HTTP
POST /apiwhose body is exactlyact=life, followed by one containingact=recive_message&ver=, is a high-fidelity LummaC2 check-in pattern regardless of domain. Newly registered.shopdomains with random-English names make a good secondary filter. - Static. The nine base64 strings share a 43-character prefix because they
share a key. Any run of
.rdatastrings with a long common base64 prefix that decodes to32 bytes + short ASCIIis worth a rule. The plaintext--Linkedin-style LID next to them is a cheap anchor. - Behaviour. A process with no browser lineage opening
Local State,Network\Cookiesand Firefoxkey4.dbin quick succession, then making a multipart upload, then launchingcmd.exe /c timeout /t 3 /nobreak & delon its own path. - Triage hygiene. A PE whose import directory decodes as code, and whose overlay looks like relocation blocks, has been shifted by an insertion. Count recurring nibble runs before concluding it is packed or broken.
10. MITRE ATT&CK
| Tactic | Technique |
|---|---|
| Initial Access / Execution | T1204.002 User Execution: Malicious File (delivery vector assumed from the archive; not observed) |
| Defense Evasion | T1027 Obfuscated Files or Information (stack-string encryption, MBA decoders, control-flow flattening); T1140 Deobfuscate/Decode Files or Information (base64 + XOR C2 table); T1070.004 Indicator Removal: File Deletion (self-delete command) |
| Discovery | T1082 System Information Discovery; T1057 Process Discovery (Processes.txt); T1047 Windows Management Instrumentation (COM/WMI client setup) |
| Credential Access | T1555.003 Credentials from Web Browsers (Local State / os_crypt.encrypted_key, key4.db); T1539 Steal Web Session Cookie (Network\Cookies) |
| Collection | T1114.001 Email Collection: Local Email Collection (Windows Mail, Thunderbird .eml); T1115 Clipboard Data; T1113 Screen Capture; T1005 Data from Local System (Steam config.vdf) |
| Command and Control | T1071.001 Application Layer Protocol: Web Protocols (POST /api) |
| Exfiltration | T1041 Exfiltration Over C2 Channel (multipart/form-data) |
11. Confidence and Gaps
Traced and verified: the corruption model (two tokens, exact byte
accounting, a clean import table, and 9 undecodable .text positions in junk
bytes against 121–253 for the wrong reading); the C2 encoding and all nine hostnames; the check-in order (pointer
table and loop bound read from the code); the LID and its use beside the
act=recive_message&ver=4.0&lid= string; the act=life / ok check-in
strings in the function the C2 loop calls.
Identified but not traced: the individual collectors (§7 is decoded
strings plus imports, not followed code paths); the self-delete (the command
string is decoded, but I didn’t follow the call that launches it); the
encoding of the j parameter; the 32-byte blob at 0x44300e.
Still open:
- Partial string coverage. Emulation recovered 38 clean strings from roughly 240 stack-built buffers. Most of the rest have their setup split across flattened branches, which the block-local emulation doesn’t follow. A Steam-profile or Telegram dead-drop fallback, which some Lumma builds carry, would be in that remainder if present. I found none.
- Origin of the corruption. The file can’t run as shipped. Whether the substitutions were deliberate (for example to defeat hash matching or automated sandboxes) or damage from handling isn’t knowable from this one file.
- Delivery. The archive uses the sample-sharing password
infected, and nothing in it shows how it reached a victim. - C2 behaviour unobserved. No domain was contacted, so liveness, the config the server returns, and any follow-on payloads are unknown.