Detection rules › YARA-L
GCTI Remote Access Tools
Alert process and file create events that are associated with hashes from the GCTI Remote Access Tool list
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Command & Control | T1219 Remote Access Tools |
Event coverage
| Provider | Event | Title |
|---|---|---|
| Sysmon | Event ID 1 | Process creation |
| Sysmon | Event ID 7 | Image loaded |
| Sysmon | Event ID 11 | FileCreate |
| Sysmon | Event ID 17 | PipeEvent (Pipe Created) |
| Sysmon | Event ID 18 | PipeEvent (Pipe Connected) |
| Security-Auditing | Event ID 4688 | A new process has been created. |
Rule body yaral
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
rule gcti_remote_access_tools {
meta:
author = "Google Cloud Security"
description = "Alert process and file create events that are associated with hashes from the GCTI Remote Access Tool list"
rule_id = "mr_d838d64d-4a6f-4999-a895-0b5771d02aa6"
rule_name = "GCTI Remote Access Tools"
tactic = "TA0011"
technique = "T1219"
type = "alert"
tags = "rat"
data_source = "crowdstrike, microsoft sysmon, microsoft defender atp"
severity = "High"
priority = "High"
events:
// find a process launch event
($process.metadata.event_type = "PROCESS_LAUNCH" or $process.metadata.event_type = "PROCESS_MODULE_LOAD" or $process.metadata.event_type = "PROCESS_UNCATEGORIZED" or $process.metadata.event_type = "FILE_CREATION")
$process.target.process.file.sha256 != ""
$process.target.process.file.sha256 = $rat_hash
$process.principal.hostname = $hostname
// join graph and event hashes
$gcti.graph.entity.file.sha256 = $rat_hash
// look for files identified as likely remote access tools
$gcti.graph.metadata.entity_type = "FILE"
$gcti.graph.metadata.vendor_name = "Google Cloud Threat Intelligence"
$gcti.graph.metadata.product_name = "GCTI Feed"
$gcti.graph.metadata.source_type = "GLOBAL_CONTEXT"
$gcti.graph.metadata.threat.threat_feed_name = "Remote Access Tools"
match:
$hostname over 5m
outcome:
$risk_score = 65
$event_count = count_distinct($process.metadata.id)
// added to populate alert graph with additional context
// Commented out principal.hostname because it is already represented in graph as match variable. If match changes, can uncomment to add to results
//$principal_hostname = array_distinct($process.principal.hostname)
$principal_process_pid = array_distinct($process.principal.process.pid)
$principal_process_command_line = array_distinct($process.principal.process.command_line)
$principal_process_file_sha256 = array_distinct($process.principal.process.file.sha256)
$principal_process_file_full_path = array_distinct($process.principal.process.file.full_path)
$principal_process_product_specific_process_id = array_distinct($process.principal.process.product_specific_process_id)
$principal_process_parent_process_product_specific_process_id = array_distinct($process.principal.process.parent_process.product_specific_process_id)
$target_process_pid = array_distinct($process.target.process.pid)
$target_process_command_line = array_distinct($process.target.process.command_line)
$target_process_file_sha256 = array_distinct($process.target.process.file.sha256)
$target_process_file_full_path = array_distinct($process.target.process.file.full_path)
$target_process_product_specific_process_id = array_distinct($process.target.process.product_specific_process_id)
$target_process_parent_process_product_specific_process_id = array_distinct($process.target.process.parent_process.product_specific_process_id)
$target_file_full_path = array_distinct($process.target.file.full_path)
$principal_user_userid = array_distinct($process.principal.user.userid)
$target_resource_name = array_distinct($process.target.resource.name)
condition:
$process and $gcti
}
Detection logic
Fires when at least one $process event in the 5m window and $gcti matches entity context.
Events
$gcti
graph.metadata.entity_type = "FILE"graph.metadata.vendor_name = "Google Cloud Threat Intelligence"graph.metadata.product_name = "GCTI Feed"graph.metadata.source_type = "GLOBAL_CONTEXT"graph.metadata.threat.threat_feed_name = "Remote Access Tools"
$process
target.process.file.sha256 is not null
Correlation
Outcome
Fields the detection emits on a match. $risk_score drives alerting; Chronicle surfaces the rest on the detection.
| Field | Expression |
|---|---|
risk_score | 65 |
event_count | count_distinct($process.metadata.id) |
principal_process_pid | array_distinct($process.principal.process.pid) |
principal_process_command_line | array_distinct($process.principal.process.command_line) |
principal_process_file_sha256 | array_distinct($process.principal.process.file.sha256) |
principal_process_file_full_path | array_distinct($process.principal.process.file.full_path) |
principal_process_product_specific_process_id | array_distinct($process.principal.process.product_specific_process_id) |
principal_process_parent_process_product_specific_process_id | array_distinct($process.principal.process.parent_process.product_specific_process_id) |
target_process_pid | array_distinct($process.target.process.pid) |
target_process_command_line | array_distinct($process.target.process.command_line) |
target_process_file_sha256 | array_distinct($process.target.process.file.sha256) |
target_process_file_full_path | array_distinct($process.target.process.file.full_path) |
target_process_product_specific_process_id | array_distinct($process.target.process.product_specific_process_id) |
target_process_parent_process_product_specific_process_id | array_distinct($process.target.process.parent_process.product_specific_process_id) |
target_file_full_path | array_distinct($process.target.file.full_path) |
principal_user_userid | array_distinct($process.principal.user.userid) |
target_resource_name | array_distinct($process.target.resource.name) |