Astaroth (Guildma) Uses Steganography and Ngrok for C2 Resilience

Umut Bayram | 8 MIN READ

| July 28, 2026

Key Takeaways

  • Astaroth, also called Guildma, is a Delphi Windows banking trojan from 2018, with over 90 percent of infections in Brazil.
  • Delivery arrives through phishing emails spoofing DocuSign or government documents, and WhatsApp View Once messages carrying malicious archives.
  • Before acting, it checks locale, drive serial numbers, and analysis tools, forcing a system shutdown when a sandbox is detected.
  • Stolen data travels over TCP through Ngrok tunnels, hiding the operator's true server address from victim network traffic.
  • Every two hours it pulls fresh configuration hidden inside steganographic images, recovering resilience after command-and-control takedowns.
  • The Picus Platform lets teams simulate Astaroth attacks and validate whether their security controls detect and prevent them.

Astaroth (aka Guildma) is a Windows banking trojan first observed in 2018. Written in Delphi, it targets banking and cryptocurrency portals in Brazil and across Latin America through runtime keylogging and delivers its payload via a multi-stage loader chain that touches AutoIt, in-memory DLL injection, and process hollowing before the final payload ever touches disk.

What separates Astaroth from older credential stealers is its infrastructure resilience model. When primary command-and-control (C2) endpoints become unreachable, the malware fetches updated configuration from steganographically encoded image files hosted on legitimate platforms, making takedown harder.

In this blog, we explain how Astaroth operates across every stage of its execution flow, from the initial phishing lure through process injection and credential exfiltration, and show you how Picus helps validate your security controls against this malware.

What Is Astaroth Malware?

Astaroth is a Windows credential-stealing banking trojan, also known as Guildma, written in Delphi, that first emerged in 2018 and has since evolved significantly in both delivery method and evasion sophistication.

Over 90% of recorded infections are in Brazil, with the remainder spread across other Latin American countries and select European targets.

At its core, Astaroth does three things:

  1. Monitors browser activity: It polls active foreground windows once per second, checking for window class names associated with web browsers and matching the page title or URL against a target list of banking and cryptocurrency portals.
  2. Captures keystrokes: When a matched banking session is detected in the foreground, Astaroth installs a system-wide keyboard hook to silently record all keystrokes typed into that session.
  3. Exfiltrates stolen data: Captured credentials and session data are transmitted to C2 infrastructure routed through Ngrok reverse-proxy tunnels using a custom binary protocol.

How Does Astaroth Malware Work?

Astaroth follows a multi-stage execution flow, from initial phishing delivery through in-memory loading and credential theft.

Below, we will break down each stage in detail.

Stage 1: Initial Access

Astaroth reaches victims through two delivery channels:

  • Email-based: Phishing emails spoofing DocuSign, government agencies, or HR documents deliver a geo-restricted ZIP archive containing a malicious LNK file [1][2].
  • WhatsApp-based: The STAC3150 campaign, first observed in September 2025, distributes ZIP archives with malicious VBS or HTA files via WhatsApp "View Once" messages [3].

Stage 2: Anti-Analysis and Sandbox Evasion

Depending on the delivery campaign, Astaroth arrives via an AutoIt-based loader chain or an MSI installer, but once injected into RegSvcs.exe the binary itself applies several layers of analysis resistance before performing any malicious activity.

String Encryption

Nearly 1,000 internal strings are encoded using a custom three-layer algorithm [2]. Here is the illustration of the algorithm:

# Astaroth string obfuscation key, hardcoded in the binary
OBFUSCATION_KEY = b"XYQMDOW8"

def layer1(encoded_hex):
# XOR each byte against the rolling key, then apply CBC-style delta against the previous byte
raw = bytes.fromhex(encoded_hex)
out = b""
prev = raw[0]
for i in range(1, len(raw)):
curr = raw[i]
xored = curr ^ OBFUSCATION_KEY[(i - 1) % len(OBFUSCATION_KEY)]
delta = xored - prev if xored > prev else xored + 255 - prev
out += bytes([delta & 0xff])
prev = curr
return out

def layer2(data):
# Reverse byte order, then invert each byte relative to 0x0a
return bytes(~(b - 0xa) & 0xff for b in reversed(data))

def layer3(data):
# Leading byte encodes the session key; remaining bytes decoded in pairs
session_key = data[0] - 0x41
out = b""
for i in range(1, len(data), 2):
val = data[i + 1] - 0x41 + (data[i] - 0x41) * 25 - session_key - 0x64
out += bytes([val & 0xff])
return out

