cover image for post 'The DGA of PartisanDNS'

The DGA of PartisanDNS

Advent of DGAs - Day 4

Today I investigate Solar 4RAYS’ report Partisan Zmiy: снова на радаре from October 2nd, 2026. It covers an intrusion into a medical organization by the Cyber Partisans group, which Solar 4RAYS tracks as Partisan Zmiy. Among the attackers’ tools is a DNS tunnel the authors call PartisanDNS which uses DGA domains. Solar lists these 19 examples:

  • vpnosljjk[.]pro
  • vfvnfaq[.]top
  • vfvnfaq[.]link
  • vfvnfaq[.]cyou
  • vfvnfaq[.]pro
  • vfvnfaq[.]me
  • vfvnfaq[.]my
  • vfvnfaq[.]buzz
  • vfvnfaq[.]info
  • vfvnfaq[.]space
  • vfvnfaq[.]in
  • vfvnfaq[.]sbs
  • vfvnfaq[.]work
  • vfvnfaq[.]casa
  • vfvnfaq[.]lol
  • vfvnfaq[.]lat
  • vfvnfaq[.]net
  • vfvnfaq[.]org
  • vfvnfaq[.]com

The report never shows the algorithm, though. It gives no code, seed, schedule or explanation of how those names come about. The news articles that picked up the report repeat the domains as IOCs and add nothing about the DGA. The earlier Kaspersky ICS CERT report on Cyber Partisans covers their DNSCat2 tunnels but neither PartisanDNS nor a DGA. As far as I can tell, the algorithm has not been described anywhere, so this post takes the two available public PartisanDNS samples from the report’s appendix and reverses them:

Fieldsample Asample B
MD5a6ce67f063fce60954bb6cea4c969aac2538be4331f69dbf4a9b79565fd39581
SHA156df605a33fb77c91bdb92033efe983f336deb23d93f810fa02c3d4391810ab512519d89f2f0ceee
SHA2564f0e23a83d83d901c76353d8b9b6ee2940eb63d531ad15f736193903b5c7c8c3e55431d6f15aa78ada3f60ed30a3f32b444b952bdc53a652546c1820f8bfa513
File size110,080 bytes256,512 bytes
FormatPE32+ DLL (Windows service DLL)PE32+ EXE (GUI subsystem)
Architecturex86-64 (AMD64)x86-64 (AMD64)
LanguageCC
Runtimemsvcrt.dll (no .NET, no VC++ redistributable)msvcrt.dll (no .NET, no VC++ redistributable)
VirusTotal4f0e23a8…e55431d6…

Unpacking

Neither binary is packed in the classic sense. There is no compressed section, no overlay and no loader stub. Instead, every interesting string and one embedded blob are encrypted with a small table-driven cipher. The cipher is simple: Each encrypted string is followed by a one-byte key K, and every byte is decoded as:

K ^ enc[i] ^ rol8(T[i mod n], i)

where T is the key table and n its length. The two builds differ in how T is obtained.

Sample A

The first sample keys its table to the victim network:

  1. At start-up it calls GetIpNetTable to read the ARP cache.
  2. It hashes each neighbour’s 6-byte MAC address using a custom sponge function whose internal state consists of five 64-bit words.
  3. It compares the hashes against nine stored values.
  4. Each match decrypts its own 51-byte copy of T. A per-byte majority vote over the matches, lowercased, gives the final table.

On a machine whose ARP cache does not contain one of those nine MACs, the implant has no key and every string decodes to garbage. The following screenshot shows how the ARP cache is read:

Calls to GetIpNetTable

Because the input is only 48 bits, the hashes can be inverted offline. A meet-in-the-middle search took under six seconds and found one MAC per hash.

  • Eight of the MACs start with the VMware prefix 00:50:56:AF.
  • One starts with 00:1C:7F.

The MACs might belong to the intended target’s VMware infrastructure. All nine decrypt the same table:

ssmes3w2kzwgdrt9hldsqiuifyishgeajoedpa84vy2fc1yad0o

Sample B

