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 = "2025/09/01"
  6
  7
  8[rule]
  9author = ["Elastic"]
 10description = """
 11Identifies DNS queries to known Large Language Model domains by unsigned binaries or common Windows scripting utilities.
 12Malwares may leverage the capabilities of LLM to perform actions in the affected system in a dynamic way.
 13"""
 14from = "now-9m"
 15index = [
 16    "endgame-*",
 17    "logs-endpoint.events.network-*",
 18    "logs-sentinel_one_cloud_funnel.*",
 19    "logs-windows.sysmon_operational-*",
 20    "winlogbeat-*"
 21]
 22language = "eql"
 23license = "Elastic License v2"
 24name = "Connection to Common Large Language Model Endpoints"
 25note = """## Triage and analysis
 26
 27### Investigating Connection to Common Large Language Model Endpoints
 28
 29#### Possible investigation steps
 30
 31- Investigate the process execution chain (parent process tree) for unknown processes or malicious scripts.
 32- Verify if the executed process is persistent on the host like common mechanisms Startup folder, task or Run key.
 33- Review any unusual network, files or registry events by the same process.
 34- Investigate other alerts associated with the user/host during the past 48 hours.
 35- Extract this communication's indicators of compromise (IoCs) and use traffic logs to search for other potentially compromised hosts.
 36
 37### False positive analysis
 38
 39- Trusted applications from an expected process running in the environment.
 40
 41### Response and remediation
 42
 43- Initiate the incident response process based on the outcome of the triage.
 44- Isolate the involved host to prevent further post-compromise behavior.
 45- Immediately block the identified indicators of compromise (IoCs).
 46- Implement any temporary network rules, procedures, and segmentation required to contain the attack.
 47- 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.
 48- Update firewall rules to be more restrictive.
 49- Reimage the host operating system or restore the compromised files to clean versions.
 50- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 51- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 52- 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).
 53"""
 54references = ["https://malpedia.caad.fkie.fraunhofer.de/details/py.lamehug"]
 55risk_score = 47
 56rule_id = "4ae94fc1-f08f-419f-b692-053d28219380"
 57severity = "medium"
 58tags = [
 59    "Domain: Endpoint",
 60    "OS: Windows",
 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 == "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", "python.exe", "regsvr32.exe", "dllhost.exe",
 77  "node.exe", "javaw.exe", "java.exe", "*.pif", "*.com") or
 78
 79  ?process.code_signature.subject_name : ("AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or
 80
 81  (process.executable : ("?:\\Users\\*.exe", "", "?:\\ProgramData\\*.exe") and ?process.code_signature.trusted != true)
 82 ) and
 83    dns.question.name : (
 84    // Major LLM APIs
 85    "api.openai.com",
 86    "*.openai.azure.com",
 87    "api.anthropic.com",
 88    "api.mistral.ai",
 89    "api.cohere.ai",
 90    "api.ai21.com",
 91    "api.groq.com",
 92    "api.perplexity.ai",
 93    "api.x.ai",
 94    "api.deepseek.com",
 95    "api.gemini.google.com",
 96    "generativelanguage.googleapis.com",
 97    "api.azure.com",
 98    "api.bedrock.aws",
 99    "bedrock-runtime.amazonaws.com",
100
101    // Hugging Face & other ML infra
102    "api-inference.huggingface.co",
103    "inference-endpoint.huggingface.cloud",
104    "*.hf.space",
105    "*.replicate.com",
106    "api.replicate.com",
107    "api.runpod.ai",
108    "*.runpod.io",
109    "api.modal.com",
110    "*.forefront.ai",
111
112    // Consumer-facing AI chat portals
113    "chat.openai.com",
114    "chatgpt.com",
115    "copilot.microsoft.com",
116    "bard.google.com",
117    "gemini.google.com",
118    "claude.ai",
119    "perplexity.ai",
120    "poe.com",
121    "chat.forefront.ai",
122    "chat.deepseek.com"
123  ) and
124
125  not process.executable : (
126          "?:\\Program Files\\*.exe",
127          "?:\\Program Files (x86)\\*.exe",
128          "?:\\Windows\\System32\\svchost.exe",
129          "?:\\Windows\\SystemApps\\Microsoft.LockApp_*\\LockApp.exe",
130          "?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
131          "?:\\Users\\*\\AppData\\Local\\BraveSoftware\\*\\Application\\brave.exe",
132          "?:\\Users\\*\\AppData\\Local\\Vivaldi\\Application\\vivaldi.exe",
133          "?:\\Users\\*\\AppData\\Local\\Programs\\Opera*\\opera.exe",
134          "?:\\Users\\*\\AppData\\Local\\Programs\\Fiddler\\Fiddler.exe"
135        ) and
136    not (?process.code_signature.trusted == true and
137         ?process.code_signature.subject_name : ("Anthropic, PBC", "Google LLC", "Mozilla Corporation", "Brave Software, Inc.", "Island Technology Inc.", "Opera Norway AS"))
138'''
139
140
141[[rule.threat]]
142framework = "MITRE ATT&CK"
143[[rule.threat.technique]]
144id = "T1102"
145name = "Web Service"
146reference = "https://attack.mitre.org/techniques/T1102/"
147
148
149
150[rule.threat.tactic]
151id = "TA0011"
152name = "Command and Control"
153reference = "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