def decode_string(encoded_hex):
return layer3(layer2(layer1(encoded_hex)))

# Decodes to b"ASTAROTH"
print(decode_string("70706B616F64696710960194189915847E6B"))

Process and Tool Enumeration

Astaroth enumerates all running processes using a dedicated anti-sandbox function and compares process names against a hardcoded blocklist:

// Decrypt each tool name at runtime, then check running processes

mov eax, offset a8c0b92179a25aa ; encrypted string → "x32dbg.exe"

call decrypt_string

mov edx, [ebp+var_18]

call check_processes // returns non-zero if process is found

setnz [ebp+var_1]


// Next tool in the list...

mov eax, offset a9010896b616767 ; encrypted string → "Wireshark"

call decrypt_string

call check_processes

The blocklist covers debugging tools, analysis utilities, virtualization indicators, and monitoring agents [1][2]. Here are the most notable entries:

Debuggers: 32dbg.exe, OllyDBG, IDA Pro, WinDbg

Network analysis: Wireshark, Dumpcap

Process monitoring: Process Monitor, Process Explorer

Hypervisor indicators: QEMU-GA, VBox

ServiceSandbox / SIEM: SbieSvc, splunkd.exe

Volume Serial Number Fingerprinting

Astaroth calls GetVolumeInformationW to retrieve the hard drive's volume serial number and compares the result against a set of known sandbox serial numbers:

// Programmatic volume serial number retrieval

GetVolumeInformationW(

lpRootPathName, // drive root, typically L"C:\\"

lpVolumeNameBuffer,

nVolumeNameSize,

lpVolumeSerialNumber, // <-- value under inspection

lpMaximumComponentLength,

lpFileSystemFlags,

lpFileSystemNameBuffer,

nFileSystemNameSize

);

Locale-Based Sandbox Detection

If the system locale resolves to English (United States), Astaroth treats the environment as a sandbox and halts execution.

The check decrypts the strings "united" and "states" (and separately "english") at runtime and compares them against the locale reported by GetLocaleInfo [1][2]:

lea eax, [ebp+var_38]

mov eax, offset asc_68538C ; encrypted → "united"

call decrypt_string

call lib_string // locale comparison

jnz short loc_684FC3


lea edx, [ebp+var_3C]

mov eax, offset a21bf26b03c4649 ; encrypted → "states"

call decrypt_string

call lib_string


lea edx, [ebp+var_40]

mov eax, offset a647a624448414d ; encrypted → "english"

call decrypt_string

Automated Shutdown on Detection

When any sandbox or analysis condition triggers, Astaroth does not simply exit. It forces a full system shutdown to destroy volatile forensic evidence:

call check_environment // aggregate sandbox and debugger check results

...

call antisandbox // returns 1 if analysis environment detected

cmp al, 1

jnz short continue_exec // clean environment, proceed with normal execution

...

call shutdown // forces immediate system shutdown to destroy forensic evi

Stage 3: Credential Theft via Keylogging

Once execution is established inside RegSvcs.exe, Astaroth enters a monitoring loop that polls active foreground windows. It inspects the window class name of the active process once per second and activates keylogging when a browser window with a banking or cryptocurrency portal is detected.

Browser window class names monitored [1]:

chrome -- Google Chrome

ieframe -- Internet Explorer / legacy Edge

mozilla -- Firefox-based browsers

xoff -- additional browser variant

xdesk -- additional browser variant

xtrava -- additional browser variant

sunawtframe -- Java-based browser container

When a matching window is active, Astaroth installs a system-wide low-level keyboard hook using SetWindowsHookExW with hook type WH_KEYBOARD_LL [1]:

...

user32_handle = GetModuleHandleW(L"USER32.DLL");

g_kb_hook = SetWindowsHookExW(

0xd, // WH_KEYBOARD_LL -- low-level keyboard hook

hook_listener, // callback that receives every keystroke

user32_handle, // handle to USER32.DLL

0 // 0 = global hook, applies across all threads

);

The operator's target list is actively maintained. New portal domains are added with each campaign refresh, with Brazilian financial institutions added at a higher rate than any other geography.

Stage 4: Command-and-Control Communication and Configuration

Stolen keystrokes and session data are transmitted to a C2 endpoint using a custom binary protocol over TCP.

The malware routes this traffic through Ngrok reverse-proxy tunnels, which expose private TCP listeners through publicly accessible Ngrok subdomains. This approach means the attacker's true server IP is never exposed in network traffic observed from the victim.

