Skip to content

Commit fcf1275

Browse files
tccontret-contreraspatel-bhavin
authored
castlerat (#3750)
* castlerat * castlerat * castlerat * castlerat --------- Co-authored-by: Teoderick Contreras <tcontreras@splunk.com> Co-authored-by: Bhavin Patel <bhavin.j.patel91@gmail.com>
1 parent 5b8befe commit fcf1275

17 files changed

Lines changed: 450 additions & 175 deletions

detections/endpoint/cisco_nvm___suspicious_network_connection_to_ip_lookup_service_api.yml

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Cisco NVM - Suspicious Network Connection to IP Lookup Service API
22
id: 568cb83e-d79e-4a23-85ec-6e1f6c30cb2f
3-
version: 3
4-
date: '2025-09-09'
3+
version: 4
4+
date: '2025-10-31'
55
author: Nasreddine Bencherchali, Splunk, Janantha Marasinghe
66
status: production
77
type: Anomaly
@@ -14,7 +14,7 @@ description: |
1414
The detection relies on Cisco Network Visibility Module (NVM) telemetry and excludes known browser
1515
processes to reduce noise.
1616
data_source:
17-
- Cisco Network Visibility Module Flow Data
17+
- Cisco Network Visibility Module Flow Data
1818
search: |
1919
`cisco_network_visibility_module_flowdata`
2020
dest_hostname IN (
@@ -64,45 +64,48 @@ known_false_positives: |
6464
Internal scripts or agents performing network checks may query IP geolocation services.
6565
Tune by excluding known tools or adding internal allowlists for destination domains or process names and commandlines.
6666
references:
67-
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/network_connection/net_connection_win_domain_external_ip_lookup.yml
68-
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa20-302a
67+
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/network_connection/net_connection_win_domain_external_ip_lookup.yml
68+
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa20-302a
6969
drilldown_searches:
70-
- name: View the detection results for - "$src$"
71-
search: '%original_detection_search% | search src = "$src$"'
72-
earliest_offset: $info_min_time$
73-
latest_offset: $info_max_time$
74-
- name: View risk events for the last 7 days for - "$src$"
75-
search:
76-
'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$src$") starthoursago=168 | stats count min(_time)
77-
as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message)
78-
as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all)
79-
as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics"
80-
by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
81-
earliest_offset: $info_min_time$
82-
latest_offset: $info_max_time$
70+
- name: View the detection results for - "$src$"
71+
search: '%original_detection_search% | search src = "$src$"'
72+
earliest_offset: $info_min_time$
73+
latest_offset: $info_max_time$
74+
- name: View risk events for the last 7 days for - "$src$"
75+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$src$")
76+
starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime
77+
values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories)
78+
as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic)
79+
as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)`
80+
| `security_content_ctime(lastTime)`'
81+
earliest_offset: $info_min_time$
82+
latest_offset: $info_max_time$
8383
rba:
84-
message: The host $src$ made a network request to IP lookup service $dest_hostname$ using suspicious process $process_path$
84+
message: The host $src$ made a network request to IP lookup service
85+
$dest_hostname$ using suspicious process $process_path$
8586
risk_objects:
86-
- field: src
87-
type: system
88-
score: 40
87+
- field: src
88+
type: system
89+
score: 40
8990
threat_objects:
90-
- field: process_name
91-
type: process_name
91+
- field: process_name
92+
type: process_name
9293
tags:
9394
analytic_story:
94-
- Cisco Network Visibility Module Analytics
95+
- Cisco Network Visibility Module Analytics
96+
- Castle RAT
9597
asset_type: Endpoint
9698
mitre_attack_id:
97-
- T1590.005
98-
- T1016
99+
- T1590.005
100+
- T1016
99101
product:
100-
- Splunk Enterprise
101-
- Splunk Enterprise Security
102+
- Splunk Enterprise
103+
- Splunk Enterprise Security
102104
security_domain: endpoint
103105
tests:
104-
- name: True Positive Test - Cisco NVM
105-
attack_data:
106-
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/cisco_network_visibility_module/cisco_nvm_flowdata/nvm_flowdata.log
107-
source: not_applicable
108-
sourcetype: cisco:nvm:flowdata
106+
- name: True Positive Test - Cisco NVM
107+
attack_data:
108+
- data:
109+
https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/cisco_network_visibility_module/cisco_nvm_flowdata/nvm_flowdata.log
110+
source: not_applicable
111+
sourcetype: cisco:nvm:flowdata

detections/endpoint/executables_or_script_creation_in_suspicious_path.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Executables Or Script Creation In Suspicious Path
22
id: a7e3f0f0-ae42-11eb-b245-acde48001122
3-
version: 19
4-
date: '2025-09-30'
3+
version: 20
4+
date: '2025-10-31'
55
author: Teoderick Contreras, Splunk
66
status: production
77
type: Anomaly
@@ -117,6 +117,7 @@ tags:
117117
- PromptLock
118118
- GhostRedirector IIS Module and Rungan Backdoor
119119
- Lokibot
120+
- Castle RAT
120121
asset_type: Endpoint
121122
mitre_attack_id:
122123
- T1036

detections/endpoint/schedule_task_with_rundll32_command_trigger.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
name: Schedule Task with Rundll32 Command Trigger
22
id: 75b00fd8-a0ff-11eb-8b31-acde48001122
3-
version: 6
4-
date: '2025-05-02'
3+
version: 7
4+
date: '2025-10-31'
55
author: Teoderick Contreras, Splunk
66
status: production
77
type: TTP
8-
description: The following analytic detects the creation of scheduled tasks in Windows
9-
that use the rundll32 command. It leverages Windows Security EventCode 4698, which
10-
logs the creation of scheduled tasks, and filters for tasks executed via rundll32.
11-
This activity is significant as it is a common technique used by malware, such as
12-
TrickBot, to persist in an environment or deliver additional payloads. If confirmed
13-
malicious, this could lead to data theft, ransomware deployment, or other damaging
14-
outcomes. Immediate investigation and mitigation are crucial to prevent further
15-
compromise.
8+
description: The following analytic detects the creation of scheduled tasks in
9+
Windows that use the rundll32 command. It leverages Windows Security EventCode
10+
4698, which logs the creation of scheduled tasks, and filters for tasks
11+
executed via rundll32. This activity is significant as it is a common
12+
technique used by malware, such as TrickBot, to persist in an environment or
13+
deliver additional payloads. If confirmed malicious, this could lead to data
14+
theft, ransomware deployment, or other damaging outcomes. Immediate
15+
investigation and mitigation are crucial to prevent further compromise.
1616
data_source:
1717
- Windows Event Log Security 4698
1818
search: '`wineventlog_security` EventCode=4698 | xmlkv Message | search Command IN
1919
("*rundll32*") | stats count min(_time) as firstTime max(_time) as lastTime by dest,
2020
Task_Name, Command, Author, Enabled, Hidden, Arguments | `security_content_ctime(firstTime)`
2121
| `security_content_ctime(lastTime)` | `schedule_task_with_rundll32_command_trigger_filter`'
22-
how_to_implement: To successfully implement this search, you need to be ingesting
23-
logs with the task schedule (Exa. Security Log EventCode 4698) endpoints. Tune and
24-
filter known instances of Task schedule used in your environment.
22+
how_to_implement: To successfully implement this search, you need to be
23+
ingesting logs with the task schedule (Exa. Security Log EventCode 4698)
24+
endpoints. Tune and filter known instances of Task schedule used in your
25+
environment.
2526
known_false_positives: unknown
2627
references:
2728
- https://labs.vipre.com/trickbot-and-its-modules/
@@ -41,8 +42,8 @@ drilldown_searches:
4142
earliest_offset: $info_min_time$
4243
latest_offset: $info_max_time$
4344
rba:
44-
message: A scheduled task process commandline rundll32 arguments $Arguments$ on
45-
host $dest$
45+
message: A scheduled task process commandline rundll32 arguments $Arguments$
46+
on host $dest$
4647
risk_objects:
4748
- field: dest
4849
type: system
@@ -56,6 +57,7 @@ tags:
5657
- Scheduled Tasks
5758
- Compromised Windows Host
5859
- Trickbot
60+
- Castle RAT
5961
asset_type: Endpoint
6062
mitre_attack_id:
6163
- T1053
Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
name: Windows Anonymous Pipe Activity
22
id: ee301e1e-cd81-4011-a911-e5f049b9e3d5
3-
version: 4
4-
date: '2025-08-07'
3+
version: 5
4+
date: '2025-10-31'
55
author: Teoderick Contreras, Splunk
66
status: production
77
type: Hunting
8-
description: "The following analytic detects the creation or connection of anonymous\
9-
\ pipes for inter-process communication (IPC) within a Windows environment. Anonymous\
10-
\ pipes are commonly used by legitimate system processes, services, and applications\
11-
\ to transfer data between related processes. However, adversaries frequently abuse\
12-
\ anonymous pipes to facilitate stealthy process injection, command-and-control\
13-
\ (C2) communication, credential theft, or privilege escalation. This detection\
14-
\ monitors for unusual anonymous pipe activity, particularly involving non-system\
15-
\ processes, unsigned executables, or unexpected parent-child process relationships.\
16-
\ While legitimate use cases exist\u2014such as Windows services, software installers,\
17-
\ or security tools\u2014unusual or high-frequency anonymous pipe activity should\
18-
\ be investigated for potential malware, persistence mechanisms, or lateral movement\
19-
\ techniques."
8+
description: "The following analytic detects the creation or connection of anonymous
9+
pipes for inter-process communication (IPC) within a Windows environment. Anonymous
10+
pipes are commonly used by legitimate system processes, services, and applications
11+
to transfer data between related processes. However, adversaries frequently abuse
12+
anonymous pipes to facilitate stealthy process injection, command-and-control (C2)
13+
communication, credential theft, or privilege escalation. This detection monitors
14+
for unusual anonymous pipe activity, particularly involving non-system processes,
15+
unsigned executables, or unexpected parent-child process relationships. While legitimate
16+
use cases exist—such as Windows services, software installers, or security tools—unusual
17+
or high-frequency anonymous pipe activity should be investigated for potential malware,
18+
persistence mechanisms, or lateral movement techniques."
2019
data_source:
2120
- Sysmon EventID 17
2221
- Sysmon EventID 18
2322
search: '`sysmon` EventCode IN (17,18) EventType IN ( "CreatePipe", "ConnectPipe")
24-
PipeName="*Anonymous Pipe*" NOT( Image IN ("*\\Program Files\\*")) | stats min(_time)
25-
as firstTime max(_time) as lastTime count by dest EventCode PipeName ProcessGuid
26-
ProcessId Image EventType | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
27-
| `windows_anonymous_pipe_activity_filter`'
28-
how_to_implement: To successfully implement this search, you need to be ingesting
29-
logs with the process name and pipename from your endpoints. If you are using Sysmon,
30-
you must have at least version 6.0.4 of the Sysmon TA. .
31-
known_false_positives: Automation tool might use anonymous pipe for task orchestration
32-
or process communication.
23+
PipeName="*Anonymous Pipe*" NOT( Image IN ("C:\\Program Files*", "C:\\Windows\\system32\\*","C:\\Windows\\syswow64\\*"))
24+
| stats min(_time) as firstTime max(_time) as lastTime count by dest EventCode
25+
PipeName ProcessGuid ProcessId Image EventType | `security_content_ctime(firstTime)`
26+
| `security_content_ctime(lastTime)` | `windows_anonymous_pipe_activity_filter`'
27+
how_to_implement: To successfully implement this search, you need to be
28+
ingesting logs with the process name and pipename from your endpoints. If you
29+
are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA. .
30+
known_false_positives: Automation tool might use anonymous pipe for task
31+
orchestration or process communication.
3332
references:
3433
- https://www.trendmicro.com/en_nl/research/24/k/earth-estries.html
3534
drilldown_searches:
@@ -52,6 +51,7 @@ tags:
5251
- China-Nexus Threat Activity
5352
- SnappyBee
5453
- Interlock Rat
54+
- Castle RAT
5555
asset_type: Endpoint
5656
mitre_attack_id:
5757
- T1559
@@ -63,6 +63,7 @@ tags:
6363
tests:
6464
- name: True Positive Test
6565
attack_data:
66-
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1559/anonymous_pipe/anonymouspipe.log
66+
- data:
67+
https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1559/anonymous_pipe/anonymouspipe.log
6768
sourcetype: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
6869
source: XmlWinEventLog
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Windows Browser Process Launched with Unusual Flags
2+
id: 841e2abc-0442-4e7f-b445-b22680632a08
3+
version: 1
4+
date: '2025-10-31'
5+
author: Teoderick Contreras, Splunk
6+
status: production
7+
type: Anomaly
8+
description: The following analytic detects the use of unusual browser flags, specifically --mute-audio and --do-not-elevate, which deviate from standard browser launch behavior. These flags may indicate automated scripts, testing environments, or attempts to modify browser functionality for silent operation or restricted privilege execution. Detection focuses on non-standard launch parameters, unexpected process behavior, or deviations from baseline configurations. Monitoring such flag usage helps identify potentially suspicious activity, misconfigurations, or policy violations, enabling security teams to investigate anomalies, ensure system compliance, and differentiate legitimate administrative or testing uses from unusual or unauthorized operations.
9+
data_source:
10+
- Sysmon EventID 1
11+
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time)
12+
as lastTime from datamodel=Endpoint.Processes
13+
where NOT (Processes.parent_process_name IN ("chrome.exe", "msedge.exe", "brave.exe", "firefox.exe", "explorer.exe")) AND
14+
NOT (Processes.parent_process_path IN("C:\\Program Files*", "C:\\Windows\\System32\\*", "C:\\Windows\\SysWow64\\*",)) AND
15+
Processes.process_name IN ("chrome.exe", "msedge.exe", "brave.exe", "firefox.exe") AND
16+
Processes.process IN ("*--mute-audio*","*--no-de-elevate*", "*--do-not-de-elevate*")
17+
by Processes.action Processes.dest Processes.original_file_name Processes.parent_process
18+
Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id
19+
Processes.parent_process_name Processes.parent_process_path Processes.process Processes.process_exec
20+
Processes.process_guid Processes.process_hash Processes.process_id Processes.process_integrity_level
21+
Processes.process_name Processes.process_path Processes.user Processes.user_id Processes.vendor_product
22+
| `drop_dm_object_name(Processes)`
23+
| `security_content_ctime(firstTime)`
24+
| `security_content_ctime(lastTime)` | `windows_browser_process_launched_with_unusual_flags_filter`'
25+
how_to_implement: The detection is based on data that originates from Endpoint Detection
26+
and Response (EDR) agents. These agents are designed to provide security-related
27+
telemetry from the endpoints where the agent is installed. To implement this search,
28+
you must ingest logs that contain the process GUID, process name, and parent process.
29+
Additionally, you must ingest complete command-line executions. These logs must
30+
be processed using the appropriate Splunk Technology Add-ons that are specific to
31+
the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint`
32+
data model. Use the Splunk Common Information Model (CIM) to normalize the field
33+
names and speed up the data modeling process.
34+
known_false_positives: It is possible false positives will be present based on third
35+
party applications. Filtering may be needed.
36+
references:
37+
- https://www.recordedfuture.com/research/from-castleloader-to-castlerat-tag-150-advances-operations
38+
- https://peter.sh/experiments/chromium-command-line-switches/
39+
drilldown_searches:
40+
- name: View the detection results for - "$dest$"
41+
search: '%original_detection_search% | search dest="$dest$"'
42+
earliest_offset: $info_min_time$
43+
latest_offset: $info_max_time$
44+
- name: View risk events for the last 7 days for - "$dest$"
45+
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$")
46+
starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime
47+
values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories)
48+
as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic)
49+
as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)`
50+
| `security_content_ctime(lastTime)`'
51+
earliest_offset: $info_min_time$
52+
latest_offset: $info_max_time$
53+
rba:
54+
message: chromium browser that has unusual flags for muting or audio and prevent de-elevation of the current process in $dest$.
55+
risk_objects:
56+
- field: dest
57+
type: system
58+
score: 15
59+
threat_objects:
60+
- field: parent_process_name
61+
type: parent_process_name
62+
tags:
63+
analytic_story:
64+
- Castle RAT
65+
asset_type: Endpoint
66+
mitre_attack_id:
67+
- T1185
68+
product:
69+
- Splunk Enterprise
70+
- Splunk Enterprise Security
71+
- Splunk Cloud
72+
security_domain: endpoint
73+
tests:
74+
- name: True Positive Test
75+
attack_data:
76+
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1185/browser_unusual_flag/castle_chrome_shell32.log
77+
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
78+
sourcetype: XmlWinEventLog

0 commit comments

Comments
 (0)