Sample B uses a 40-byte table that is built at run time and does not rely on external input. It is kept on the heap, XOR-masked with a value derived from its own pointer. The table is:

39grs3ppcv0pyjqeiuzperyrjwyxgrq37ffwx1kv

Decryption Script

The following script performs both decryptions statically. It checks the sample hash, rebuilds the table and prints the strings relevant to domain generation.

#!/usr/bin/env python3
"""Statically decrypt the DGA and C2-related strings from the two samples 

Reads the PE file from disk and never executes it. No network or DNS access.

sample A: the 51-byte string key table is encrypted under nine host MAC
          addresses (ARP-table keying). The script decrypts it with the MAC
          preimages recovered offline, takes a per-byte majority vote and
          lowercases the result, as the sample does at run time.
sample B: the 40-byte key table is built at run time; the value below was
          recovered by known-plaintext and is checked here against the
          decrypted suffix list.

Usage: extract_domains.py <sample A/b> 
"""
import argparse
import hashlib
import struct
import sys
from collections import Counter

M64 = (1 << 64) - 1

SAMPLE_A_SHA256 = "4f0e23a83d83d901c76353d8b9b6ee2940eb63d531ad15f736193903b5c7c8c3"
SAMPLE_B_SHA256 = "e55431d6f15aa78ada3f60ed30a3f32b444b952bdc53a652546c1820f8bfa513"

# MAC addresses whose sponge hash equals the nine stored hashes (recovered
# offline by meet-in-the-middle search; they are preimages, not proven to be
# the authors' real hosts).
SAMPLE_A_MACS = [
    "00:1c:7f:6e:81:e1", "00:50:56:af:a5:23", "00:50:56:af:87:00",
    "00:50:56:af:c3:fe", "00:50:56:af:af:92", "00:50:56:af:7a:ae",
    "00:50:56:af:6c:1b", "00:50:56:af:a1:7e", "00:50:56:af:26:d4",
]
SAMPLE_B_TABLE = b"39grs3ppcv0pyjqeiuzperyrjwyxgrq37ffwx1kv"


def rol64(x, r):
    return ((x << r) | (x >> (64 - r))) & M64


def rol8(x, r):
    r &= 7
    return ((x << r) | (x >> (8 - r))) & 0xFF


def sponge_init(seed):
    s = [seed ^ (0x1111111111111111 * k) for k in range(5)]
    for i in range(20):
        a = i % 5
        s[a] = ((s[(i + 1) % 5] << 7) & M64) ^ ((s[a] + s[(i + 3) % 5]) & M64) ^ (s[(i + 2) % 5] >> 13)
    return s


def mac_hash(mac, seed=91327231):
    s = sponge_init(seed)
    for i, b in enumerate(mac):
        a = i % 5
        s[a] = ((rol64(s[a], 13) + s[(i + 1) % 5]) & M64) ^ ((b << ((8 * i) & 0x3D & 63)) & M64)
    h = 0
    for v in s:
        h ^= v
    return h


def key_table_decrypt(mac, ct, seed=91327231):
    s = sponge_init(seed)
    out = bytearray()
    for i, c in enumerate(ct):
        a = i % 5
        s[a] = (s[(i + 1) % 5] + rol64(s[a], 13)) & M64
        out.append((s[(i + 2) % 5] & 0xFF) ^ mac[i % len(mac)] ^ c ^ (s[a] & 0xFF))
    return bytes(out)


def decode(enc, key, table):
    return bytes(key ^ e ^ rol8(table[i % len(table)], i) for i, e in enumerate(enc))


def walk(data, start, end, table):
    """Walk consecutive [ciphertext incl. NUL][key byte] records."""
    pos, out = start, []
    while pos < end:
        for n in range(2, 1024):
            if pos + n >= len(data):
                return out
            plain = decode(data[pos:pos + n], data[pos + n], table)
            if plain[-1] == 0:
                text = plain[:-1]
                if text and all(32 <= c < 127 for c in text):
                    out.append((pos, text.decode()))
                    pos += n + 1
                    break
        else:
            return out
    return out


