Skip to navigation

Threat reportMalwareTL-2026-0920

macOS.Gaslight — DPRK-aligned Rust Backdoor & Infostealer with Analyst-Targeting Prompt-Injection Anti-Analysis (Telegram Bot API C2)

highACTIVE

macOS.Gaslight is a Rust-based persistent backdoor and infostealer for macOS, attributed with high confidence to DPRK-aligned activity. It is notable for a novel anti-analysis technique: a 3.5 KB blob of 38 fabricated 'system' messages designed to disrupt LLM-assisted malware analysis (and mislead human analysts) rather than evade sandboxes.

Key facts

IdentifiersTL-2026-0920
Also known asmacOS.Gaslight, Gaslight, MACOS_BONZAI_COBUCH (XProtect rule)
SeverityHIGH
Affected productsApple macOS
Nation-state nexusNorth Korea
MalwareBONZAI / AIRPILE (XProtect), macOS.Gaslight
ToolsTelegram Bot API custom Rust C2, astral-sh/python-build-standalone CPython 3.10.18 (build 20250708)
MITRE ATT&CK / ATLAS techniquesAML.T0051.001 LLM Prompt Injection, T1005 Data from Local System, T1020 Automated Exfiltration, T1027 Obfuscated Files or Information, T1036 Masquerading, T1036.005 Masquerading, T1041 Exfiltration Over C2 Channel, T1057 Process Discovery, T1059 Command and Scripting Interpreter, T1059.004 Command and Scripting Interpreter, T1059.006 Command and Scripting Interpreter, T1071 Application Layer Protocol and 27 more in the attack flow
MotivationFINANCIAL
Target sectorscryptocurrency, blockchain, financial, technology, web3
Target regionsGlobal, North America, Europe, Asia
Detection rules9 (1 shown free)
Sources10 cited sources

Detection coverage

As of 2026-10-23, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-0920 across Splunk SPL, Microsoft KQL and Sigma, covering 29 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.

Free detection: macOS.Gaslight — login.keychain-db & Browser Credential Theft + CPython Staging (Post-Exploitation)

Detects post-exploitation credential collection by macOS.Gaslight's Python stealer: raw access to ~/Library/Keychains/login.keychain-db by a process outside /System and /usr/bin/security, browser-data reads (Chrome/Brave/Firefox/Safari), and the runtime fetch of an astral-sh/python-build-standalone CPython 3.10.18 runtime used to execute the base64-staged stealer.

Splunk SPL

index=osquery sourcetype="osquery:results"
| eval tgt=coalesce('columns.path','columns.target_path')
| eval img=coalesce('columns.cmdline','columns.process_name','process')
| search (tgt="*Library/Keychains/login.keychain-db" OR tgt="*Library/Application Support/Google/Chrome*" OR tgt="*Library/Application Support/BraveSoftware*" OR tgt="*Library/Application Support/Firefox*" OR tgt="*Library/Safari*")
| search NOT (img="/System/*" OR img="/usr/bin/security*")
| stats count values(tgt) as targets values(img) as accessing_process min(_time) as firstSeen by host
| convert ctime(firstSeen)
| where count > 0

Microsoft KQL

DeviceFileEvents
| where Timestamp > ago(24h)
| where FileName =~ "login.keychain-db" or FolderPath has_any ("/Google/Chrome", "/BraveSoftware", "/Application Support/Firefox", "/Library/Safari")
| where InitiatingProcessFolderPath !startswith "/System/" and InitiatingProcessFolderPath !has "/usr/bin/security"
| join kind=leftouter (
    DeviceNetworkEvents
    | where Timestamp > ago(24h)
    | where RemoteUrl has "astral-sh/python-build-standalone" or RemoteUrl has "cpython-3.10.18"
    | project DeviceId, StagingFetch=RemoteUrl
  ) on DeviceId
| project Timestamp, DeviceName, FolderPath, FileName, InitiatingProcessFileName, InitiatingProcessFolderPath, StagingFetch

Sigma

title: macOS.Gaslight Keychain and Browser Credential Theft
id: 7c2e1d44-0920-4a11-9b01-aa01b2c3d402
status: experimental
description: Detects raw access to login.keychain-db and browser credential stores by a non-system process, consistent with the macOS.Gaslight Python infostealer.
references:
    - https://www.sentinelone.com/labs/macos-gaslight-rust-backdoor-turns-prompt-injection-on-the-analyst-not-the-sandbox/
