Connection to Common Large Language Model Endpoints

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.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2025/09/01"
  3integration = ["endpoint", "windows", "sentinel_one_cloud_funnel"]
  4maturity = "production"
  5updated_date = "2026/04/21"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies DNS queries to known Large Language Model domains by unsigned binaries or common Windows scripting utilities.
 11Malwares may leverage the capabilities of LLM to perform actions in the affected system in a dynamic way.
 12"""
 13from = "now-9m"
 14index = [
 15    "endgame-*",
 16    "logs-endpoint.events.network-*",
 17    "logs-sentinel_one_cloud_funnel.*",
 18    "logs-windows.sysmon_operational-*",
 19    "winlogbeat-*",
 20]
 21language = "eql"
 22license = "Elastic License v2"
 23name = "Connection to Common Large Language Model Endpoints"
 24note = """## Triage and analysis
 25
 26### Investigating Connection to Common Large Language Model Endpoints
 27
 28#### Possible investigation steps
 29
 30- Investigate the process execution chain (parent process tree) for unknown processes or malicious scripts.
 31- Verify if the executed process is persistent on the host like common mechanisms Startup folder, task or Run key.
 32- Review any unusual network, files or registry events by the same process.
 33- Investigate other alerts associated with the user/host during the past 48 hours.
 34- Extract this communication's indicators of compromise (IoCs) and use traffic logs to search for other potentially compromised hosts.
 35
 36### False positive analysis
 37
 38- Trusted applications from an expected process running in the environment.
 39
 40### Response and remediation
 41
 42- Initiate the incident response process based on the outcome of the triage.
 43- Isolate the involved host to prevent further post-compromise behavior.
 44- Immediately block the identified indicators of compromise (IoCs).
 45- Implement any temporary network rules, procedures, and segmentation required to contain the attack.
 46- 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.
 47- Update firewall rules to be more restrictive.
 48- Reimage the host operating system or restore the compromised files to clean versions.
 49- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 50- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 51- 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).
 52"""
 53references = ["https://malpedia.caad.fkie.fraunhofer.de/details/py.lamehug"]
 54risk_score = 47
 55rule_id = "4ae94fc1-f08f-419f-b692-053d28219380"
 56severity = "medium"
 57tags = [
 58    "Domain: Endpoint",
 59    "OS: Windows",
 60    "OS: macOS",
 61    "Use Case: Threat Detection",
 62    "Tactic: Command and Control",
 63    "Resources: Investigation Guide",
 64    "Data Source: Elastic Endgame",
 65    "Data Source: Elastic Defend",
 66    "Data Source: SentinelOne",
 67    "Data Source: Sysmon",
 68]
 69timestamp_override = "event.ingested"
 70type = "eql"
 71
 72query = '''
 73network where host.os.type in ("macos", "windows") and dns.question.name != null and
 74(
 75  process.name : ("MSBuild.exe", "mshta.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "msiexec.exe", "rundll32.exe",
 76  "bitsadmin.exe", "InstallUtil.exe", "RegAsm.exe", "vbc.exe", "RegSvcs.exe", "regsvr32.exe", "dllhost.exe",
 77  "node.exe", "javaw.exe", "java.exe", "*.pif", "*.com", "python*", "osascript", "Script Editor", "curl", "curl.exe", "deno", 
 78  "deno.exe", "node", "bun", "bun.exe") or
 79
 80  ?process.code_signature.subject_name : ("AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or
 81
 82  (
 83    process.executable : ("?:\\Users\\*.exe", "?:\\ProgramData\\*.exe", "/Users/Shared/*", "/Library/WebServer/*", 
 84                          "/Users/*/Library/WebServer/*", "/Library/Graphics/*", "/Users/*/Library/Graphics/*", "/Library/Fonts/*", 
 85                          "/Users/*/Library/Fonts/*", "/private/var/root/Library/HTTPStorages/*", "/tmp/*", "/var/tmp/*", "/private/tmp/*") and
 86    (?process.code_signature.trusted == false or ?process.code_signature.exists == false)
 87  )
 88 ) and
 89    dns.question.name : (
 90    // Major LLM APIs
 91    "api.openai.com",
 92    "*.openai.azure.com",
 93    "api.anthropic.com",
 94    "api.mistral.ai",
 95    "api.cohere.ai",
 96    "api.ai21.com",
 97    "api.groq.com",
 98    "api.perplexity.ai",
 99    "api.x.ai",
100    "api.deepseek.com",
101    "api.gemini.google.com",
102    "generativelanguage.googleapis.com",
103    "api.azure.com",
104    "api.bedrock.aws",
105    "bedrock-runtime.*.amazonaws.com",
106
107    // Hugging Face & other ML infra
108    "api-inference.huggingface.co",
109    "inference-endpoint.huggingface.cloud",
110    "router.huggingface.co",
111    "*.hf.space",
112    "*.replicate.com",
113    "api.replicate.com",
114    "api.runpod.ai",
115    "*.runpod.io",
116    "api.modal.com",
117    "*.forefront.ai",
118
119    "api.arcee.ai",
120    "api.sambanova.ai",
121    "chatapi.akash.network",
122    "api.reka.ai",
123    "api.cerebras.ai",
124    "api.morphllm.com",
125    "openrouter.ai",
126    "api.moonshot.cn",
127    "api.moonshot.ai",
128    "api.z.ai",
129    "api.inference.wandb.ai",
130    "trace.wandb.ai",
131    "api.bfl.ai",
132    "api.eu.bfl.ai",
133    "api.us.bfl.ai",
134    "api.ionstream.ai",
135    "api.minimax.io",
136    "api.minimaxi.com",
137    "api.stepfun.ai",
138    "api.stepfun.com",
139    "api.featherless.ai",
140    "api.intelligence.io.solutions",
141    "api.fireworks.ai",
142    "inference.baseten.co",
143    "api.baseten.co",
144    "api.gmi-serving.com",
145    "api.ncompass.tech",
146    "api.nextbit256.com",
147    "api.hyperbolic.xyz",
148    "neuro.mancer.tech",
149    "managed-inference-api-proxy.crusoecloud.com",
150    "api.crusoe.ai",
151    "api.avian.io",
152    "api.siliconflow.cn",
153    "api.totalgpt.ai",
154    "switchpoint.dev",
155    "api.novita.ai",
156    "api.inflection.ai",
157    "api.wavespeed.ai",
158    "api.cloud.mara.com",
159    "api.inference.net",
160    "api.deepinfra.com",
161    "api.xiaomimimo.com",
162    "dashscope.aliyuncs.com",
163    "dashscope-intl.aliyuncs.com",
164    "dashscope-us.aliyuncs.com",
165    "integrate.api.nvidia.com",
166    "api.inceptionlabs.ai",
167    "api.friendli.ai",
168    "external.api.recraft.ai",
169    "api.cloudflare.com",
170    "gateway.ai.cloudflare.com",
171    "api.studio.nebius.ai",
172    "api.tokenfactory.nebius.com",
173    "api.aionlabs.ai",
174    "api.relace.run",
175    "instantapply.endpoint.relace.run",
176    "ranker.endpoint.relace.run",
177    "embeddings.endpoint.relace.run",
178    "console-api.inference.ai",
179    "api.parasail.io",
180    "api.redpill.ai",
181    "api.modular.com",
182    "ark.cn-beijing.volces.com",
183    "ark.ap-southeast.bytepluses.com",
184    "ai2endpoints.cirrascale.ai",
185    "aisuite.cirrascale.com",
186    "api.clarifai.com",
187    "api.venice.ai",
188    "api.atlascloud.ai",
189    "wanqing.streamlakeapi.com",
190    "api.ambient.xyz",
191    "api.upstage.ai",
192    "api.together.xyz",
193    "api.inceptron.io",
194    "chutes.ai",
195    "aiplatform.googleapis.com",
196    "portal.nousresearch.com",
197    "inference-api.nousresearch.com",
198    "api.githubcopilot.com",
199    "ai-gateway.vercel.sh",
200    "opencode.ai",
201    "api.kilo.ai",
202    "qianfan.baidubce.com",
203    "hunyuan.tencentcloudapi.com",
204    "open.bigmodel.cn",
205    "spark-api-open.xf-yun.com",
206    "api.sensenova.cn",
207    "api.baichuan-ai.com",
208    "api-inference.modelscope.cn",
209    "api.lingyiwanwu.com",
210    "api.360.cn",
211
212    // Consumer-facing AI chat portals
213    "chat.openai.com",
214    "chatgpt.com",
215    "copilot.microsoft.com",
216    "bard.google.com",
217    "gemini.google.com",
218    "claude.ai",
219    "perplexity.ai",
220    "poe.com",
221    "chat.forefront.ai",
222    "chat.deepseek.com",
223
224    // OpenClaw
225    "openclaw.ai"
226  ) and
227
228  not process.executable : (
229          "?:\\Program Files\\*.exe",
230          "?:\\Program Files (x86)\\*.exe",
231          "?:\\Windows\\System32\\svchost.exe",
232          "?:\\Windows\\SystemApps\\Microsoft.LockApp_*\\LockApp.exe",
233          "?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
234          "?:\\Users\\*\\AppData\\Local\\BraveSoftware\\*\\Application\\brave.exe",
235          "?:\\Users\\*\\AppData\\Local\\Vivaldi\\Application\\vivaldi.exe",
236          "?:\\Users\\*\\AppData\\Local\\Programs\\Opera*\\opera.exe",
237          "?:\\Users\\*\\AppData\\Local\\Programs\\Fiddler\\Fiddler.exe"
238        ) and
239    not (?process.code_signature.trusted == true and
240         ?process.code_signature.subject_name : ("Anthropic, PBC", "Google LLC", "Mozilla Corporation", "Brave Software, Inc.", "Island Technology Inc.", "Opera Norway AS",
241                                                  "OpenJS Foundation", "Developer ID Application: Node.js Foundation (HX7739G8FX)"))
242'''
243
244
245[[rule.threat]]
246framework = "MITRE ATT&CK"
247[[rule.threat.technique]]
248id = "T1102"
249name = "Web Service"
250reference = "https://attack.mitre.org/techniques/T1102/"
251[[rule.threat.technique.subtechnique]]
252id = "T1102.002"
253name = "Bidirectional Communication"
254reference = "https://attack.mitre.org/techniques/T1102/002/"
255
256
257
258[rule.threat.tactic]
259id = "TA0011"
260name = "Command and Control"
261reference = "https://attack.mitre.org/tactics/TA0011/"

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

Related rules

to-top