class PE:
    def __init__(self, data):
        self.data = data
        pe = struct.unpack_from("<I", data, 0x3C)[0]
        nsec = struct.unpack_from("<H", data, pe + 6)[0]
        opt = struct.unpack_from("<H", data, pe + 20)[0]
        self.base = struct.unpack_from("<Q", data, pe + 24 + 24)[0]
        self.secs = []
        for k in range(nsec):
            o = pe + 24 + opt + 40 * k
            vsize, va, rsize, raw = struct.unpack_from("<IIII", data, o + 8)
            self.secs.append((va, max(vsize, rsize), raw))

    def off(self, va):
        rva = va - self.base
        for sva, size, raw in self.secs:
            if sva <= rva < sva + size:
                return rva - sva + raw
        raise ValueError(hex(va))


def sample_a(data):
    pe = PE(data)
    entries = []
    t = pe.off(0x180017060)
    for i in range(9):
        h, n, p = struct.unpack_from("<QQQ", data, t + 24 * i)
        entries.append((h, data[pe.off(p):pe.off(p) + 51]))
    tables = []
    for mac_s in SAMPLE_A_MACS:
        mac = bytes.fromhex(mac_s.replace(":", ""))
        h = mac_hash(mac)
        match = [ct for hh, ct in entries if hh == h]
        if not match:
            sys.exit(f"MAC {mac_s} does not match any stored hash")
        tables.append(key_table_decrypt(mac, match[0]))
        print(f"[mac] {mac_s} -> hash {h:016x}")
    table = bytes(Counter(col).most_common(1)[0][0] for col in zip(*tables)).lower()
    print(f"[key-table] {table.decode()}")
    sections = [
        ("base domain / query prefix", 0x1800190E8, 0x180019103),
        ("DGA alphabet + suffixes", 0x180019CF0, 0x180019D44),
    ]
    for name, a, b in sections:
        print(f"\n# {name}")
        for pos, s in walk(data, pe.off(a), pe.off(b), table):
            print(f"  {s}")
    sc_off = pe.off(0x180019D90)
    stage1 = decode(data[sc_off:sc_off + 677], data[sc_off + 677], table)
    print(f"\n# decrypted stage-1 shellcode: 677 bytes, sha256 {hashlib.sha256(stage1).hexdigest()}")
    print("\n# shellcode argument")
    for pos, s in walk(data, pe.off(0x18001A040), pe.off(0x18001A040) + 1, table):
        print(f"  {s}")
    return stage1


def sample_b(data):
    pe = PE(data)
    table = SAMPLE_B_TABLE
    print(f"[key-table] {table.decode()}")
    print("\n# DGA suffixes + static fallback domain")
    found = walk(data, pe.off(0x14003A470), pe.off(0x14003A500), table)
    for pos, s in found:
        print(f"  {s}")
    if [s for _, s in found][:3] != ["top", "link", "cyou"]:
        sys.exit("key table check failed")
    for pos, s in walk(data, pe.off(0x14003A4F1), pe.off(0x14003A4F2), table):
        print(f"  {s}    <- static fallback list")
    sc_off = pe.off(0x14003A510)
    stage1 = decode(data[sc_off:sc_off + 677], data[sc_off + 677], table)
    print(f"\n# decrypted stage-1 shellcode: 677 bytes, sha256 {hashlib.sha256(stage1).hexdigest()}")
    return stage1


def main():
    ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
    ap.add_argument("sample")
    ap.add_argument("-o", "--dump-stage", help="write the decrypted 677-byte stage to this path")
    args = ap.parse_args()
    data = open(args.sample, "rb").read()
    digest = hashlib.sha256(data).hexdigest()
    if digest == SAMPLE_A_SHA256:
        stage1 = sample_a(data)
    elif digest == SAMPLE_B_SHA256:
        stage1 = sample_b(data)
    else:
        sys.exit(f"unknown sample {digest}")
    if args.dump_stage:
        open(args.dump_stage, "wb").write(stage1)


if __name__ == "__main__":
    main()

