Astaroth (Guildma) Uses Steganography and Ngrok for C2 Resilience
| 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:
- 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.
- 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.
- 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 |
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
