Hidden Infrastructure Exposed: ANY.RUN Reveals Hijacked Gov Websites Delivering Malware
PhantomEnigma is an active Brazil-focused crimeware campaign that compromises government infrastructure (.gov.br portals and police mailboxes) to deliver a modular Node.js backdoor embedded in patched Boostnote/Electron applications via Delphi-compiled Inno Setup installers. The operation uses at least two beacon generations (GET /laravel.php and POST /nbw/), rotates C2 domains weekly behind Cloudflare, and leverages trusted government email channels to bypass SPF/DKIM/DMARC checks. ANY.RUN analysts linked 231 sandbox analyses through a recurring build-chain fingerprint and connected a separate Ofício-PC QR-code phishing arm to the same operator via shared compromised government hosts.
Authors: ShiFu
Source:ANY.RUN
Detection / HunterZ.ai
What Happened
A cybercriminal campaign called PhantomEnigma has been hacking into Brazilian government websites and police email accounts to spread malware disguised as official police documents. The attackers target banks and public-sector organizations in Brazil, sending emails that look like they come from real police departments because the email accounts were genuinely compromised. The malware hides inside a modified version of a legitimate note-taking app and can steal information, run commands, and download more malicious software. The attackers change their server addresses frequently, making it hard to block them with simple blocklists. Security teams should watch for the specific patterns this malware uses to communicate, carefully investigate files that come from trusted government sources even if they appear clean, and use behavioral analysis rather than relying only on reputation-based security tools.
Key Takeaways
- PhantomEnigma abuses at least 20 compromised Brazilian .gov.br portals and police mailboxes to deliver malware, allowing phishing emails to pass SPF, DKIM, and DMARC authentication checks.
- A previously undocumented second beacon generation sends POST requests to /nbw/ with JSON bodies containing machine ID, computer name, username, and campaign tag—distinct from the earlier GET-based /laravel.php beacon.
- The campaign's most durable fingerprint is its build chain: a Delphi-compiled Inno Setup installer embedding a patched Boostnote/Electron application with an obfuscated index.js backdoor, identified across 231 sandbox analyses.
- The Ofício-PC QR-code phishing/ClickFix arm is linked to the same operator via shared compromised government infrastructure, with at least four .gov.br/.jus.br hosts used by both delivery arms.
- Nearly one-third of analyzed samples initially received clean verdicts, highlighting the need for behavioral analysis and build-chain correlation over static reputation-based detection.
Affected Systems
- Windows endpoints (Inno Setup installer execution, Electron runtime, PowerShell, registry persistence)
- Brazilian banking organizations (including Banco do Brasil)
- Brazilian public-sector organizations and government portals (.gov.br, .jus.br)
- Email infrastructure with SPF/DKIM/DMARC authentication (compromised mailboxes)
Attack Chain
- Initial Access: Victim receives spoofed Polícia Civil or 'Procuração Digital' notary email from compromised .gov.br mailbox that passes SPF/DKIM/DMARC, containing link to compromised government host or police-themed typosquat domain
- Execution: Host serves Delphi-compiled Inno Setup installer (e.g., Procuracao_Digital.exe) which silently unpacks a patched Electron/Boostnote application containing malicious index.js
- Persistence: Backdoor creates eight-character machine ID in %APPDATA%, sets HKCU Run key, and uses setLoginItemSettings for boot-time persistence
- Discovery: Backdoor collects COMPUTERNAME, USERNAME, and system information via child_process and sends to C2 endpoint
- C2: Backdoor beacons to /laravel.php (GET, Gen A) or /nbw/ (POST JSON, Gen B) every 180 seconds with victim system information and campaign tag
- Second-stage Delivery: C2 returns JavaScript for in-process eval() execution or sends executable to be dropped and launched as child process (stealer, loader, or remote management tool)
Detection Availability
- YARA Rules: Yes
- Sigma Rules: No
- Snort/Suricata Rules: Yes
- KQL Queries: No
- Splunk SPL Queries: No
- EQL Queries: No
- Other Detection Logic: Yes
- Platforms: ANY.RUN YARA detections, ANY.RUN TI Lookup queries, Suricata signatures (described)
The article describes YARA rules targeting the index.js backdoor (combining JSON.stringify beacon structure, COMPUTERNAME/USERNAME collection, String.fromCharCode decoding, and setLoginItemSettings persistence) and Suricata signatures for /laravel.php and /nbw/ beacon patterns. ANY.RUN TI Lookup queries for build-chain tags (nodejs AND inno*) and .gov.br domains are also provided. Rule bodies are not reproduced in the article.
Detection Engineering Assessment
Required Log Sources
- DNS resolution logs (for C2 domain rotation and .gov.br delivery host monitoring)
- HTTP/HTTPS proxy logs with TLS inspection (for /laravel.php and /nbw/ beacon patterns)
- Endpoint process creation logs (Inno Setup installer spawning Electron/Boostnote)
- Registry modification logs (HKCU Run key changes)
- Email security gateway logs (SPF/DKIM/DMARC authentication results for .gov.br senders)
- File creation logs (index.js in resources\app\ directory, App.exe in temp directories)
Hunting Hypotheses
| Hypothesis | Telemetry | ATT&CK Stage | FP Risk |
|---|---|---|---|
| Consider hunting for Inno Setup installers that spawn Electron/Boostnote processes and subsequently create Run key registry entries, as this combination indicates the PhantomEnigma build chain (T1547.001 + T1059.007). | Endpoint process creation logs, registry modification events, file creation events in temp directories | Execution and Persistence | Medium — legitimate Electron applications packaged with Inno Setup could trigger this pattern; correlate with network beacon activity for higher confidence. |
| Consider hunting for HTTP POST requests to /nbw/ endpoints containing JSON bodies with computer name and username fields, as this is the Gen B beacon pattern unique to PhantomEnigma. | Network proxy logs, HTTP logs, Suricata alerts | Command and Control | Low — the /nbw/ path combined with JSON system information fields is distinctive and unlikely in legitimate traffic. |
| Consider hunting for GET requests to /laravel.php with parameters containing api=api, hash=, and message=PT1n patterns, as this is the Gen A beacon used in earlier PhantomEnigma activity. | Network proxy logs, HTTP logs, Suricata alerts | Command and Control | Low — the specific parameter combination and PT1n prefix are distinctive; appeared in 16 sandbox analyses with no unrelated matches. |
| Consider hunting for files named index.js within resources\app\ directories of Electron applications that contain String.fromCharCode decoding and setLoginItemSettings calls, as these are core backdoor indicators. | File creation logs, EDR file content scanning, YARA file scanning | Execution and Persistence | Low — the combination of these specific functions in an Electron app's index.js is highly suspicious and not typical of legitimate applications. |
| Consider hunting for emails from .gov.br or .jus.br senders that pass SPF/DKIM/DMARC but contain links to file download paths (e.g., /down.php, /doc/, /oficio/) on government hosts, as compromised government mailboxes and portals are a primary delivery vector. | Email security gateway logs, web proxy logs | Initial Access | Medium — legitimate government communications may use similar URL patterns; focus on file download endpoints and executable MIME types for higher confidence. |
Control Gaps
- Static reputation-based detection would miss this campaign because compromised .gov.br domains have high trust scores and many samples received clean verdicts
- Domain blocklists alone are insufficient due to weekly C2 rotation and use of randomly generated domains behind Cloudflare
- Standard email authentication (SPF/DKIM/DMARC) fails to detect this campaign because emails are sent from genuinely compromised government mailboxes
- HTTPS inspection gaps would prevent detection of /nbw/ beacon traffic when the operator moves behind Cloudflare and TLS
- Behavioral detection of JavaScript execution inside legitimate Electron runtimes may not be covered by standard EDR configurations
Key Behavioral Indicators
- Inno Setup installer process spawning Boost Note.exe or App.exe in is-*.tmp temp directories
- Electron/Boostnote process creating HKCU\Software\Microsoft\Windows\CurrentVersion\Run registry entries
- Electron process making outbound HTTP requests to /laravel.php or /nbw/ endpoints
- Process tree: Inno Setup installer → Electron host → child_process.exec spawning unexpected child processes
- File creation of index.js in resources\app\ directory within an Inno Setup extraction temp folder
- Word-salad installation directory names (e.g., UltraSuiteSmartCoreware, ProSoftxUltraToolator, DistroniceApplication)
- Boost Note.exe renamed to Grape.exe to avoid known decoy string detection
False Positive Assessment
Medium — The /laravel.php and /nbw/ beacon patterns are distinctive with low false positive risk in network detection. However, the build-chain tags (Delphi + Inno Setup + Node.js) are individually common across legitimate software, and the use of compromised government infrastructure means traffic to .gov.br domains may include both malicious and legitimate activity. Behavioral detections for Electron applications creating Run keys could trigger on legitimate software updaters. Correlating multiple indicators (build chain + network beacon + government delivery) significantly reduces false positive risk.
Recommendations
Immediate Mitigation
- Verify against your organization's incident response runbook and team escalation paths before acting. Consider adding the confirmed C2 domains (zsxocjarsate.com, dahieenloo.com, psznaoehteeh.com, eeresofeuae.com, logs.zabbxsoftware.com, oauth.openvpnet.com) and beacon IPs (185.219.83.191, 188.137.246.189) to network blocklists and proxy filters.
- Consider deploying Suricata or network IDS signatures for the /laravel.php?api=api&hash= and /nbw/ POST beacon patterns in monitoring mode to validate against normal traffic before enabling automated blocking.
- If your organization operates in Brazil or serves Brazilian customers, consider reviewing recent email security logs for messages from .gov.br or .jus.br senders containing links to file download paths, even if SPF/DKIM/DMARC checks passed.
- Consider searching endpoint telemetry for the anchor hash (e0dae1a04b7a3b2ae07377b0fd00681e9633532788870b3709a9e149f3ccf0e0) and dropped index.js hash (71f69978667dc421e7edf8885e9f3bde9dd527d9f7974228c9a6eac84c2ab71c) across your environment.
Infrastructure Hardening
- Consider evaluating whether your email security gateway can apply additional scrutiny to messages from government domains that contain file download links, even when authentication checks pass, as compromised legitimate mailboxes bypass standard trust controls.
- If your organization uses Cloudflare or similar CDN services, consider evaluating whether your network monitoring can inspect traffic to Cloudflare-fronted domains for known beacon patterns.
- Consider implementing DNS monitoring for newly registered domains with random character patterns (e.g., zsxocjarsate, dahieenloo, eeresofeuae) as an early warning for C2 rotation.
- Where supported by your tooling, consider deploying YARA rules targeting the index.js backdoor characteristics (JSON.stringify beacon structure, COMPUTERNAME/USERNAME collection, String.fromCharCode decoding, setLoginItemSettings persistence) for endpoint file scanning.
User Protection
- Consider alerting users who may interact with Brazilian government portals or police communications about the PhantomEnigma phishing campaign, emphasizing that legitimate-looking emails from .gov.br addresses may be compromised.
- If applicable, consider configuring endpoint controls to flag or quarantine Inno Setup installers downloaded from .gov.br domains or police-themed typosquat domains.
- Consider evaluating whether your EDR can detect and alert on Electron applications creating Run key registry entries or making outbound HTTP requests to non-standard paths.
Security Awareness
- Consider incorporating PhantomEnigma campaign awareness into existing security awareness programs, focusing on the police-themed phishing lure pattern (Ofício, Intimação Polícia Civil, Procuração Digital).
- Consider training users to verify unexpected government communications through out-of-band channels before clicking links or downloading attachments, even when the sender domain appears legitimate.
- Consider educating SOC analysts on the limitations of clean verdicts from automated analysis and the importance of behavioral investigation for files delivered through trusted infrastructure.
MITRE ATT&CK Mapping
- domaindahieenloo[.]comRecently observed randomly generated delivery/C2 domain in the PhantomEnigma rotation
- domaineeresofeuae[.]comRecently observed randomly generated delivery/C2 domain in the PhantomEnigma rotation
- domainlogs[.]zabbxsoftware[.]comC2 domain for the Zabbxsoftware 'Zab agent' kit used in the Ofício-PC delivery arm leading to Cobalt Strike
- domainnovoservidor2026[.]comSibling arm domain associated with KalebAutoRun scheduled task persistence (21/21 malicious, disjoint from core cluster)
- domainoauth[.]openvpnet[.]comRotated C2 domain for the Zabbxsoftware kit replacing logs.zabbxsoftware.com in the Ofício-PC delivery chain
- domainoficiospolicia[.]comCandidate police-themed typosquat already surfacing as a potential next rotation domain
- domainpccvill[.]comPolice-themed lookalike delivery domain; no longer active at time of review
- domainpccvioo[.]comPolice-themed lookalike delivery domain; no longer active at time of review
- domainpoliciacivilmg[.]comPolícia Civil MG lookalike typosquat domain; largest seed domain appearing in 34 of 231 core sessions; no longer active at time of review
- domainpsznaoehteeh[.]comRecently active randomly generated delivery/C2 domain in the PhantomEnigma rotation
- domaintaaeiuep[.]comDelivery domain linked to Inno Setup and Procuração Digital activity; confirmed via abuse.ch ThreatFox (confidence 75)
- domainzsxocjarsate[.]comConfirmed live C2 domain on July 12, 2026; hosts the /nbw/ backdoor endpoint receiving POST beacons with victim system information
- ip158[.]94[.]208[.]120Origin server IP on AS202412 OMEGATECH-AS (Seychelles) behind Cloudflare proxy for delivery domains
- ip185[.]219[.]83[.]191Beacon C2 IP address on AS214943 RAILNET hosting the /laravel.php system-information endpoint and backdoor communications
- ip188[.]137[.]246[.]189Beacon C2 IP address on AS214943 RAILNET used for backdoor communications
- ip195[.]177[.]94[.]103Backend IP for Ofício-PC delivery arm, remained active as of July 10, 2026 even after phishing activity declined
- ip195[.]177[.]94[.]193Associated with Ofício-PC delivery arm infrastructure
- ip79[.]110[.]49[.]32Associated with Ofício-PC delivery arm infrastructure
- ip91[.]92[.]241[.]181Origin server IP on AS202412 OMEGATECH-AS (Seychelles) behind Cloudflare proxy
- sha25671f69978667dc421e7edf8885e9f3bde9dd527d9f7974228c9a6eac84c2ab71cSHA256 hash of dropped malicious index.js backdoor file (239,459 bytes) extracted from patched Boostnote application
- sha256e0dae1a04b7a3b2ae07377b0fd00681e9633532788870b3709a9e149f3ccf0e0SHA256 hash of Procuracao_Digital.exe, the anchor Inno Setup installer delivering the patched Boostnote backdoor
- urlhxxps://circ[.]rs[.]gov[.]br/OficioDigital[.]exeCompromised government host serving malicious installer executable directly
- urlhxxps://zsxocjarsate[.]com/nbw/Live /nbw/ backdoor endpoint confirmed during July 12, 2026 re-detonation; receives POST JSON beacons with machine ID, computer name, username, and campaign tag