author: Threadlinqs Team
date: 2026-06-23
tags:
    - attack.credential_access
    - attack.t1555.001
    - attack.t1555.003
    - attack.discovery
    - attack.t1217
    - attack.execution
    - attack.t1059.006
logsource:
    product: macos
    category: file_event
detection:
    selection_keychain:
        TargetFilename|endswith: 'login.keychain-db'
    selection_browser:
        TargetFilename|contains:
            - '/Google/Chrome/'
            - '/BraveSoftware/'
            - '/Application Support/Firefox/'
            - '/Library/Safari/'
    filter_apple:
        Image|startswith:
            - '/System/'
            - '/usr/bin/security'
    condition: (selection_keychain or selection_browser) and not filter_apple
falsepositives:
    - Backup software or the user's own browser/Keychain Access app reading these paths
level: high

Known false positives:

  • Legitimate backup/sync tools touching browser profiles
  • User running Keychain Access or /usr/bin/security interactively
  • Developer legitimately fetching python-build-standalone

Tuning notes: Highest-fidelity signal is the combination: a single non-Apple process touching login.keychain-db AND multiple browser stores AND a recent CPython staging fetch. Exclude known backup agents by signing identity. The astral-sh CPython 3.10.18 (build 20250708) fetch from a non-developer endpoint is a strong corroborator — correlate within a 1h window.

8 more detection rules (Splunk SPL, Microsoft KQL, Sigma) · unlock with TL Creds. Sign up free to unlock the detection rules or query them with the Threadlinqs MCP server (Purple)
  • macOS.Gaslight — Ad-Hoc-Signed Binary Creating LaunchAgent + Power Assertion (Exploitation/Persistence) · unlock with TL Creds
  • macOS.Gaslight — Automated Collection, Discovery & Local Staging (Post-Exploitation) · unlock with TL Creds
  • macOS.Gaslight — CPython Staging Fetch Then Encoded Python Execution (C2/Staging) · unlock with TL Creds
  • macOS.Gaslight — Anti-LLM Harness-Spoofing Prompt-Injection Blob in Sample (Exploitation/Anti-Analysis) · unlock with TL Creds
  • macOS.Gaslight — dlsym-Heavy Runtime API Resolution with Sparse Imports (Post-Exploitation/Evasion) · unlock with TL Creds
  • macOS.Gaslight — Certificate-Pinned Encrypted Telegram C2 & Exfiltration (C2/Exfiltration) · unlock with TL Creds
  • macOS.Gaslight — Masquerading LaunchAgent in com.apple.* Namespace (Exploitation/Persistence) · unlock with TL Creds
  • macOS.Gaslight — Telegram Bot API getUpdates C2 from Non-Browser Process (C2/Exfiltration) · unlock with TL Creds

Indicators of compromise

As of 2026-10-23, Threadlinqs Intelligence tracks 29 indicators of compromise for TL-2026-0920.

Sample indicators (3 of 29)

  • Domain: api[.]telegram[.]org
  • File hash: 6328567511d88fdc2ae0939c5ef17b7a63d2a833881900de018a4f12f4982525
  • File hash: 77b4fd46994992f0e57302cfe76ed23c0d90101381d2b89fc2ddf5c4536e77ca

Defanged, TLP:CLEAR. Full set of 29 indicators: unlock with TL Creds.

29 indicators of compromise · unlock with TL Creds. Compare plans

Technical analysis

It uses Telegram Bot API getUpdates polling for C2 with AES-GCM encryption and certificate pinning, persists via a masquerading LaunchAgent, and stages a base64-encoded Python stealer that harvests browser data, keychain credentials, and system data for exfiltration over Telegram.

macOS.Gaslight is a Rust-compiled, ad-hoc-signed Mach-O implant for macOS (aarch64 primary; the staged Python stealer also supports x86_64) analyzed by SentinelLABS and published on 23 June 2026. SentinelLABS attributes the sample to a DPRK-aligned activity cluster with HIGH confidence based on Apple XProtect detection under the MACOS_BONZAI_COBUCH rule (the BONZAI signature family is associated by SentinelLABS with North Korean operations) and a sibling sample detected by the AIRPILE rule, also tied to DPRK activity. The malware sits within the lineage of DPRK macOS tooling such as RustBucket, KandyKorn, and NimDoor.

The defining feature of macOS.Gaslight is an analyst-targeting prompt-injection payload: a ~3.5 KB Markdown-fenced blob containing 38 fabricated 'system' messages that imitate an LLM triage harness scaffold using {{DATA}} delimiters. The fake messages describe token expiry, out-of-memory kills, disk exhaustion, injection vulnerabilities, and static-analysis flags, with the objective of pushing an LLM agent into aborting, truncating, or refusing analysis. SentinelLABS characterizes this as the first documented harness-spoofing cascade — earlier samples used single injected blocks — and notes the implant 'attacks the agent's perception, rather than the sandbox it runs in.' Notably absent are conventional anti-analysis tricks such as VM detection, debugger evasion, or sandbox-specific behavior.

For command and control, the Rust core uses a Telegram Bot API getUpdates polling loop, with single-instance locking achieved via the Telegram Conflict error response. It exposes an interactive shell with six verbs (help, id, shell, kill, upload, stop) plus evidence of a seventh 'focus' command. Transport security uses the aes-gcm 0.10.3 crate for AES-GCM payload encryption with a fresh nonce per message generated via CCRandomGenerateBytes, an AES key supplied at runtime (not embedded), and certificate pinning via SecTrustSetAnchorCertificatesOnly to block standard proxy CA interception while still honoring system proxy settings via SCDynamicStoreCopyProxies. Runtime behavior is driven by a 15-field serde configuration schema (tg_room_id, github_token, github_repo, github_polling_interval, main_upload_url, main_base_url, aes_key, payload_path_linux, payload_path_macos, persist_name_linux, persist_name_macos, persist_type_linux, persist_type_macos, init_python_enable, persist_enable). The presence of Linux and GitHub fields not exercised in the sample indicates a broader, cross-platform operator toolkit. An OPSEC feature redacts the bot token in runtime output when a URL path contains the bytes for 'file' (0x656c6966 little-endian), substituting the placeholder 'file/token:redacted' to prevent token recovery from logs and crash artifacts.

The implant resolves APIs at runtime via dlsym (avoiding the static symbol table), locates its own executable via __NSGetExecutablePath, executes processes with execvp (with a posix_spawnp alternative), and creates an IOPMAssertionCreateWithName power-management assertion to prevent system sleep during polling/collection. Persistence is via a LaunchAgent labeled com.apple.system.services.activity (masquerading within the com.apple.* namespace), written with an absolute executable path and gated by the persist_enable serde field.

Data collection is handled by a base64-encoded Python stealer (~6.6 KB encoded) staged at runtime by a ~2 KB bash installer. The installer fetches a standalone CPython runtime (Python 3.10.18, build 20250708) from the astral-sh/python-build-standalone project, supporting arm64 and x86_64. The stealer collects Chrome, Brave, Firefox, and Safari browser data; terminal command histories; installed application lists; running processes (ps aux); a system profile (system_profiler); and a raw copy of login.keychain-db. Collected data is archived to temp/collected_data.zip and uploaded via the Telegram multipart attach mechanism. Widespread emoji use and strict comment headers in the stealer suggest AI-assisted code generation. The sample was uploaded to VirusTotal on 22 May 2026 and surfaced via an early-June 2026 Apple XProtect update, despite being previously undetected on VirusTotal.

MITRE ATT&CK / ATLAS techniques by tactic:

Initial Access

AML.T0051.001 LLM Prompt Injection

Collection

T1005 Data from Local System; T1074 Data Staged; T1119 Automated Collection; T1560 Archive Collected Data

Exfiltration

T1020 Automated Exfiltration; T1041 Exfiltration Over C2 Channel; T1567 Exfiltration Over Web Service

Defense Evasion

T1027 Obfuscated Files or Information; T1036 Masquerading; T1036.005 Masquerading; T1140 Deobfuscate/Decode Files or Information

Discovery

T1057 Process Discovery; T1082 System Information Discovery; T1083 File and Directory Discovery; T1217 Browser Information Discovery; T1518 Software Discovery

Execution

T1059 Command and Scripting Interpreter; T1059.004 Command and Scripting Interpreter; T1059.006 Command and Scripting Interpreter; T1106 Native API

Command and Control

T1071 Application Layer Protocol; T1071.001 Application Layer Protocol; T1102 Web Service; T1102.002 Web Service; T1105 Ingress Tool Transfer; T1132 Data Encoding; T1573 Encrypted Channel; T1573.001 Encrypted Channel

execution

T1204 User Execution

Credential Access