A few strings, among them the a–z alphabet, are not encrypted with the above methods and instead produced by inline decoders over a separate byte pool.

Among the decrypted data is also a short 677 byte long shellcode. It is the same in both samples and analysed next.

Shellcode

Both builds carry the same encrypted 677-byte blob, which the script from the previous section dumps to the path provided with -o / --dump-stage. Both sample produce the exact same shellcode. It is a Metasploit-style x64 reverse_https stager. It carries a fixed 105-character URI and a 30-byte host placeholder that each build overwrites:

  • sample A: v4nxc59kld6o7w.okkgb[.]com
  • sample B: dc11zvipfgmslt.okkgb[.]com

The stager is not where the DGA domains come from, and it is not part of the main logic:

  • In sample A the call is guarded by a check that compares the difference of two recursively computed Fibonacci numbers against a constant that is off by one. The guard is never true and burns CPU time.
  • In sample B it is reachable only from an obfuscation trap function.

I think the shellcode might be a decoy aimed at analysts who stop at the first unpacked sample or network IOC.

Source of the Domains

With the strings decrypted, the real implant shows itself. It is a DNS-tunnelling beacon with channel IDs, a keep-alive interval, a payload store, a self-kill command and log messages such as “Pending payload exec queue is full”. None of these strings, nor the marker B3AC0N, returned any public hits for other malware reports.

Every C2 message travels as a DNS CNAME query sent directly to an internal resolver. The name is assembled from three parts:

  1. A per-message encoded label.
  2. A fixed per-build label: z58j5w3k00 in sample A, d7kyjzb in sample B.
  3. A candidate domain.

The resolver comes from the RESOLVER environment variable if set. Otherwise the implant uses a built-in list of 92 addresses in 10.0.0.0/8. The options passed to DnsQuery bypass the local cache, the hosts file, NetBIOS and multicast. Sample B can also tunnel the same queries over DNS-over-HTTPS if a resolver entry starts with http.

The candidate domains come from three places.

  1. Hardcoded domains: Sample A always starts with 89e[.]org. Sample B has a static list containing parker-inc[.]com.
  2. A Saturday-only a–z DGA: Both samples check tm_wday == 6. On a Saturday, sample A appends ten generated names to its list and sample B switches to a state that generates eighteen. These are the DGA domains from the introduction.
  3. A daily token-alphabet DGA (sample B only): The first candidate source in sample B’s main loop runs the same generator every day, with a 36-character shuffled [a-z0-9] alphabet. It is active on every day of the week, not just on Saturday

The following snippet shows how sample A generates the domains the beacon will try. It first decrypts the hardcoded base domain 89e.org using GeodeticPointDistance (name come from the DLL’s export table and is a decoy). It then checks the local time, and only on a Saturday (tm_wday == 6) does it call the DGA with seed 0, which means the seed comes from the date. In that case it appends a : separator and the ten generated names to the list. The result is a single colon-separated string: just 89e.org on most days, and 89e.org plus the week’s ten DGA domains on Saturdays.

