Detection of Malware C2 Domains in Syslog Events
Id | dffd068f-fdab-440e-bbc0-34c14b623c89 |
Rulename | Detection of Malware C2 Domains in Syslog Events |
Description | Identifies a match in Syslog from Recorded Future C2 DNS Name Domains Risklist. |
Severity | Medium |
Tactics | CommandAndControl |
Techniques | T1071.004 |
Required data connectors | Syslog SyslogAma |
Kind | Scheduled |
Query frequency | 1h |
Query period | 1d |
Trigger threshold | 0 |
Trigger operator | gt |
Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Recorded Future/Analytic Rules/RecordedFutureDomainMalwareC2inSyslogEvents.yaml |
Version | 1.0.3 |
Arm template | dffd068f-fdab-440e-bbc0-34c14b623c89.json |
// Identifies a match in Syslog from the Recorded Future DOMAIN Malware C2 DNS Name
let dt_lookBack = 1h;
let ioc_lookBack = 1d;
//Create a list of TLDs in our threat feed for later validation
let list_tlds = ThreatIntelligenceIndicator
| where TimeGenerated > ago(ioc_lookBack)
// Picking up only Recorded Future IOC's that are pertinent to the use case (Malware C2 Detection)
| where Description == 'Recorded Future - Domains - Command and Control Activity'
| where isnotempty(DomainName)
| extend parts = split(DomainName, '.')
| extend tld = parts[(array_length(parts)-1)]
| summarize count() by tostring(tld)
| summarize make_list(tld);
ThreatIntelligenceIndicator
| where TimeGenerated >= ago(ioc_lookBack) and ExpirationDateTime > now()
| where Active == true
// Picking up only Recorded Future IOC's that are pertinent to the use case (Malware C2 Detection)
| where Description == 'Recorded Future - Domains - Command and Control Activity'
// Picking up only IOC's that contain the entities we want
| where isnotempty(DomainName)
| join (
Syslog
| where TimeGenerated > ago(dt_lookBack)
//Extract domain patterns from syslog message
| extend domain = extract("(([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,})",1, tolower(SyslogMessage))
| where isnotempty(domain)
| extend parts = split(domain, '.')
//Split out the TLD
| extend tld = parts[(array_length(parts)-1)]
//Validate parsed domain by checking if the TLD is in the list of TLDs in our threat feed
| where tld in~ (list_tlds)
| extend Syslog_TimeGenerated = TimeGenerated
)
on $left.DomainName==$right.domain
| where Syslog_TimeGenerated >= TimeGenerated and Syslog_TimeGenerated < ExpirationDateTime
| summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by IndicatorId
| project LatestIndicatorTime, Description, ActivityGroupNames, IndicatorId, ThreatType, ExpirationDateTime, ConfidenceScore, Syslog_TimeGenerated, SyslogMessage, Computer, ProcessName, domain, HostIP, Url
| extend timestamp = Syslog_TimeGenerated, HostCustomEntity = Computer, IPCustomEntity = HostIP, URLCustomEntity = Url
relevantTechniques:
- T1071.004
name: Detection of Malware C2 Domains in Syslog Events
requiredDataConnectors:
- dataTypes:
- Syslog
connectorId: Syslog
- dataTypes:
- Syslog
connectorId: SyslogAma
entityMappings:
- fieldMappings:
- identifier: FullName
columnName: HostCustomEntity
entityType: Host
- fieldMappings:
- identifier: Address
columnName: IPCustomEntity
entityType: IP
- fieldMappings:
- identifier: Url
columnName: URLCustomEntity
entityType: URL
- fieldMappings:
- identifier: DomainName
columnName: domain
entityType: DNS
triggerThreshold: 0
id: dffd068f-fdab-440e-bbc0-34c14b623c89
tactics:
- CommandAndControl
version: 1.0.3
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Recorded Future/Analytic Rules/RecordedFutureDomainMalwareC2inSyslogEvents.yaml
queryPeriod: 1d
kind: Scheduled
queryFrequency: 1h
severity: Medium
status: Available
description: |
'Identifies a match in Syslog from Recorded Future C2 DNS Name Domains Risklist.'
query: |
// Identifies a match in Syslog from the Recorded Future DOMAIN Malware C2 DNS Name
let dt_lookBack = 1h;
let ioc_lookBack = 1d;
//Create a list of TLDs in our threat feed for later validation
let list_tlds = ThreatIntelligenceIndicator
| where TimeGenerated > ago(ioc_lookBack)
// Picking up only Recorded Future IOC's that are pertinent to the use case (Malware C2 Detection)
| where Description == 'Recorded Future - Domains - Command and Control Activity'
| where isnotempty(DomainName)
| extend parts = split(DomainName, '.')
| extend tld = parts[(array_length(parts)-1)]
| summarize count() by tostring(tld)
| summarize make_list(tld);
ThreatIntelligenceIndicator
| where TimeGenerated >= ago(ioc_lookBack) and ExpirationDateTime > now()
| where Active == true
// Picking up only Recorded Future IOC's that are pertinent to the use case (Malware C2 Detection)
| where Description == 'Recorded Future - Domains - Command and Control Activity'
// Picking up only IOC's that contain the entities we want
| where isnotempty(DomainName)
| join (
Syslog
| where TimeGenerated > ago(dt_lookBack)
//Extract domain patterns from syslog message
| extend domain = extract("(([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,})",1, tolower(SyslogMessage))
| where isnotempty(domain)
| extend parts = split(domain, '.')
//Split out the TLD
| extend tld = parts[(array_length(parts)-1)]
//Validate parsed domain by checking if the TLD is in the list of TLDs in our threat feed
| where tld in~ (list_tlds)
| extend Syslog_TimeGenerated = TimeGenerated
)
on $left.DomainName==$right.domain
| where Syslog_TimeGenerated >= TimeGenerated and Syslog_TimeGenerated < ExpirationDateTime
| summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by IndicatorId
| project LatestIndicatorTime, Description, ActivityGroupNames, IndicatorId, ThreatType, ExpirationDateTime, ConfidenceScore, Syslog_TimeGenerated, SyslogMessage, Computer, ProcessName, domain, HostIP, Url
| extend timestamp = Syslog_TimeGenerated, HostCustomEntity = Computer, IPCustomEntity = HostIP, URLCustomEntity = Url
triggerOperator: gt
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"apiVersion": "2024-01-01-preview",
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/dffd068f-fdab-440e-bbc0-34c14b623c89')]",
"kind": "Scheduled",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/dffd068f-fdab-440e-bbc0-34c14b623c89')]",
"properties": {
"alertRuleTemplateName": "dffd068f-fdab-440e-bbc0-34c14b623c89",
"customDetails": null,
"description": "'Identifies a match in Syslog from Recorded Future C2 DNS Name Domains Risklist.'\n",
"displayName": "Detection of Malware C2 Domains in Syslog Events",
"enabled": true,
"entityMappings": [
{
"entityType": "Host",
"fieldMappings": [
{
"columnName": "HostCustomEntity",
"identifier": "FullName"
}
]
},
{
"entityType": "IP",
"fieldMappings": [
{
"columnName": "IPCustomEntity",
"identifier": "Address"
}
]
},
{
"entityType": "URL",
"fieldMappings": [
{
"columnName": "URLCustomEntity",
"identifier": "Url"
}
]
},
{
"entityType": "DNS",
"fieldMappings": [
{
"columnName": "domain",
"identifier": "DomainName"
}
]
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Recorded Future/Analytic Rules/RecordedFutureDomainMalwareC2inSyslogEvents.yaml",
"query": "// Identifies a match in Syslog from the Recorded Future DOMAIN Malware C2 DNS Name \nlet dt_lookBack = 1h;\nlet ioc_lookBack = 1d;\n//Create a list of TLDs in our threat feed for later validation\nlet list_tlds = ThreatIntelligenceIndicator\n| where TimeGenerated > ago(ioc_lookBack)\n// Picking up only Recorded Future IOC's that are pertinent to the use case (Malware C2 Detection)\n| where Description == 'Recorded Future - Domains - Command and Control Activity'\n| where isnotempty(DomainName)\n| extend parts = split(DomainName, '.')\n| extend tld = parts[(array_length(parts)-1)]\n| summarize count() by tostring(tld)\n| summarize make_list(tld);\nThreatIntelligenceIndicator\n| where TimeGenerated >= ago(ioc_lookBack) and ExpirationDateTime > now()\n| where Active == true\n// Picking up only Recorded Future IOC's that are pertinent to the use case (Malware C2 Detection)\n| where Description == 'Recorded Future - Domains - Command and Control Activity'\n// Picking up only IOC's that contain the entities we want\n| where isnotempty(DomainName)\n| join (\n Syslog\n | where TimeGenerated > ago(dt_lookBack)\n //Extract domain patterns from syslog message\n | extend domain = extract(\"(([a-z0-9]+(-[a-z0-9]+)*\\\\.)+[a-z]{2,})\",1, tolower(SyslogMessage))\n | where isnotempty(domain)\n | extend parts = split(domain, '.')\n //Split out the TLD\n | extend tld = parts[(array_length(parts)-1)]\n //Validate parsed domain by checking if the TLD is in the list of TLDs in our threat feed\n | where tld in~ (list_tlds)\n | extend Syslog_TimeGenerated = TimeGenerated\n ) \non $left.DomainName==$right.domain\n| where Syslog_TimeGenerated >= TimeGenerated and Syslog_TimeGenerated < ExpirationDateTime\n| summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by IndicatorId\n| project LatestIndicatorTime, Description, ActivityGroupNames, IndicatorId, ThreatType, ExpirationDateTime, ConfidenceScore, Syslog_TimeGenerated, SyslogMessage, Computer, ProcessName, domain, HostIP, Url\n| extend timestamp = Syslog_TimeGenerated, HostCustomEntity = Computer, IPCustomEntity = HostIP, URLCustomEntity = Url\n",
"queryFrequency": "PT1H",
"queryPeriod": "P1D",
"severity": "Medium",
"status": "Available",
"subTechniques": [
"T1071.004"
],
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"CommandAndControl"
],
"techniques": [
"T1071"
],
"templateVersion": "1.0.3",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0
},
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
}
]
}