LoFP LoFP / legitimate applications may install services with uncommon services paths.

Techniques

Sample rules

Windows Service Created with Suspicious Service Name

Description

The following analytic detects the creation of a Windows Service with a known suspicious or malicious name using Windows Event ID 7045. It leverages logs from the wineventlog_system to identify these services installations. This activity is significant as adversaries, including those deploying Clop ransomware, often create malicious services for lateral movement, remote code execution, persistence, and execution. If confirmed malicious, this could allow attackers to maintain persistence, execute arbitrary code, and potentially escalate privileges, posing a severe threat to the environment.

Detection logic

`wineventlog_system` EventCode=7045 

| stats values(ImagePath) as process, count, min(_time) as firstTime, max(_time) as lastTime values(EventCode) as signature by Computer, ServiceName, StartType, ServiceType, UserID

| eval process_name = mvindex(split(process,"\\"),-1)

| rename Computer as dest, ServiceName as object_name, ServiceType as object_type, UserID as user_id

| lookup windows_suspicious_services service_name as object_name

| where isnotnull(tool_name)

| `security_content_ctime(firstTime)` 

| `security_content_ctime(lastTime)` 

| `windows_service_created_with_suspicious_service_name_filter`

Windows Service Created with Suspicious Service Path

Description

The following analytic detects the creation of a Windows Service with a binary path located in uncommon directories, using Windows Event ID 7045. It leverages logs from the wineventlog_system to identify services installed outside typical system directories. This activity is significant as adversaries, including those deploying Clop ransomware, often create malicious services for lateral movement, remote code execution, persistence, and execution. If confirmed malicious, this could allow attackers to maintain persistence, execute arbitrary code, and potentially escalate privileges, posing a severe threat to the environment.

Detection logic

`wineventlog_system` EventCode=7045 ImagePath = "*.exe" NOT (ImagePath IN ("*:\\Windows\\*", "*:\\Program File*", "*:\\Programdata\\*", "*%systemroot%\\*")) 
| stats count min(_time) as firstTime max(_time) as lastTime by EventCode ImagePath ServiceName ServiceType StartType Computer UserID 
| rename Computer as dest
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `windows_service_created_with_suspicious_service_path_filter`

Windows Service Created Within Public Path

Description

The following analytic detects the creation of a Windows Service with its binary path located in public directories using Windows Event ID 7045. This detection leverages logs from the wineventlog_system data source, focusing on the ImagePath field to identify services installed outside standard system directories. This activity is significant as it may indicate the installation of a malicious service, often used by adversaries for lateral movement or remote code execution. If confirmed malicious, this could allow attackers to execute arbitrary code, maintain persistence, or further compromise the system.

Detection logic

`wineventlog_system` EventCode=7045 ImagePath = "*.exe" NOT (ImagePath IN ("*:\\Windows\\*", "*:\\Program File*", "*:\\Programdata\\*", "*%systemroot%\\*")) 
| stats count min(_time) as firstTime max(_time) as lastTime by EventCode ImagePath ServiceName ServiceType StartType Computer UserID 
| rename Computer as dest 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `windows_service_created_within_public_path_filter`