char *build_next_query_domain()
{
  void *stack_pad; // rsp
  unsigned __int8 *base_domain; // r15
  unsigned __int8 *list_sep; // r14
  unsigned __int8 *query_label; // rdi
  unsigned __int8 *dot; // rbx
  char *candidate_list; // rsi
  const char **dga_name; // r15
  const char *name; // r12
  const char *candidate_ptr; // rax
  const char *candidate; // r14
  size_t candidate_len; // rcx
  char *query_name; // r15
  unsigned int opaque_tmp; // ebx
  unsigned __int8 base_domain_buf[13]; // [rsp+0h] [rbp-20h] BYREF
  unsigned __int8 query_label_buf[11]; // [rsp+Dh] [rbp-13h] BYREF
  __time64_t now; // [rsp+18h] [rbp-8h] BYREF
  unsigned __int8 list_sep_buf[2]; // [rsp+24h] [rbp+4h] BYREF
  unsigned __int8 dot_buf[58]; // [rsp+26h] [rbp+6h] BYREF

  stack_pad = alloca((8LL * ((opaque_k0 ^ 0x58692A40u) + 1416599395) + 15) & 0xFFFFFFFF0LL);
  base_domain = GeodeticPointDistance(enc: &enc_base_domain, key_byte: &key_base_domain, len: 8u, out: base_domain_buf);
  list_sep = GeodeticPointDistance(enc: &enc_list_sep, key_byte: &key_list_sep, len: 2u, out: list_sep_buf);
  query_label = GeodeticPointDistance(
                  enc: &enc_query_label,
                  key_byte: &key_query_label,
                  len: 0xBu,
                  out: query_label_buf);
  dot = GeodeticPointDistance(enc: &enc_dot, key_byte: &key_dot, len: 2u, out: dot_buf);
  candidate_list = alloc_buffer(Size: 0x1000u);
  thunk_strcpy(Destination: candidate_list, Source: base_domain);
  now = time64(Time: nullptr);
  if ( localtime64(Time: &now)->tm_wday == 6 )
  {
    for ( dga_name = dga_generate(seed: 0); *dga_name != nullptr; ++dga_name )
    {
      strcat(Destination: candidate_list, Source: list_sep);
      name = *dga_name;
      if ( (opaque_k3 ^ 0xE9DC1B6A) < 2 )
        strcat(Destination: candidate_list, Source: *dga_name);
      strcat(Destination: candidate_list, Source: name);
    }
  }
  candidate_ptr = get_nth_candidate(list: candidate_list, index: &g_candidate_index);
  if ( candidate_ptr != nullptr )
  {
    candidate = candidate_ptr;
    ++g_candidate_index;
    candidate_len = thunk_strlen(Str: candidate_ptr);
    if ( -554917538
       * (((0xC524CB / (opaque_k5 ^ 0x28D5DCD8u) + 1346016950) / (opaque_k6 ^ 0xB529C5E6) + 924194091)
        | opaque_k7 ^ 0x2600C044
        | 0xD9E11F8A) <= 0x15D85503 )
    {
      while ( 1 )
        ;
    }
    query_name = alloc_buffer(Size: ((candidate_len << 32) + (opaque_k1 & 0x7ECAF6D4F16D8367LL ^ 0x7E0832C860400321LL)) >> (opaque_k2 ^ 0xCFu));
    thunk_strcpy(Destination: query_name, Source: query_label);
    strcat(Destination: query_name, Source: dot);
    strcat(Destination: query_name, Source: candidate);
  }
  else
  {
    if ( -1157083943 * ((opaque_k4 ^ 0x686BCCB0uLL) / 0x2CC3164D) == -17516665 )
    {
      while ( 1 )
        ;
    }
    g_candidate_index = 0;
    query_name = nullptr;
  }
  do
  {
    opaque_tmp = (opaque_k8 ^ 0x4D1CDECC) + 369246734;
    free_buffer(a1: candidate_list);
  }
  while ( opaque_tmp < 0xF7412FB );
  return query_name;
}

The generator itself is the same in both builds, apart from sample B’s alphabet and suffix count.

  1. Seed. A 32-bit seed is fed to a xorshift32 PRNG with the classic shifts 13, 17 and 5.
  2. Length. One step gives the label length, 6 + x mod 7, so labels are 6 to 12 characters long.
  3. Characters. Each further step picks one character, alphabet[x mod len].
  4. Suffixes. The single label is then combined with every top level domain:
    • sample A (10 TLDs): lol lat top link cyou in sbs work casa com
    • sample B (18 TLDs): top link cyou pro me my buzz info space in sbs work casa lol lat net org com

