Detection rules › Splunk

Potential EternalBlue via Metasploit (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Adversaries may use Valid Accounts to interact with a remote network share using Server Message Block (SMB). The adversary may then perform actions as the logged-on user. This use case detects attempts to authenticate to an SMB share using Metasploit-Framework's EternalBlue module. False positives may be generated for workstations using 16-character alphanumeric naming conventions; allowlisting specific hostnames following this naming convention is recommended for best fidelity.

MITRE ATT&CK coverage

References

Telemetry coverage

Rule body

id: '33131.58750'
title: Potential EternalBlue via Metasploit
description: Adversaries may use Valid Accounts to interact with a remote network
  share using Server Message Block (SMB). The adversary may then perform actions as
  the logged-on user. This use case detects attempts to authenticate to an SMB share
  using Metasploit-Framework's EternalBlue module. False positives may be generated
  for workstations using 16-character alphanumeric naming conventions; allowlisting
  specific hostnames following this naming convention is recommended for best fidelity.
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` ((TERM(EventCode=4625) OR
  "<EventID>4625<") OR (TERM(EventCode=4624) OR "<EventID>4624<") AND AuthenticationPackageName=NTLM
  AND LogonType=3) OR (TERM(EventCode=4776) OR "<EventID>4776<") | regex Source_Workstation="^[A-Za-z0-9]{16}$"
  | table _time, host, user, src, src_*, dest, dest_*, Source_Workstation, signature_id,
  AuthenticationPackageName, LogonType, | bin span=1s | stats values(*) as * by _time,
  host '
techniques:
- lateral-movement:remote services:smb/windows admin shares
technique_id:
- T1021.002
data_category:
- Windows event logs
references:
- https://attack.mitre.org/techniques/T1021/002/
- https://github.com/rapid7/metasploit-framework/tree/master
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/security/win_security_metasploit_authentication.yml

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` ((TERM(EventCode=4625) OR "<EventID>4625<") OR (TERM(EventCode=4624) OR "<EventID>4624<") AND AuthenticationPackageName=NTLM AND LogonType=3) OR (TERM(EventCode=4776) OR "<EventID>4776<")

Stage 2: regex

| regex Source_Workstation="^[A-Za-z0-9]{16}$"

Stage 3: table

| table _time, host, user, src, src_*, dest, dest_*, Source_Workstation, signature_id, AuthenticationPackageName, LogonType,

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
AuthenticationPackageNameeq
  • NTLM corpus 7 (sigma 5, elastic 1, splunk 1)
field:"AuthenticationPackageName" kind:eq value:"NTLM"
EventCodeeq
  • 4624 corpus 29 (splunk 13, kusto 11, chronicle 4, elastic 1)
  • 4625 corpus 15 (splunk 11, chronicle 2, kusto 2)
  • 4776 corpus 5 (splunk 5)
field:"EventID" kind:eq
LogonTypeeq
  • 3 corpus 41 (splunk 13, sigma 12, elastic 9, kusto 7)
field:"LogonType" kind:eq value:"3"
Source_Workstationregex_match
  • "^[A-Za-z0-9]{16}$"
field:"Source_Workstation" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4625<"
1"<EventID>4624<"
1"<EventID>4776<"