Astaroth's runtime configuration is stored encrypted in dump.log, co-located with the main payload in the installation directory. The file uses Base64 encoding as its outer layer, with a custom encryption algorithm underneath. The decrypted configuration layout [1]:

# dump.log -- decrypted structure


dt ----------------> config version


ips ----------------> active C2 server list (pipe-delimited)

5.tcp.ngrok[.]io:<port number>...

…

out ----------------> config update URLs (steganographic image sources)

<shortened links>

Every two hours, Astaroth fetches a fresh configuration to recover from C2 takedowns. It resolves one of the URLs in the out field, which typically chains through a URL shortener to a raw image file hosted on GitHub or a public image platform [1]:

The image file is a valid JPEG or PNG that renders normally. Astaroth identifies and extracts a configuration payload appended after the image's end-of-file marker.

How Picus Simulates Astaroth Malware Attacks?

We strongly suggest simulating Astaroth Malware Attacks to test the effectiveness of your security controls against real-life cyber attacks using the Picus Platform. You can also test your defenses against hundreds of other malware variants, such as BRICKSTORM, VenomRAT, Chinotto, and Rustonotto, within minutes with a 14-day free trial of the Picus Platform.

Picus Threat Library includes the following threats for the Astaroth Malware Attacks:

Threat ID

Threat Name

Attack Module

47343

Astaroth Loader Download Threat

Network Infiltration

71916

Astaroth Malware Downloader Download Threat

Network Infiltration

62609

Astaroth Banking Malware Download Threat

Network Infiltration

47248

Astaroth Loader Email Threat

E-mail Infiltration

43468

Astaroth Banking Malware Email Threat

E-mail Infiltration

46206

Astaroth Malware Downloader Email Threat

E-mail Infiltration

Start simulating emerging threats today and get actionable mitigation insights with a 14-day free trial of the Picus Platform.

References

[1] M. Labs, “Astaroth: Banking Trojan Abusing GitHub for Resilience,” McAfee Blog. Accessed: Jul. 17, 2026. [Online]. Available: https://www.mcafee.com/blogs/other-blogs/mcafee-labs/astaroth-banking-trojan-abusing-github-for-resilience/

[2] J. Gegeny and P. Thevendaran, “Astaroth unleashed,” Acronis. Accessed: Jul. 17, 2026. [Online]. Available: https://www.acronis.com/en/tru/posts/astaroth-unleashed/

[3] C. Cowie, “WhatsApp compromise leads to Astaroth deployment,” Sophos. Accessed: Jul. 17, 2026. [Online]. Available: https://www.sophos.com/en-us/blog/whatsapp-compromise-leads-to-astaroth-deployment

 
Astaroth, also known as Guildma, is a Windows credential-stealing banking trojan written in Delphi that first emerged in 2018. It targets banking and cryptocurrency portals in Brazil and across Latin America using runtime keylogging. It has evolved significantly in both delivery method and evasion sophistication, with over 90 percent of recorded infections occurring in Brazil.
Astaroth reaches victims through two delivery channels. Email-based campaigns use phishing messages spoofing DocuSign, government agencies, or HR documents to deliver a geo-restricted ZIP archive containing a malicious LNK file. The WhatsApp-based STAC3150 campaign, first observed in September 2025, distributes ZIP archives with malicious VBS or HTA files sent through WhatsApp View Once messages.
Astaroth applies several evasion layers once injected into RegSvcs.exe. It encrypts nearly 1,000 internal strings, enumerates running processes against a blocklist of debuggers and analysis tools, fingerprints the drive volume serial number, and checks the system locale. If the environment resolves to English United States or matches a sandbox indicator, Astaroth forces a full system shutdown to destroy forensic evidence.
Once running inside RegSvcs.exe, Astaroth polls active foreground windows once per second, checking window class names for browsers and matching page titles against a target list of banking and cryptocurrency portals. When a match is detected, it installs a system-wide low-level keyboard hook using SetWindowsHookExW with WH_KEYBOARD_LL to silently record every keystroke typed into that session.
Stolen keystrokes and session data are transmitted using a custom binary protocol over TCP. Astaroth routes this traffic through Ngrok reverse-proxy tunnels, which expose private listeners through public subdomains and hide the attacker's true server IP. Every two hours it fetches fresh configuration from steganographic images hosted on legitimate platforms, extracting a payload appended after the image end-of-file marker.
The Picus Platform lets security teams simulate Astaroth attacks to validate the effectiveness of their security controls against real-life threats. The Picus Threat Library includes multiple Astaroth threats covering network and email infiltration modules.

Table of Contents

Ready to start? Request a demo