Seeding is where the builds differ most:

  • Sample A passes 0 to the generator, which then uses (year << 16) | (day_of_year // 7), with day_of_year counted from zero. The domain set therefore changes every seven days counted from 1 January.

  • Sample B computes its seed as the sum of three deliberately failing API calls minus 252:

    • GetEnvironmentVariableA on a variable that does not exist.
    • GetLastError after LoadLibraryA on a non-existent DLL.
    • GetLastError after GetProcAddress on a bogus module handle.

    On Windows 11 these yield 0, 126 and 126, which totals to 252 so the seed is 0. A 0-seed selects a date fallback which, after another layer of failing-API “constants” is folded away, is exactly the formula of sample A.

That explains the domains from Solar’s report:

  • None of the domains uses a date seed. An exhaustive search over all 2^32 seeds found exactly one seed per label under the a–z alphabet: 1 for vfvnfaq and 0xDA0D6B27 for vpnosljjk. No date between 1970 and 2100 produces either label, and the token alphabet produces neither at any seed.
  • They come from sample B. Eight of the observed TLDs (pro, me, my, buzz, info, space, net and org) exist only in sample B. The eighteen vfvnfaq names appear in sample B’s table order. So the observed traffic came from sample B’s Saturday branch.

So why was the seed 1 and not 0 as expected for the failing API calls? Or in other words why was the probe sum 253 instead of 252. The simplest explanation is an emulated or sandboxed API layer that reports error 127 (procedure not found) rather than 126 for the bogus GetProcAddress call. Similarly it could be that GetEnvironmentVariableA returned 1 instead of 0, for example an emulator’s default “success” value or if the env variable was indeed set on the victims machine. If that is right, such an environment would emit vfvnfaq.* on every Saturday, forever.

And what about seed 0xDA0D6B27? As shown later it is behind only of of the domains, but I have no idea how it came to be. Solar’s original research lists 12 samples and I was able to get only 2 of them from VirusTotal. Given that the two samples I have already differ quite a bit, it is possible that one of the other samples contains the seed.

Python Reimplementation

The script below reimplements all three generator variants. -v selects the variant:

  • sample-a-az: sample A’s Saturday branch.
  • sample-b-az: sample B’s Saturday a–z branch.
  • sample-b-token (default): sample B’s first candidate source, the daily token alphabet.

-s 0 (the default, and the value both samples use on a normal host) derives the seed from the date given with -d. The Saturday variants print nothing on other days, exactly as the samples generate nothing on those days.

#!/usr/bin/env python3
"""Reimplementation of the PartisanDNS DGA 


Versions (-v):
  sample-b-token  sample B, first candidate source in the main loop: 36-character
            token alphabet, 18 suffixes, every day                 (default)
  sample-b-az     sample B, Saturday-only source: a-z alphabet, 18 suffixes
  sample-a-az     sample A, Saturday-only source: a-z alphabet, 10 suffixes
"""
import argparse
from datetime import date

MASK = 0xFFFFFFFF

AZ = "abcdefghijklmnopqrstuvwxyz"
TOKEN = "gnbz1tof0s9vyciae78rw3hd4pm2luxqk6j5"
TLDS_0B = ("top", "link", "cyou", "pro", "me", "my", "buzz", "info", "space",
           "in", "sbs", "work", "casa", "lol", "lat", "net", "org", "com")
TLDS_0 = ("lol", "lat", "top", "link", "cyou", "in", "sbs", "work", "casa", "com")

VERSIONS = {
    #  name       alphabet suffixes  saturday-only
    "sample-a-az":     (AZ,    TLDS_0,  True),
    "sample-b-az":    (AZ,    TLDS_0B, True),
    "sample-b-token": (TOKEN, TLDS_0B, False),
}
DEFAULT_VERSION = "sample-b-token"
DEFAULT_SEED = 0


def step(x):
    x ^= (x << 13) & MASK
    x ^= x >> 17
    x ^= (x << 5) & MASK
    return x


def date_seed(d):
    yday = d.timetuple().tm_yday - 1
    return ((d.year << 16) | (yday // 7)) & MASK


def label(seed, alphabet):
    state = seed
    length = 6 + step(state) % 7
    out = []
    for _ in range(length):
        state = step(state)
        out.append(alphabet[state % len(alphabet)])
    return "".join(out)


def generate(d, seed, version):
    alphabet, tlds, saturday_only = VERSIONS[version]
    if saturday_only and d.weekday() != 5:
        return []
    sld = label(seed or date_seed(d), alphabet)
    return [f"{sld}.{tld}" for tld in tlds]


def main():
    ap = argparse.ArgumentParser(description=__doc__,
                                 formatter_class=argparse.RawDescriptionHelpFormatter)
    ap.add_argument("-d", "--date", type=date.fromisoformat, default=date.today(),
                    help="date as YYYY-MM-DD (default: today)")
    ap.add_argument("-s", "--seed", type=lambda v: int(v, 0) & MASK, default=DEFAULT_SEED,
                    help="32-bit seed, decimal or 0x-hex (default: 0 = derive from date)")
    ap.add_argument("-v", "--version", choices=VERSIONS, default=DEFAULT_VERSION,
                    help=f"generator variant (default: {DEFAULT_VERSION})")
    args = ap.parse_args()
    for domain in generate(args.date, args.seed, args.version):
        print(domain)


if __name__ == "__main__":
    main()

Example:

$ python3 dga.py -v sample-b-az -d 2026-12-05
kigucfh.top
kigucfh.link
...
kigucfh.com

Every one of the domains for Solar’s report can be reproduced with the DGA script from this post. The sample-b-az variant is the Saturday-only a–z generator of sample B. It only runs on Saturdays, so any Saturday works as the date; 2026-12-05 is used below. The # column is the line of the script’s output that holds the domain.

DomainCommand#
vpnosljjk[.]propython3 dga.py -v sample-b-az -d 2026-12-05 -s 0xDA0D6B274
vfvnfaq[.]toppython3 dga.py -v sample-b-az -d 2026-12-05 -s 11
vfvnfaq[.]linksame as above2
vfvnfaq[.]cyousame as above3
vfvnfaq[.]prosame as above4
vfvnfaq[.]mesame as above5
vfvnfaq[.]mysame as above6
vfvnfaq[.]buzzsame as above7
vfvnfaq[.]infosame as above8
vfvnfaq[.]spacesame as above9
vfvnfaq[.]insame as above10
vfvnfaq[.]sbssame as above11
vfvnfaq[.]worksame as above12
vfvnfaq[.]casasame as above13
vfvnfaq[.]lolsame as above14
vfvnfaq[.]latsame as above15
vfvnfaq[.]netsame as above16
vfvnfaq[.]orgsame as above17
vfvnfaq[.]comsame as above18

Neither seed comes from the date. Under normal conditions the seed is derived from the calendar week, and the two seeds above are what the generator must have received to print these exact names.

Characteristics

PropertyValue
TypeTime-dependent, deterministic (weekly)
SeedingDate (year and week-of-year); sample B also has an environment-derived seed that is 0 (so date) on a normal Windows 11 host
Generation schemexorshift32 (13, 17, 5) PRNG; one label per period, combined with every suffix
Seed(year << 16) | (day_of_year // 7), day_of_year zero-based; observed run-time seeds 1 and 0xDA0D6B27
Domain change frequencyEvery 7 days counted from 1 January (the last “week” of a year is 1–2 days)
Unique domainssample A: 10 per week; sample B: 18 per week per alphabet (36 with both branches)
SequenceSuffix order is fixed; candidates are tried after the hardcoded domain(s), round-robin across tokens and resolvers
Wait timeNot determined statically; failed queries are retried with backoff, up to five attempts
Top-level domainssample A: lol, lat, top, link, cyou, in, sbs, work, casa, com; sample B: top, link, cyou, pro, me, my, buzz, info, space, in, sbs, work, casa, lol, lat, net, org, com
Second-level charactersa–z (Saturday branches); [a-z0-9] via the shuffled alphabet gnbz1tof0s9vyciae78rw3hd4pm2luxqk6j5 (sample B daily branch)
Regex^[a-z]{6,12}\.(top|link|cyou|pro|me|my|buzz|info|space|in|sbs|work|casa|lol|lat|net|org|com)$ (a–z); ^[a-z0-9]{6,12}\.(…same…)$ (token)
Second-level domain length6–12 characters

Closing

This sample is a nice example of a DGA hidden behind an environment-keyed string cipher. In sample A the domains, the resolvers and even the alphabet are unreadable unless the ARP cache contains one of nine specific MACs. The DGA itself is minimal: xorshift32 plus a week number. Sample B wraps the same algorithm in obfuscation and “constants” derived from failing API calls. That makes the observed domains telling: they look like the output of an environment where one of those error codes came back slightly differently. The open questions are the origin of 0xDA0D6B27. If you have seen B3AC0N or the z58j5w3k00/d7kyjzb labels elsewhere, I would like to hear about it.

IOCs

Files

FileSHA256
sample A4f0e23a83d83d901c76353d8b9b6ee2940eb63d531ad15f736193903b5c7c8c3
sample Be55431d6f15aa78ada3f60ed30a3f32b444b952bdc53a652546c1820f8bfa513
decrypted stager39f0ae394c0301518b4ce20a23adc706f70d1bbb5fa0c2a5e9a76e588538cba8

Network

  • Observed DGA domains:
    • vpnosljjk[.]pro
    • vfvnfaq[.]top, vfvnfaq[.]link, vfvnfaq[.]cyou, vfvnfaq[.]pro, vfvnfaq[.]me, vfvnfaq[.]my, vfvnfaq[.]buzz, vfvnfaq[.]info, vfvnfaq[.]space, vfvnfaq[.]in, vfvnfaq[.]sbs, vfvnfaq[.]work, vfvnfaq[.]casa, vfvnfaq[.]lol, vfvnfaq[.]lat, vfvnfaq[.]net, vfvnfaq[.]org, vfvnfaq[.]com
  • Hardcoded domains: 89e[.]org (sample A), parker-inc[.]com (sample B)
  • Query labels: z58j5w3k00. and d7kyjzb. prefixed to every candidate
  • Decoy stager hosts: v4nxc59kld6o7w.okkgb[.]com, dc11zvipfgmslt.okkgb[.]com (HTTPS, port 443)
  • Decoy stager URI:: /8eoa5k3Ye7ioDKkOzy94pwkFWKvNmHQenWsspfYgJLExrr6G6VXYMOOqnHZa9KR6_sizglL9Q_UE25JtQHUSN15rhOy0RcORHQJrv4j0

Host

  • Environment variable RESOLVER
  • Export fetchRecentComments
  • Strings B3AC0N, NONEXISTENT_VAR_35186, NonExistentLibrary35186.dll, InvalidFunction35186, InvalidClassName35186

References

  1. MITRE ATT&CK, T1568.002 Dynamic Resolution: Domain Generation Algorithms
  2. MITRE ATT&CK, T1016 System Network Configuration Discovery (ARP-table enumeration)
  3. Huntress, “Hackers No Hashing: Randomizing API Hashes to Evade Cobalt Strike Shellcode Detection” (block_api hash values)
  4. NVISO, “Anatomy and Disruption of Metasploit Shellcode”
  5. “Use of Cryptography in Malware Obfuscation” (environmental keying), arXiv:2212.04008
  6. Marsaglia, G. “Xorshift RNGs”, Journal of Statistical Software 8(14), 2003
  7. MITRE ATT&CK, T1071.004 Application Layer Protocol: DNS
  8. Solar, Partisan Zmiy: снова на радаре

About this post

Table of Contents
Advent of DGAs

This blog post is part of the Advent of DGAs series where I publish one post daily about a sample that looks like it uses a Domain Generation Algorithm.

I don't expect any sample to be relevant anymore and spend very little time on each sample, so don't expect the quality to be amazing.

Of course I'm also using AI to assist with the analysis and unpacking of the malware samples.

Disclaimer

These are just unpolished notes. The content likely lacks clarity and structure; and the results might not be adequately verified and/or incomplete.

Malpedia

For more information about the malware in this blog post see the Malpedia entry on Cyber Partisans (alias Partisan Zmiy).

Related Posts This is one of four blog posts on "Advent of DGAs". Check out the other parts here: