Detection rules › Elastic

Connection to Common Large Language Model Endpoints

Status
production
Severity
medium
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies DNS queries to known Large Language Model domains by unsigned binaries or common Windows scripting utilities. Malwares may leverage the capabilities of LLM to perform actions in the affected system in a dynamic way.

MITRE ATT&CK coverage

Rule body

[metadata]
creation_date = "2025/09/01"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/04/21"

[rule]
author = ["Elastic"]
description = """
Identifies DNS queries to known Large Language Model domains by unsigned binaries or common Windows scripting utilities.
Malwares may leverage the capabilities of LLM to perform actions in the affected system in a dynamic way.
"""
from = "now-9m"
index = [
    "endgame-*",
    "logs-endpoint.events.network-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*",
]
language = "eql"
license = "Elastic License v2"
name = "Connection to Common Large Language Model Endpoints"
note = """## Triage and analysis

### Investigating Connection to Common Large Language Model Endpoints

#### Possible investigation steps

- Investigate the process execution chain (parent process tree) for unknown processes or malicious scripts.
- Verify if the executed process is persistent on the host like common mechanisms Startup folder, task or Run key.
- Review any unusual network, files or registry events by the same process.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Extract this communication's indicators of compromise (IoCs) and use traffic logs to search for other potentially compromised hosts.

### False positive analysis

- Trusted applications from an expected process running in the environment.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- Immediately block the identified indicators of compromise (IoCs).
- Implement any temporary network rules, procedures, and segmentation required to contain the attack.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Update firewall rules to be more restrictive.
- Reimage the host operating system or restore the compromised files to clean versions.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""
references = ["https://malpedia.caad.fkie.fraunhofer.de/details/py.lamehug"]
risk_score = 47
rule_id = "4ae94fc1-f08f-419f-b692-053d28219380"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "OS: macOS",
    "Use Case: Threat Detection",
    "Tactic: Command and Control",
    "Resources: Investigation Guide",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Data Source: Sysmon",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
network where host.os.type in ("macos", "windows") and dns.question.name != null and
(
  process.name : ("MSBuild.exe", "mshta.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "msiexec.exe", "rundll32.exe",
  "bitsadmin.exe", "InstallUtil.exe", "RegAsm.exe", "vbc.exe", "RegSvcs.exe", "regsvr32.exe", "dllhost.exe",
  "node.exe", "javaw.exe", "java.exe", "*.pif", "*.com", "python*", "osascript", "Script Editor", "curl", "curl.exe", "deno", 
  "deno.exe", "node", "bun", "bun.exe") or

  ?process.code_signature.subject_name : ("AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or

  (
    process.executable : ("?:\\Users\\*.exe", "?:\\ProgramData\\*.exe", "/Users/Shared/*", "/Library/WebServer/*", 
                          "/Users/*/Library/WebServer/*", "/Library/Graphics/*", "/Users/*/Library/Graphics/*", "/Library/Fonts/*", 
                          "/Users/*/Library/Fonts/*", "/private/var/root/Library/HTTPStorages/*", "/tmp/*", "/var/tmp/*", "/private/tmp/*") and
    (?process.code_signature.trusted == false or ?process.code_signature.exists == false)
  )
 ) and
    dns.question.name : (
    // Major LLM APIs
    "api.openai.com",
    "*.openai.azure.com",
    "api.anthropic.com",
    "api.mistral.ai",
    "api.cohere.ai",
    "api.ai21.com",
    "api.groq.com",
    "api.perplexity.ai",
    "api.x.ai",
    "api.deepseek.com",
    "api.gemini.google.com",
    "generativelanguage.googleapis.com",
    "api.azure.com",
    "api.bedrock.aws",
    "bedrock-runtime.*.amazonaws.com",

    // Hugging Face & other ML infra
    "api-inference.huggingface.co",
    "inference-endpoint.huggingface.cloud",
    "router.huggingface.co",
    "*.hf.space",
    "*.replicate.com",
    "api.replicate.com",
    "api.runpod.ai",
    "*.runpod.io",
    "api.modal.com",
    "*.forefront.ai",

    "api.arcee.ai",
    "api.sambanova.ai",
    "chatapi.akash.network",
    "api.reka.ai",
    "api.cerebras.ai",
    "api.morphllm.com",
    "openrouter.ai",
    "api.moonshot.cn",
    "api.moonshot.ai",
    "api.z.ai",
    "api.inference.wandb.ai",
    "trace.wandb.ai",
    "api.bfl.ai",
    "api.eu.bfl.ai",
    "api.us.bfl.ai",
    "api.ionstream.ai",
    "api.minimax.io",
    "api.minimaxi.com",
    "api.stepfun.ai",
    "api.stepfun.com",
    "api.featherless.ai",
    "api.intelligence.io.solutions",
    "api.fireworks.ai",
    "inference.baseten.co",
    "api.baseten.co",
    "api.gmi-serving.com",
    "api.ncompass.tech",
    "api.nextbit256.com",
    "api.hyperbolic.xyz",
    "neuro.mancer.tech",
    "managed-inference-api-proxy.crusoecloud.com",
    "api.crusoe.ai",
    "api.avian.io",
    "api.siliconflow.cn",
    "api.totalgpt.ai",
    "switchpoint.dev",
    "api.novita.ai",
    "api.inflection.ai",
    "api.wavespeed.ai",
    "api.cloud.mara.com",
    "api.inference.net",
    "api.deepinfra.com",
    "api.xiaomimimo.com",
    "dashscope.aliyuncs.com",
    "dashscope-intl.aliyuncs.com",
    "dashscope-us.aliyuncs.com",
    "integrate.api.nvidia.com",
    "api.inceptionlabs.ai",
    "api.friendli.ai",
    "external.api.recraft.ai",
    "api.cloudflare.com",
    "gateway.ai.cloudflare.com",
    "api.studio.nebius.ai",
    "api.tokenfactory.nebius.com",
    "api.aionlabs.ai",
    "api.relace.run",
    "instantapply.endpoint.relace.run",
    "ranker.endpoint.relace.run",
    "embeddings.endpoint.relace.run",
    "console-api.inference.ai",
    "api.parasail.io",
    "api.redpill.ai",
    "api.modular.com",
    "ark.cn-beijing.volces.com",
    "ark.ap-southeast.bytepluses.com",
    "ai2endpoints.cirrascale.ai",
    "aisuite.cirrascale.com",
    "api.clarifai.com",
    "api.venice.ai",
    "api.atlascloud.ai",
    "wanqing.streamlakeapi.com",
    "api.ambient.xyz",
    "api.upstage.ai",
    "api.together.xyz",
    "api.inceptron.io",
    "chutes.ai",
    "aiplatform.googleapis.com",
    "portal.nousresearch.com",
    "inference-api.nousresearch.com",
    "api.githubcopilot.com",
    "ai-gateway.vercel.sh",
    "opencode.ai",
    "api.kilo.ai",
    "qianfan.baidubce.com",
    "hunyuan.tencentcloudapi.com",
    "open.bigmodel.cn",
    "spark-api-open.xf-yun.com",
    "api.sensenova.cn",
    "api.baichuan-ai.com",
    "api-inference.modelscope.cn",
    "api.lingyiwanwu.com",
    "api.360.cn",

    // Consumer-facing AI chat portals
    "chat.openai.com",
    "chatgpt.com",
    "copilot.microsoft.com",
    "bard.google.com",
    "gemini.google.com",
    "claude.ai",
    "perplexity.ai",
    "poe.com",
    "chat.forefront.ai",
    "chat.deepseek.com",

    // OpenClaw
    "openclaw.ai"
  ) and

  not process.executable : (
          "?:\\Program Files\\*.exe",
          "?:\\Program Files (x86)\\*.exe",
          "?:\\Windows\\System32\\svchost.exe",
          "?:\\Windows\\SystemApps\\Microsoft.LockApp_*\\LockApp.exe",
          "?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
          "?:\\Users\\*\\AppData\\Local\\BraveSoftware\\*\\Application\\brave.exe",
          "?:\\Users\\*\\AppData\\Local\\Vivaldi\\Application\\vivaldi.exe",
          "?:\\Users\\*\\AppData\\Local\\Programs\\Opera*\\opera.exe",
          "?:\\Users\\*\\AppData\\Local\\Programs\\Fiddler\\Fiddler.exe"
        ) and
    not (?process.code_signature.trusted == true and
         ?process.code_signature.subject_name : ("Anthropic, PBC", "Google LLC", "Mozilla Corporation", "Brave Software, Inc.", "Island Technology Inc.", "Opera Norway AS",
                                                  "OpenJS Foundation", "Developer ID Application: Node.js Foundation (HX7739G8FX)"))
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1102"
name = "Web Service"
reference = "https://attack.mitre.org/techniques/T1102/"
[[rule.threat.technique.subtechnique]]
id = "T1102.002"
name = "Bidirectional Communication"
reference = "https://attack.mitre.org/techniques/T1102/002/"



[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

Stages and Predicates

Stage 1: network

network where host.os.type in ("macos", "windows") and dns.question.name != null and
(
  process.name : ("MSBuild.exe", "mshta.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "msiexec.exe", "rundll32.exe",
  "bitsadmin.exe", "InstallUtil.exe", "RegAsm.exe", "vbc.exe", "RegSvcs.exe", "regsvr32.exe", "dllhost.exe",
  "node.exe", "javaw.exe", "java.exe", "*.pif", "*.com", "python*", "osascript", "Script Editor", "curl", "curl.exe", "deno",
  "deno.exe", "node", "bun", "bun.exe") or
  ?process.code_signature.subject_name : ("AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or
  (
    process.executable : ("?:\\Users\\*.exe", "?:\\ProgramData\\*.exe", "/Users/Shared/*", "/Library/WebServer/*",
                          "/Users/*/Library/WebServer/*", "/Library/Graphics/*", "/Users/*/Library/Graphics/*", "/Library/Fonts/*",
                          "/Users/*/Library/Fonts/*", "/private/var/root/Library/HTTPStorages/*", "/tmp/*", "/var/tmp/*", "/private/tmp/*") and
    (?process.code_signature.trusted == false or ?process.code_signature.exists == false)
  )
 ) and
    dns.question.name : (
    "api.openai.com",
    "*.openai.azure.com",
    "api.anthropic.com",
    "api.mistral.ai",
    "api.cohere.ai",
    "api.ai21.com",
    "api.groq.com",
    "api.perplexity.ai",
    "api.x.ai",
    "api.deepseek.com",
    "api.gemini.google.com",
    "generativelanguage.googleapis.com",
    "api.azure.com",
    "api.bedrock.aws",
    "bedrock-runtime.*.amazonaws.com",
    "api-inference.huggingface.co",
    "inference-endpoint.huggingface.cloud",
    "router.huggingface.co",
    "*.hf.space",
    "*.replicate.com",
    "api.replicate.com",
    "api.runpod.ai",
    "*.runpod.io",
    "api.modal.com",
    "*.forefront.ai",
    "api.arcee.ai",
    "api.sambanova.ai",
    "chatapi.akash.network",
    "api.reka.ai",
    "api.cerebras.ai",
    "api.morphllm.com",
    "openrouter.ai",
    "api.moonshot.cn",
    "api.moonshot.ai",
    "api.z.ai",
    "api.inference.wandb.ai",
    "trace.wandb.ai",
    "api.bfl.ai",
    "api.eu.bfl.ai",
    "api.us.bfl.ai",
    "api.ionstream.ai",
    "api.minimax.io",
    "api.minimaxi.com",
    "api.stepfun.ai",
    "api.stepfun.com",
    "api.featherless.ai",
    "api.intelligence.io.solutions",
    "api.fireworks.ai",
    "inference.baseten.co",
    "api.baseten.co",
    "api.gmi-serving.com",
    "api.ncompass.tech",
    "api.nextbit256.com",
    "api.hyperbolic.xyz",
    "neuro.mancer.tech",
    "managed-inference-api-proxy.crusoecloud.com",
    "api.crusoe.ai",
    "api.avian.io",
    "api.siliconflow.cn",
    "api.totalgpt.ai",
    "switchpoint.dev",
    "api.novita.ai",
    "api.inflection.ai",
    "api.wavespeed.ai",
    "api.cloud.mara.com",
    "api.inference.net",
    "api.deepinfra.com",
    "api.xiaomimimo.com",
    "dashscope.aliyuncs.com",
    "dashscope-intl.aliyuncs.com",
    "dashscope-us.aliyuncs.com",
    "integrate.api.nvidia.com",
    "api.inceptionlabs.ai",
    "api.friendli.ai",
    "external.api.recraft.ai",
    "api.cloudflare.com",
    "gateway.ai.cloudflare.com",
    "api.studio.nebius.ai",
    "api.tokenfactory.nebius.com",
    "api.aionlabs.ai",
    "api.relace.run",
    "instantapply.endpoint.relace.run",
    "ranker.endpoint.relace.run",
    "embeddings.endpoint.relace.run",
    "console-api.inference.ai",
    "api.parasail.io",
    "api.redpill.ai",
    "api.modular.com",
    "ark.cn-beijing.volces.com",
    "ark.ap-southeast.bytepluses.com",
    "ai2endpoints.cirrascale.ai",
    "aisuite.cirrascale.com",
    "api.clarifai.com",
    "api.venice.ai",
    "api.atlascloud.ai",
    "wanqing.streamlakeapi.com",
    "api.ambient.xyz",
    "api.upstage.ai",
    "api.together.xyz",
    "api.inceptron.io",
    "chutes.ai",
    "aiplatform.googleapis.com",
    "portal.nousresearch.com",
    "inference-api.nousresearch.com",
    "api.githubcopilot.com",
    "ai-gateway.vercel.sh",
    "opencode.ai",
    "api.kilo.ai",
    "qianfan.baidubce.com",
    "hunyuan.tencentcloudapi.com",
    "open.bigmodel.cn",
    "spark-api-open.xf-yun.com",
    "api.sensenova.cn",
    "api.baichuan-ai.com",
    "api-inference.modelscope.cn",
    "api.lingyiwanwu.com",
    "api.360.cn",
    "chat.openai.com",
    "chatgpt.com",
    "copilot.microsoft.com",
    "bard.google.com",
    "gemini.google.com",
    "claude.ai",
    "perplexity.ai",
    "poe.com",
    "chat.forefront.ai",
    "chat.deepseek.com",
    "openclaw.ai"
  ) and
  not process.executable : (
          "?:\\Program Files\\*.exe",
          "?:\\Program Files (x86)\\*.exe",
          "?:\\Windows\\System32\\svchost.exe",
          "?:\\Windows\\SystemApps\\Microsoft.LockApp_*\\LockApp.exe",
          "?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
          "?:\\Users\\*\\AppData\\Local\\BraveSoftware\\*\\Application\\brave.exe",
          "?:\\Users\\*\\AppData\\Local\\Vivaldi\\Application\\vivaldi.exe",
          "?:\\Users\\*\\AppData\\Local\\Programs\\Opera*\\opera.exe",
          "?:\\Users\\*\\AppData\\Local\\Programs\\Fiddler\\Fiddler.exe"
        ) and
    not (?process.code_signature.trusted == true and
         ?process.code_signature.subject_name : ("Anthropic, PBC", "Google LLC", "Mozilla Corporation", "Brave Software, Inc.", "Island Technology Inc.", "Opera Norway AS",
                                                  "OpenJS Foundation", "Developer ID Application: Node.js Foundation (HX7739G8FX)"))

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqAnthropic, PBC, Google LLC, Mozilla Corporation, Brave Software, Inc., Island Technology Inc., Opera Norway AS, OpenJS Foundation, Developer ID Application: Node.js Foundation (HX7739G8FX)excludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\System32\svchost.exe, ?:\Windows\SystemApps\Microsoft.LockApp_*\LockApp.exe, ?:\Users\*\AppData\Local\Google\Chrome\Application\chrome.exe, ?:\Users\*\AppData\Local\BraveSoftware\*\Application\brave.exe, ?:\Users\*\AppData\Local\Vivaldi\Application\vivaldi.exe, ?:\Users\*\AppData\Local\Programs\Opera*\opera.exe, ?:\Users\*\AppData\Local\Programs\Fiddler\Fiddler.exeexcludes:process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dns.question.nameis_not_null
  • (no value, null check)
field:"QueryName" kind:is_not_null
dns.question.namewildcard
  • *.forefront.ai
  • *.hf.space
  • *.openai.azure.com
  • *.replicate.com
  • *.runpod.io
  • ai-gateway.vercel.sh
  • ai2endpoints.cirrascale.ai
  • aiplatform.googleapis.com
  • aisuite.cirrascale.com
  • api-inference.huggingface.co
  • api-inference.modelscope.cn
  • api.360.cn
  • api.ai21.com
  • api.aionlabs.ai
  • api.ambient.xyz
  • api.anthropic.com
  • api.arcee.ai
  • api.atlascloud.ai
  • api.avian.io
  • api.azure.com
  • api.baichuan-ai.com
  • api.baseten.co
  • api.bedrock.aws
  • api.bfl.ai
  • api.cerebras.ai
  • api.clarifai.com
  • api.cloud.mara.com
  • api.cloudflare.com
  • api.cohere.ai
  • api.crusoe.ai
  • api.deepinfra.com
  • api.deepseek.com
  • api.eu.bfl.ai
  • api.featherless.ai
  • api.fireworks.ai
  • api.friendli.ai
  • api.gemini.google.com
  • api.githubcopilot.com
  • api.gmi-serving.com
  • api.groq.com
  • +88 more values (see full rule source)
field:"QueryName" kind:wildcard
process.code_signature.existseq
  • false transforms: boolean corpus 119 (elastic 119)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.subject_namewildcard
  • AutoIt Consulting Ltd corpus 5 (elastic 5)
  • OpenJS Foundation corpus 6 (elastic 6)
  • Python Software Foundation corpus 6 (elastic 6)
field:"Signature" kind:wildcard
process.code_signature.trustedeq
  • false transforms: boolean corpus 115 (elastic 115)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • /Library/Fonts/* corpus 3 (elastic 3)
  • /Library/Graphics/* corpus 3 (elastic 3)
  • /Library/WebServer/* corpus 3 (elastic 3)
  • /Users/*/Library/Fonts/*
  • /Users/*/Library/Graphics/*
  • /Users/*/Library/WebServer/*
  • /Users/Shared/* corpus 8 (elastic 7, sigma 1)
  • /private/tmp/* corpus 8 (elastic 7, sigma 1)
  • /private/var/root/Library/HTTPStorages/*
  • /tmp/* corpus 58 (elastic 56, sigma 2)
  • /var/tmp/* corpus 56 (elastic 55, sigma 1)
  • ?:\ProgramData\*.exe corpus 9 (elastic 9)
  • ?:\Users\*.exe corpus 6 (elastic 6)
field:"Image" kind:wildcard
process.namewildcard
  • *.com
  • *.pif
  • InstallUtil.exe corpus 37 (elastic 32, splunk 5)
  • MSBuild.exe corpus 39 (elastic 36, splunk 3)
  • RegAsm.exe corpus 26 (elastic 24, splunk 2)
  • RegSvcs.exe corpus 23 (elastic 21, splunk 2)
  • Script Editor
  • bitsadmin.exe corpus 23 (elastic 21, splunk 2)
  • bun corpus 2 (elastic 2)
  • bun.exe
  • curl corpus 29 (elastic 24, splunk 5)
  • curl.exe corpus 34 (elastic 31, splunk 3)
  • deno corpus 4 (elastic 4)
  • deno.exe corpus 3 (elastic 3)
  • dllhost.exe corpus 19 (elastic 17, splunk 2)
  • java.exe corpus 2 (elastic 1, splunk 1)
  • javaw.exe corpus 9 (elastic 9)
  • mshta.exe corpus 84 (elastic 79, splunk 5)
  • msiexec.exe corpus 46 (elastic 41, splunk 5)
  • node corpus 25 (elastic 25)
  • node.exe corpus 6 (elastic 6)
  • osascript corpus 46 (elastic 46)
  • powershell.exe corpus 184 (elastic 140, splunk 44)
  • pwsh.exe corpus 77 (elastic 48, splunk 29)
  • python* corpus 71 (elastic 71)
  • regsvr32.exe corpus 73 (elastic 68, splunk 5)
  • rundll32.exe corpus 126 (elastic 100, splunk 26)
  • vbc.exe corpus 9 (elastic 8, splunk 1)
  • wscript.exe corpus 83 (elastic 82, splunk 1)
field:"process_name" kind:wildcard