Detection rule
Silence.EDA Detection
Overview
Detects Silence EmpireDNSAgent as described in the Group-IP report
- Rule id
3ceb2083-a27f-449a-be33-14ec1b7cc973- ATT&CK techniques
- T1059.001 Command and Scripting Interpreter: PowerShell, T1071.004 Application Layer Protocol: DNS, T1529 System Shutdown/Reboot, T1572 Protocol Tunneling
- Severity
- Critical
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- n0n, The Gentlemen, qilin, INC Ransom, Akira, safepay, rhysida, Play, nightspire, majinahanashi
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
1 of 1 positive test events matched; 1 of 1 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.
Detection logic and queries
Queries are shown exactly as generated. Test them in your environment before you deploy them.
Sigma
Sigma (YAML) · 3ceb2083-a27f-449a-be33-14ec1b7cc973
title: Silence.EDA Detection
id: 3ceb2083-a27f-449a-be33-14ec1b7cc973
status: test
description: Detects Silence EmpireDNSAgent as described in the Group-IP report
references:
- https://www.group-ib.com/resources/threat-research/silence_2.0.going_global.pdf
author: Alina Stepchenkova, Group-IB, oscd.community
date: 2019-11-01
modified: 2023-04-03
tags:
- attack.execution
- attack.t1059.001
- attack.command-and-control
- attack.t1071.004
- attack.t1572
- attack.impact
- attack.t1529
- attack.g0091
- attack.s0363
logsource:
product: windows
category: ps_script
definition: 'Requirements: Script Block Logging must be enabled'
detection:
empire:
# better to randomise the order
ScriptBlockText|contains|all:
- 'System.Diagnostics.Process'
- 'Stop-Computer'
- 'Restart-Computer'
- 'Exception in execution'
- '$cmdargs'
- 'Close-Dnscat2Tunnel'
dnscat:
# better to randomise the order
ScriptBlockText|contains|all:
- 'set type=$LookupType`nserver'
- '$Command | nslookup 2>&1 | Out-String'
- 'New-RandomDNSField'
- '[Convert]::ToString($SYNOptions, 16)'
- '$Session.Dead = $True'
- '$Session["Driver"] -eq'
condition: empire and dnscat
falsepositives:
- Unknown
level: criticalQRadar AQL
IBM QRadar AQL (hunting query)Hunting query
Hunting search for the Log Activity tab or the API. It is not a QRadar rule.
AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).
SELECT * FROM events WHERE devicetype=12 AND (LOWER(Message) LIKE '%system.diagnostics.process%' AND LOWER(Message) LIKE '%stop-computer%' AND LOWER(Message) LIKE '%restart-computer%' AND LOWER(Message) LIKE '%exception in execution%' AND LOWER(Message) LIKE '%$cmdargs%' AND LOWER(Message) LIKE '%close-dnscat2tunnel%') AND (LOWER(Message) LIKE '%set type=$lookuptype`nserver%' AND LOWER(Message) LIKE '%$command | nslookup 2>&1 | out-string%' AND LOWER(Message) LIKE '%new-randomdnsfield%' AND LOWER(Message) LIKE '%[convert]::tostring($synoptions, 16)%' AND LOWER(Message) LIKE '%$session.dead = $true%' AND LOWER(Message) LIKE '%$session["driver"] -eq%')QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: Silence.EDA Detection- Rule type
- Event rule (Local)
- Log source types
- Microsoft Windows Security Event Log DSM collecting Microsoft-Windows-PowerShell/Operational 4104 (Script Block Logging)
Building blocks
BB:OffSet7:Silence EDA Detection:empire(match)All test lines must match (AND).Messagecontains:System.Diagnostics.Process,Stop-Computer,Restart-Computer,Exception in execution,$cmdargs,Close-Dnscat2Tunnel
BB:OffSet7:Silence EDA Detection:dnscat(match)All test lines must match (AND).Messagecontains:set type=$LookupType`nserver,$Command | nslookup 2>&1 | Out-String,New-RandomDNSField,[Convert]::ToString($SYNOptions, 16),$Session.Dead = $True,$Session["Driver"] -eq
Main rule, option A (building blocks)
- when the event(s) were detected by one or more of these log source types:
Microsoft Windows Security Event Log DSM collecting Microsoft-Windows-PowerShell/Operational 4104 (Script Block Logging) - when an event matches the condition built from these building blocks:
BB:OffSet7:Silence EDA Detection:empire AND BB:OffSet7:Silence EDA Detection:dnscat
Main rule, option B (AQL filter test)
- when the event matches this AQL filter query:
devicetype=12 AND (LOWER(Message) LIKE '%system.diagnostics.process%' AND LOWER(Message) LIKE '%stop-computer%' AND LOWER(Message) LIKE '%restart-computer%' AND LOWER(Message) LIKE '%exception in execution%' AND LOWER(Message) LIKE '%$cmdargs%' AND LOWER(Message) LIKE '%close-dnscat2tunnel%') AND (LOWER(Message) LIKE '%set type=$lookuptype`nserver%' AND LOWER(Message) LIKE '%$command | nslookup 2>&1 | out-string%' AND LOWER(Message) LIKE '%new-randomdnsfield%' AND LOWER(Message) LIKE '%[convert]::tostring($synoptions, 16)%' AND LOWER(Message) LIKE '%$session.dead = $true%' AND LOWER(Message) LIKE '%$session["driver"] -eq%')
Rule response
- Severity 9, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)
Limitations
- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.
Splunk
Splunk SPLSearch
Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.
ScriptBlockText="*System.Diagnostics.Process*" ScriptBlockText="*Stop-Computer*" ScriptBlockText="*Restart-Computer*" ScriptBlockText="*Exception in execution*" ScriptBlockText="*$cmdargs*" ScriptBlockText="*Close-Dnscat2Tunnel*" ScriptBlockText="*set type=$LookupType`nserver*" ScriptBlockText="*$Command | nslookup 2>&1 | Out-String*" ScriptBlockText="*New-RandomDNSField*" ScriptBlockText="*[Convert]::ToString($SYNOptions, 16)*" ScriptBlockText="*$Session.Dead = $True*" ScriptBlockText="*$Session[\"Driver\"] -eq*"Splunk savedsearches.conf stanzaScheduled search template
Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.
[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now
[Silence.EDA Detection]
description = Detects Silence EmpireDNSAgent as described in the Group-IP report
search = ScriptBlockText="*System.Diagnostics.Process*" ScriptBlockText="*Stop-Computer*" ScriptBlockText="*Restart-Computer*" ScriptBlockText="*Exception in execution*" ScriptBlockText="*$cmdargs*" ScriptBlockText="*Close-Dnscat2Tunnel*" ScriptBlockText="*set type=$LookupType`nserver*" ScriptBlockText="*$Command | nslookup 2>&1 | Out-String*" ScriptBlockText="*New-RandomDNSField*" ScriptBlockText="*[Convert]::ToString($SYNOptions, 16)*" ScriptBlockText="*$Session.Dead = $True*" ScriptBlockText="*$Session[\"Driver\"] -eq*"Elastic
Elastic Lucene (ECS)Hunting query
Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.
(powershell.file.script_block_text:*System.Diagnostics.Process* AND powershell.file.script_block_text:*Stop\-Computer* AND powershell.file.script_block_text:*Restart\-Computer* AND powershell.file.script_block_text:*Exception\ in\ execution* AND powershell.file.script_block_text:*$cmdargs* AND powershell.file.script_block_text:*Close\-Dnscat2Tunnel*) AND (powershell.file.script_block_text:*set\ type\=$LookupType`nserver* AND powershell.file.script_block_text:*$Command\ \|\ nslookup\ 2\>\&1\ \|\ Out\-String* AND powershell.file.script_block_text:*New\-RandomDNSField* AND powershell.file.script_block_text:*\[Convert\]\:\:ToString\($SYNOptions,\ 16\)* AND powershell.file.script_block_text:*$Session.Dead\ \=\ $True* AND powershell.file.script_block_text:*$Session\[\"Driver\"\]\ \-eq*)Elastic EQL (ECS)Hunting query
EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.
any where (powershell.file.script_block_text:"*System.Diagnostics.Process*" and powershell.file.script_block_text:"*Stop-Computer*" and powershell.file.script_block_text:"*Restart-Computer*" and powershell.file.script_block_text:"*Exception in execution*" and powershell.file.script_block_text:"*$cmdargs*" and powershell.file.script_block_text:"*Close-Dnscat2Tunnel*") and (powershell.file.script_block_text:"*set type=$LookupType`nserver*" and powershell.file.script_block_text:"*$Command | nslookup 2>&1 | Out-String*" and powershell.file.script_block_text:"*New-RandomDNSField*" and powershell.file.script_block_text:"*[Convert]::ToString($SYNOptions, 16)*" and powershell.file.script_block_text:"*$Session.Dead = $True*" and powershell.file.script_block_text:"*$Session[\"Driver\"] -eq*")Elastic ES|QL (ECS)Hunting query
ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.
from * metadata _id, _index, _version | where powershell.file.script_block_text like "*System.Diagnostics.Process*" and powershell.file.script_block_text like "*Stop-Computer*" and powershell.file.script_block_text like "*Restart-Computer*" and powershell.file.script_block_text like "*Exception in execution*" and powershell.file.script_block_text like "*$cmdargs*" and powershell.file.script_block_text like "*Close-Dnscat2Tunnel*" and powershell.file.script_block_text like "*set type=$LookupType`nserver*" and powershell.file.script_block_text like "*$Command | nslookup 2>&1 | Out-String*" and powershell.file.script_block_text like "*New-RandomDNSField*" and powershell.file.script_block_text like "*[Convert]::ToString($SYNOptions, 16)*" and powershell.file.script_block_text like "*$Session.Dead = $True*" and powershell.file.script_block_text like "*$Session[\"Driver\"] -eq*"No working conversion: Microsoft Sentinel KQL (ASIM) (No ASIM parser/table for this log source in the stock pipeline (see native draft on the Event table where one exists).); Microsoft Defender XDR KQL (Defender XDR advanced hunting has no PowerShell script-block/module text.)
Required telemetry
- Log source
product: windows · category: ps_script · definition: Requirements: Script Block Logging must be enabled- Fields used
ScriptBlockText
False positives
- Unknown
Investigation and response
No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.
References
Author and attribution
- Author
- Alina Stepchenkova, Group-IB, oscd.community
- Source
- SigmaHQ ·
rules/windows/powershell/powershell_script/posh_ps_apt_silence_eda.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2