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/09/18"
  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    "Noise: High",
 69    "Performance: Normal",
 70    "Profile: Aggressive",
 71    "Threat: Unauthorized AI Usage",
 72    "Rule Type: Event Correlation (EQL)",
 73    "Platform: Windows",
 74    "Platform: macOS",
 75    "Domain: GenAI",
 76]
 77timestamp_override = "event.ingested"
 78type = "eql"
 79
 80query = '''
 81network where host.os.type in ("macos", "windows") and dns.question.name != null and
 82(
 83  process.name : ("MSBuild.exe", "mshta.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "msiexec.exe", "rundll32.exe",
 84  "bitsadmin.exe", "InstallUtil.exe", "RegAsm.exe", "vbc.exe", "RegSvcs.exe", "regsvr32.exe", "dllhost.exe",
 85  "node.exe", "javaw.exe", "java.exe", "*.pif", "*.com", "python*", "osascript", "Script Editor", "curl", "curl.exe", "deno", 
 86  "deno.exe", "node", "bun", "bun.exe") or
 87
 88  ?process.code_signature.subject_name : ("AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or
 89
 90  (
 91    process.executable : ("?:\\Users\\*.exe", "?:\\ProgramData\\*.exe", "/Users/Shared/*", "/Library/WebServer/*", 
 92                          "/Users/*/Library/WebServer/*", "/Library/Graphics/*", "/Users/*/Library/Graphics/*", "/Library/Fonts/*", 
 93                          "/Users/*/Library/Fonts/*", "/private/var/root/Library/HTTPStorages/*", "/tmp/*", "/var/tmp/*", "/private/tmp/*") and
 94    (?process.code_signature.trusted == false or ?process.code_signature.exists == false)
 95  )
 96 ) and
 97    dns.question.name : (
 98    // Major LLM APIs
 99    "api.openai.com",
100    "*.openai.azure.com",
101    "api.anthropic.com",
102    "api.mistral.ai",
103    "api.cohere.ai",
104    "api.ai21.com",
105    "api.groq.com",
106    "api.perplexity.ai",
107    "api.x.ai",
108    "api.deepseek.com",
109    "api.gemini.google.com",
110    "generativelanguage.googleapis.com",
111    "api.azure.com",
112    "api.bedrock.aws",
113    "bedrock-runtime.*.amazonaws.com",
114
115    // Hugging Face & other ML infra
116    "api-inference.huggingface.co",
117    "inference-endpoint.huggingface.cloud",
118    "router.huggingface.co",
119    "*.hf.space",
120    "*.replicate.com",
121    "api.replicate.com",
122    "api.runpod.ai",
123    "*.runpod.io",
124    "api.modal.com",
125    "*.forefront.ai",
126
127    "api.arcee.ai",
128    "api.sambanova.ai",
129    "chatapi.akash.network",
130    "api.reka.ai",
131    "api.cerebras.ai",
132    "api.morphllm.com",
133    "openrouter.ai",
134    "api.moonshot.cn",
135    "api.moonshot.ai",
136    "api.z.ai",
137    "api.inference.wandb.ai",
138    "trace.wandb.ai",
139    "api.bfl.ai",
140    "api.eu.bfl.ai",
141    "api.us.bfl.ai",
142    "api.ionstream.ai",
143    "api.minimax.io",
144    "api.minimaxi.com",
145    "api.stepfun.ai",
146    "api.stepfun.com",
147    "api.featherless.ai",
148    "api.intelligence.io.solutions",
149    "api.fireworks.ai",
150    "inference.baseten.co",
151    "api.baseten.co",
152    "api.gmi-serving.com",
153    "api.ncompass.tech",
154    "api.nextbit256.com",
155    "api.hyperbolic.xyz",
156    "neuro.mancer.tech",
157    "managed-inference-api-proxy.crusoecloud.com",
158    "api.crusoe.ai",
159    "api.avian.io",
160    "api.siliconflow.cn",
161    "api.totalgpt.ai",
162    "switchpoint.dev",
163    "api.novita.ai",
164    "api.inflection.ai",
165    "api.wavespeed.ai",
166    "api.cloud.mara.com",
167    "api.inference.net",
168    "api.deepinfra.com",
169    "api.xiaomimimo.com",
170    "dashscope.aliyuncs.com",
171    "dashscope-intl.aliyuncs.com",
172    "dashscope-us.aliyuncs.com",
173    "integrate.api.nvidia.com",
174    "api.inceptionlabs.ai",
175    "api.friendli.ai",
176    "external.api.recraft.ai",
177    "api.cloudflare.com",
178    "gateway.ai.cloudflare.com",
179    "api.studio.nebius.ai",
180    "api.tokenfactory.nebius.com",
181    "api.aionlabs.ai",
182    "api.relace.run",
183    "instantapply.endpoint.relace.run",
184    "ranker.endpoint.relace.run",
185    "embeddings.endpoint.relace.run",
186    "console-api.inference.ai",
187    "api.parasail.io",
188    "api.redpill.ai",
189    "api.modular.com",
190    "ark.cn-beijing.volces.com",
191    "ark.ap-southeast.bytepluses.com",
192    "ai2endpoints.cirrascale.ai",
193    "aisuite.cirrascale.com",
194    "api.clarifai.com",
195    "api.venice.ai",
196    "api.atlascloud.ai",
197    "wanqing.streamlakeapi.com",
198    "api.ambient.xyz",
199    "api.upstage.ai",
200    "api.together.xyz",
201    "api.inceptron.io",
202    "chutes.ai",
203    "aiplatform.googleapis.com",
204    "portal.nousresearch.com",
205    "inference-api.nousresearch.com",
206    "api.githubcopilot.com",
207    "ai-gateway.vercel.sh",
208    "opencode.ai",
209    "api.kilo.ai",
210    "qianfan.baidubce.com",
211    "hunyuan.tencentcloudapi.com",
212    "open.bigmodel.cn",
213    "spark-api-open.xf-yun.com",
214    "api.sensenova.cn",
215    "api.baichuan-ai.com",
216    "api-inference.modelscope.cn",
217    "api.lingyiwanwu.com",
218    "api.360.cn",
219
220    // Consumer-facing AI chat portals
221    "chat.openai.com",
222    "chatgpt.com",
223    "copilot.microsoft.com",
224    "bard.google.com",
225    "gemini.google.com",
226    "claude.ai",
227    "perplexity.ai",
228    "poe.com",
229    "chat.forefront.ai",
230    "chat.deepseek.com",
231
232    // OpenClaw
233    "openclaw.ai"
234  ) and
235
236  not process.executable : (
237          "?:\\Program Files\\*.exe",
238          "?:\\Program Files (x86)\\*.exe",
239          "?:\\Windows\\System32\\svchost.exe",
240          "?:\\Windows\\SystemApps\\Microsoft.LockApp_*\\LockApp.exe",
241          "?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
242          "?:\\Users\\*\\AppData\\Local\\BraveSoftware\\*\\Application\\brave.exe",
243          "?:\\Users\\*\\AppData\\Local\\Vivaldi\\Application\\vivaldi.exe",
244          "?:\\Users\\*\\AppData\\Local\\Programs\\Opera*\\opera.exe",
245          "?:\\Users\\*\\AppData\\Local\\Programs\\Fiddler\\Fiddler.exe"
246        ) and
247    not (?process.code_signature.trusted == true and
248         ?process.code_signature.subject_name : ("Anthropic, PBC", "Google LLC", "Mozilla Corporation", "Brave Software, Inc.", "Island Technology Inc.", "Opera Norway AS",
249                                                  "OpenJS Foundation", "Developer ID Application: Node.js Foundation (HX7739G8FX)"))
250'''
251
252
253[[rule.threat]]
254framework = "MITRE ATT&CK"
255[[rule.threat.technique]]
256id = "T1102"
257name = "Web Service"
258reference = "https://attack.mitre.org/techniques/T1102/"
259[[rule.threat.technique.subtechnique]]
260id = "T1102.002"
261name = "Bidirectional Communication"
262reference = "https://attack.mitre.org/techniques/T1102/002/"
263
264
265
266[rule.threat.tactic]
267id = "TA0011"
268name = "Command and Control"
269reference = "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