macOS.Gaslight Uses Prompt Injection to Disrupt AI-Assisted Malware Analysis

· Original article ↗

Summary

Researchers analyzed macOS.Gaslight, a Rust implant linked with high confidence to DPRK-aligned activity. It combines data theft and interactive access over Telegram C2 with fabricated system messages designed to mislead LLM-assisted triage.

Key points

  • The Rust macOS implant embeds 38 fabricated “system” messages intended to make an LLM-assisted triage pipeline abort, truncate, or refuse analysis.
  • Researchers assess with high confidence that macOS.Gaslight belongs to a cluster of DPRK-aligned macOS activity; Apple XProtect detects the sample by hash.
  • Its Telegram Bot API C2 supports an interactive shell, process termination, file uploads, and implant shutdown; payloads use AES-GCM over certificate-pinned TLS.
  • A configurable Python collection module targets browser data, terminal histories, system information, running processes, and a copy of login.keychain-db.
  • The implant can establish LaunchAgent persistence and masquerades under the label com.apple.system.services.activity.
  • A runtime routine redacts the Telegram bot token from diagnostic output, while a bundled installer can fetch a standalone Python interpreter.

Article Details

Attack Vectors
  • macOS.Gaslight establishes command and control through a Telegram Bot API getUpdates polling loop, with operator commands and collected data exchanged through the channel.
  • The implant supports interactive shell commands, process termination by PID, and file exfiltration through Telegram's file-attachment mechanism.
  • A configurable Python collection module harvests browser data, terminal histories, installed applications, process and system profiles, and a copy of login.keychain-db.
  • A separate installer can fetch and stage a standalone CPython interpreter for the Python collection module.
  • The implant supports persistence through a LaunchAgent labeled com.apple.system.services.activity; activation is controlled by configuration.
  • The binary embeds fabricated system messages intended to mislead LLM-assisted malware analysis.
Defensive Notes
  • Treat content extracted from samples as untrusted data, not as instructions to analysis models; isolate hostile sample content from trusted prompts.
  • Apple XProtect detects the sample by hash under the MACOS_BONZAI_COBUCH rule.
  • The sample's bot token and operator configuration are supplied at runtime and are not embedded in the analyzed binary, so they were unavailable to the researchers.

Indicators of compromise

TypeIndicatorContext
SHA2566328567511d88fdc2ae0939c5ef17b7a63d2a833881900de018a4f12f4982525SHA-256 hash identified as the macOS.Gaslight Mach-O sample.
SHA25677b4fd46994992f0e57302cfe76ed23c0d90101381d2b89fc2ddf5c4536e77caSHA-256 hash identified as a sibling BONZAI sample.
SHA256baabf249c77bc54c54ab0e66e15af798bd28aa5b4683554456a8b73ab8741239SHA-256 hash identified as the Python payload script.
SHA256e4503e31d5a297d93ade64f50a5b5fe91e73dad251ac2615b4c975684f68e080SHA-256 hash identified as the bash installer script.

MITRE ATT&CK

Malware

Vendors

Products

Tools

Related Articles