Skip to content

Commit 317f784

Browse files
committed
[New] Connection to Common Large Language Model Endpoints
1 parent 2cb790a commit 317f784

File tree

1 file changed

+50
-53
lines changed

1 file changed

+50
-53
lines changed

rules/windows/command_and_control_common_llm_endpoint.toml

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,91 @@
11
[metadata]
2-
creation_date = "2025/08/28"
3-
integration = ["endpoint"]
2+
creation_date = "2025/09/01"
3+
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "crowdstrike"]
44
maturity = "production"
5-
updated_date = "2025/08/28"
5+
updated_date = "2025/09/01"
66

77

88
[rule]
99
author = ["Elastic"]
1010
description = """
11-
Adversaries may implement command and control (C2) communications that use common web services to hide their activity.
12-
This attack technique is typically targeted at an organization and uses web services common to the victim network, which
13-
allows the adversary to blend into legitimate traffic activity. These popular services are typically targeted since they
14-
have most likely been used before compromise, which helps malicious traffic blend in.
11+
Identifies DNS queries known Large Language Model domains by unsigned binaries or common Windows scripting utilities.
12+
Malwares may leverage the capabilities of LLM to perform actions in the affected system in a dynamic way.
1513
"""
1614
from = "now-9m"
17-
index = ["logs-endpoint.events.network-*"]
15+
index = [
16+
"endgame-*",
17+
"logs-endpoint.events.network-*",
18+
"logs-sentinel_one_cloud_funnel.*",
19+
"logs-crowdstrike.fdr*",
20+
"logs-windows.forwarded*",
21+
"logs-windows.sysmon_operational-*",
22+
"winlogbeat-*"
23+
]
1824
language = "eql"
1925
license = "Elastic License v2"
2026
name = "Connection to Common Large Language Model Endpoints"
2127
note = """## Triage and analysis
2228
23-
### Investigating Connection to Commonly Abused Web Services
24-
25-
Adversaries may use an existing, legitimate external Web service as a means for relaying data to/from a compromised system. Popular websites and social media acting as a mechanism for C2 may give a significant amount of cover due to the likelihood that hosts within a network are already communicating with them prior to a compromise.
26-
27-
This rule looks for processes outside known legitimate program locations communicating with a list of services that can be abused for exfiltration or command and control.
28-
29-
> **Note**:
30-
> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/current/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
31-
> This investigation guide uses the [Investigate Markdown Plugin](https://www.elastic.co/guide/en/security/current/interactive-investigation-guides.html) introduced in Elastic Stack version 8.8.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
29+
### Investigating Connection to Common Large Language Model Endpoints
3230
3331
#### Possible investigation steps
3432
35-
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
33+
- Investigate the process execution chain (parent process tree) for unknown processes or malicious scripts.
34+
- Verify if the executed process is persistent on the host like common mechanisms Startup folder, task or Run key.
35+
- Review any unusual network, files or registry events by the same process.
3636
- Investigate other alerts associated with the user/host during the past 48 hours.
37-
- $investigate_0
38-
- $investigate_1
39-
- Verify whether the digital signature exists in the executable.
40-
- Identify the operation type (upload, download, tunneling, etc.).
41-
- Examine the host for derived artifacts that indicate suspicious activities:
42-
- Analyze the process executable using a private sandboxed analysis system.
43-
- Observe and collect information about the following activities in both the sandbox and the alert subject host:
44-
- Attempts to contact external domains and addresses.
45-
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
46-
- $investigate_2
47-
- Examine the DNS cache for suspicious or anomalous entries.
48-
- $osquery_0
49-
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
50-
- Examine the host services for suspicious or anomalous entries.
51-
- $osquery_1
52-
- $osquery_2
53-
- $osquery_3
54-
- Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
37+
- Extract this communication's indicators of compromise (IoCs) and use traffic logs to search for other potentially compromised hosts.
5538
5639
### False positive analysis
5740
58-
- This rule has a high chance to produce false positives because it detects communication with legitimate services. Noisy false positives can be added as exceptions.
41+
- Trusted applications from an expected process running in the environment.
5942
6043
### Response and remediation
6144
6245
- Initiate the incident response process based on the outcome of the triage.
6346
- Isolate the involved host to prevent further post-compromise behavior.
64-
- If the triage identified malware, search the environment for additional compromised hosts.
65-
- Implement temporary network rules, procedures, and segmentation to contain the malware.
66-
- Stop suspicious processes.
67-
- Immediately block the identified indicators of compromise (IoCs).
68-
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
69-
- Remove and block malicious artifacts identified during triage.
47+
- Immediately block the identified indicators of compromise (IoCs).
48+
- Implement any temporary network rules, procedures, and segmentation required to contain the attack.
49+
- 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.
50+
- Update firewall rules to be more restrictive.
51+
- Reimage the host operating system or restore the compromised files to clean versions.
7052
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
7153
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
7254
- 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).
7355
"""
7456
references = ["https://malpedia.caad.fkie.fraunhofer.de/details/py.lamehug"]
7557
risk_score = 43
76-
rule_id = "54aa452c-a997-4f8d-b7f0-c69e56d4c05a"
58+
rule_id = "4ae94fc1-f08f-419f-b692-053d28219380"
7759
severity = "medium"
7860
tags = [
7961
"Domain: Endpoint",
8062
"OS: Windows",
8163
"Use Case: Threat Detection",
64+
"Tactic: Discovery",
8265
"Tactic: Command and Control",
8366
"Resources: Investigation Guide",
67+
"Data Source: Elastic Endgame",
8468
"Data Source: Elastic Defend",
69+
"Data Source: SentinelOne",
70+
"Data Source: Crowdstrike",
71+
"Data Source: Sysmon",
8572
]
8673
timestamp_override = "event.ingested"
8774
type = "eql"
8875

