win_susp_or_malicious_service_created
Description
This detection rule identifies the creation of a Windows service with a suspicious or known malicious name, as logged by Windows Event ID 7045 (A service was installed in the system). Threat actors, including those associated with ransomware and other advanced persistent threats (APTs), often create services to achieve persistence, lateral movement, remote execution, or privilege escalation. Detection of such activity is critical for identifying early-stage post-compromise behavior.
Query · yara_l
events:
$suspicious_service.metadata.event_type = "SERVICE_CREATION"
$suspicious_service.metadata.product_name = "Service Control Manager"
$suspicious_service.metadata.product_event_type = "7045"
// Capture the hostname where the event occurred
$suspicious_service.principal.hostname = $hostname
$suspicious_service.target.application = $service_name
// Create a reference list named `suspicious_windows_service_names` and populate it with suspicious service names such as the list found at https://github.com/mthcht/awesome-lists/blob/main/Lists/suspicious_windows_services_names_list.csv
$service_name in %suspicious_windows_services_names
match:
$hostname, $service_name over 15m
outcome:
$risk_score = max(65)
$event_count = count_distinct($suspicious_service.metadata.id)
$principal_hostname = array_distinct($suspicious_service.principal.hostname)
$principal_user_userid = array_distinct($suspicious_service.principal.user.userid)
$principal_user_windows_sid = array_distinct($suspicious_service.principal.user.windows_sid)
condition:
$suspicious_service