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

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