8976
query = '''
90-
network where host.os.type == "windows" and network.protocol == "dns" and
91-
process.name != null and not ?user.id in ("S-1-5-18", "S-1-5-19", "S-1-5-20") and
77+
network where host.os.type == "windows" and dns.question.name != null and
78+
(
79+
process.name : ("MSBuild.exe", "mshta.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "msiexec.exe", "rundll32.exe",
80+
"bitsadmin.exe", "InstallUtil.exe", "RegAsm.exe", "vbc.exe", "RegSvcs.exe", "python.exe", "regsvr32.exe", "dllhost.exe",
81+
"node.exe", "javaw.exe", "java.exe", "*.pif", "*.com") or
82+
83+
?process.code_signature.exists == false or ?process.code_signature.trused == false or
84+
85+
?process.code_signature.subject_name in ("AUTOIT CONSULTING LTD", "AutoIt Consulting Ltd", "OpenJS Foundation", "Python Software Foundation") or
86+
87+
?process.executable : ("?:\\Users\\*.exe", "", "?:\\ProgramData\\*.exe", "?\\Device\\HarddiskVolume?\\Users\\*.exe", "?\\Device\\HarddiskVolume?\\ProgramData\\*.exe")
88+
) and
9289
dns.question.name : (
9390
// Major LLM APIs
9491
"api.openai.com",
@@ -129,21 +126,21 @@ network where host.os.type == "windows" and network.protocol == "dns" and
129126
"poe.com",
130127
"chat.forefront.ai",
131128
"chat.deepseek.com"
132-
)
133-
/* Insert noisy false positives here */
134-
not process.executable : (
129+
) and
130+
131+
not ?process.executable : (
135132
"?:\\Program Files\\*.exe",
136133
"?:\\Program Files (x86)\\*.exe",
137-
"C:\\Windows\\System32\\svchost.exe",
134+
"?:\\Windows\\System32\\svchost.exe",
135+
"?:\\Windows\\SystemApps\\Microsoft.LockApp_*\\LockApp.exe",
138136
"?:\\Users\\*\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
139137
"?:\\Users\\*\\AppData\\Local\\BraveSoftware\\*\\Application\\brave.exe",
140-
"?:\\Windows\\SystemApps\\Microsoft.LockApp_*\\LockApp.exe",
141138
"?:\\Users\\*\\AppData\\Local\\Vivaldi\\Application\\vivaldi.exe",
142139
"?:\\Users\\*\\AppData\\Local\\Programs\\Opera*\\opera.exe",
143140
"?:\\Users\\*\\AppData\\Local\\Programs\\Fiddler\\Fiddler.exe"
144141
) and
145-
not ?process.code_signature.subject_name like ("Anthropic, PBC", "Developer ID Application: Google LLC (*)", "Google LLC",
146-
"Brave Software, Inc.", "Developer ID Application: Mozilla Corporation (*)", "Developer ID Application: Island Technology, Inc. (*)")
142+
not (?process.code_signature.trusted == true and
143+
?process.code_signature.subject_name in ("Anthropic, PBC", "Google LLC", "Mozilla Corporation", "Brave Software, Inc.", "Island Technology Inc.", "Opera Norway AS"))
147144
'''
148145

149146

0 commit comments

Comments
 (0)