T1539 Steal Web Session Cookie; T1552.003 Unsecured Credentials; T1555 Credentials from Password Stores; T1555.001 Credentials from Password Stores; T1555.003 Credentials from Password Stores

Persistence

T1543 Create or Modify System Process; T1543.001 Create or Modify System Process

defense-impairment

T1553 Subvert Trust Controls

Resource Development

T1587 Develop Capabilities

Remediation

Immediate actions

  • Block and alert on the published SHA-256 hashes (Mach-O, Python payload, bash installer, sibling BONZAI sample) across EDR and email/file gateways
  • Hunt for the LaunchAgent label com.apple.system.services.activity in ~/Library/LaunchAgents and /Library/LaunchAgents
  • Ensure Apple XProtect is current; rules MACOS_BONZAI_COBUCH and AIRPILE detect this family
  • Alert on outbound connections to api.telegram.org from non-browser, unsigned/ad-hoc-signed macOS processes
  • Hunt for runtime fetches of astral-sh/python-build-standalone CPython 3.10.18 (build 20250708) from non-developer endpoints

Workarounds

  • Restrict Telegram Bot API (api.telegram.org) egress where not business-required
  • Apply egress allowlisting rather than relying on TLS CA interception — this malware pins certificates and ignores injected proxy CAs

Longer-term hardening

  • Deploy behavioral EDR on macOS that flags LaunchAgent creation by ad-hoc-signed binaries and login.keychain-db access by non-Apple processes
  • Enforce allowlisting / notarization-gating so ad-hoc-signed Mach-O binaries cannot execute
  • Treat malware artifacts and any embedded 'system'/instruction text as untrusted DATA in LLM-assisted analysis pipelines; sandbox LLM analysis and never let analyzed content steer agent control flow
  • Monitor for anomalous IOPMAssertion power-assertions and dlsym-heavy runtime API resolution

Affected and fixed versions

  • Apple — macOS
    Vulnerable versions: macOS on Apple Silicon (aarch64); macOS on Intel (x86_64, via Python stealer)

Timeline

Last updated · 2 updates · revalidated 2× · latest source

  • SentinelLABS documents RustBucket, an early DPRK macOS Rust backdoor that evades analysis and detection — establishing the DPRK Rust-on-macOS lineage macOS.Gaslight extends.
  • Build date (20250708) of the standalone CPython 3.10.18 runtime (astral-sh/python-build-standalone) that the bash installer fetches to run the Python stealer.
  • Reporting describes a new wave of DPRK attacks leveraging AI-inserted npm malware, fake firms, and RATs — the broader AI-assisted DPRK tooling trend in which macOS.Gaslight's AI-generated stealer and anti-LLM payload sit.
  • macOS.Gaslight sample uploaded to VirusTotal, where it was initially undetected.
  • Early-June 2026 Apple XProtect update surfaced the Mach-O sample (rule MACOS_BONZAI_COBUCH); sibling sample caught by AIRPILE rule.
  • Security Affairs and Cyber Security News publish same-day coverage summarizing the SentinelOne findings.
  • Four SHA-256 IOCs published (Mach-O implant, sibling BONZAI sample, Python payload, bash installer) plus LaunchAgent label and ad-hoc signing ID.
  • First documented 'harness-spoofing cascade': 38 fabricated system messages targeting LLM-assisted analysis, an escalation over prior single-block prompt injections.
  • SentinelLABS attributed the sample to a DPRK-aligned activity cluster with HIGH confidence based on BONZAI/AIRPILE XProtect detections.
  • SentinelLABS published analysis of macOS.Gaslight, documenting the analyst-targeting prompt-injection technique.
  • Infosecurity Magazine reports the 38-message prompt-injection cascade targeting AI triage.
  • The Hacker News and GBHackers publish follow-up coverage amplifying the SentinelOne research, including researcher Phil Stokes's quote: 'It attacks the agent's perception, rather than the sandbox it runs in.'
  • Cloud Security Alliance publishes a research note with mitigation guidance for AI-assisted malware analysis pipelines.
  • SentinelLABS article shows an updated date of 2026-08-04.

Update history

Sources cited

Previous and next in malware

Further reading

Drafted by the Threadlinqs research pipeline from 10 sources; published ; last updated .

Threadlinqs Intelligence — Real-Time Threat Detection Platform

// threat_feed
$ sort --newest
Showing all threats

Live intelligence console

Threat level

Latest Threats