Detection: Windows Local LLM Framework Execution

Description

The following analytic detects execution of unauthorized local LLM frameworks (Ollama, LM Studio, GPT4All, Jan, llama.cpp, KoboldCPP, Oobabooga, NutStudio) and Python-based AI/ML libraries (HuggingFace Transformers, LangChain) on Windows endpoints by leveraging process creation events. It identifies cases where known LLM framework executables are launched or command-line arguments reference AI/ML libraries. This activity is significant as it may indicate shadow AI deployments, unauthorized model inference operations, or potential data exfiltration through local AI systems. If confirmed malicious, this could lead to unauthorized access to sensitive data, intellectual property theft, or circumvention of organizational AI governance policies.

 1
 2| tstats `security_content_summariesonly` count
 3    min(_time) as firstTime
 4    max(_time) as lastTime
 5from datamodel=Endpoint.Processes
 6where
 7    (
 8      Processes.process_name IN (
 9          "gpt4all.exe",
10          "jan.exe",
11          "kobold.exe",
12          "koboldcpp.exe",
13          "llama-run.exe",
14          "llama.cpp.exe",
15          "lmstudio.exe",
16          "nutstudio.exe",
17          "ollama.exe",
18          "oobabooga.exe",
19          "text-generation-webui.exe"
20      )
21      OR
22      Processes.original_file_name IN (
23          "ollama.exe",
24          "lmstudio.exe",
25          "gpt4all.exe",
26          "jan.exe",
27          "llama-run.exe",
28          "koboldcpp.exe",
29          "nutstudio.exe"
30      )
31      OR
32      Processes.process IN (
33          "*\\gpt4all\\*",
34          "*\\jan\\*",
35          "*\\koboldcpp\\*",
36          "*\\llama.cpp\\*",
37          "*\\lmstudio\\*",
38          "*\\nutstudio\\*",
39          "*\\ollama\\*",
40          "*\\oobabooga\\*",
41          "*huggingface*",
42          "*langchain*",
43          "*llama-run*",
44          "*transformers*"
45      )
46      OR
47      Processes.parent_process_name IN (
48          "gpt4all.exe",
49          "jan.exe",
50          "kobold.exe",
51          "koboldcpp.exe",
52          "llama-run.exe",
53          "llama.cpp.exe",
54          "lmstudio.exe",
55          "nutstudio.exe",
56          "ollama.exe",
57          "oobabooga.exe",
58          "text-generation-webui.exe"
59      )
60    )
61by Processes.action Processes.dest Processes.original_file_name Processes.parent_process
62   Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id
63   Processes.parent_process_name Processes.parent_process_path Processes.process
64   Processes.process_exec Processes.process_guid Processes.process_hash Processes.process_id
65   Processes.process_integrity_level Processes.process_name Processes.process_path Processes.user
66   Processes.user_id Processes.vendor_product
67
68| `drop_dm_object_name(Processes)`
69
70| eval Framework=case(
71    match(process_name, "(?i)ollama") OR match(process, "(?i)ollama"), "Ollama",
72    match(process_name, "(?i)lmstudio") OR match(process, "(?i)lmstudio") OR match(process, "(?i)lm-studio"), "LM Studio",
73    match(process_name, "(?i)gpt4all") OR match(process, "(?i)gpt4all"), "GPT4All",
74    match(process_name, "(?i)kobold") OR match(process, "(?i)kobold"), "KoboldCPP",
75    match(process_name, "(?i)jan") OR match(process, "(?i)jan"), "Jan AI",
76    match(process_name, "(?i)nutstudio") OR match(process, "(?i)nutstudio"), "NutStudio",
77    match(process_name, "(?i)llama") OR match(process, "(?i)llama"), "llama.cpp",
78    match(process_name, "(?i)oobabooga") OR match(process, "(?i)oobabooga") OR match(process, "(?i)text-generation-webui"), "Oobabooga",
79    match(process, "(?i)transformers") OR match(process, "(?i)huggingface"), "HuggingFace/Transformers",
80    match(process, "(?i)langchain"), "LangChain",
81    1=1, "Other"
82)
83
84| `security_content_ctime(firstTime)`
85
86| `security_content_ctime(lastTime)`
87
88| table action dest Framework original_file_name parent_process parent_process_exec
89        parent_process_guid parent_process_id parent_process_name parent_process_path
90        process process_exec process_guid process_hash process_id process_integrity_level
91        process_name process_path user user_id vendor_product
92
93| `windows_local_llm_framework_execution_filter`

Data Source

Name Platform Sourcetype Source
CrowdStrike ProcessRollup2 Other 'crowdstrike:events:sensor' 'crowdstrike'
Sysmon EventID 1 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'
Windows Event Log Security 4688 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Security'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
windows_local_llm_framework_execution_filter search *
windows_local_llm_framework_execution_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1543 Create or Modify System Process Persistence
Exploitation
Installation
DE.AE
CIS 10

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event False
This configuration file applies to all detections of type hunting.

Implementation

The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process GUID, process name, and parent process. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the Processes node of the Endpoint data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process.

Known False Positives

Legitimate development, data science, and AI/ML workflows where authorized developers, researchers, or engineers intentionally execute local LLM frameworks (Ollama, LM Studio, GPT4All, Jan, NutStudio) for model experimentation, fine-tuning, or prototyping. Python developers using HuggingFace Transformers or LangChain for legitimate AI/ML projects. Approved sandbox and lab environments where framework testing is authorized. Open-source contributors and hobbyists running frameworks for educational purposes. Third-party applications that bundle or invoke LLM frameworks as dependencies (e.g., IDE plugins, analytics tools, chatbot integrations). System administrators deploying frameworks as part of containerized services or orchestrated ML workloads. Process name keyword overlap with unrelated utilities (e.g., "llama-backup", "janimation"). Recommended tuning — baseline approved frameworks and users by role/department, exclude sanctioned dev/lab systems via the filter macro, correlate with user identity and peer group anomalies before escalating to incident response.

Associated Analytic Story

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog
Integration ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 1