Detection rules › Elastic

ImageLoad of a File dropped via SMB

Time window
5m
Sequence by
dll.path, file.path
Source
github.com/elastic/protections-artifacts

Identifies the transfer of a library via SMB followed by loading it into commonly DLL proxy execution binaries such as rundll32, regsvr32 and shared services via svchost.exe. This may indicate an attempt to remotely execute malicious code.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
Identifies the transfer of a library via SMB followed by loading it into commonly DLL proxy execution binaries such as
rundll32, regsvr32 and shared services via svchost.exe. This may indicate an attempt to remotely execute malicious code.
"""
id = "fdf66d17-0e2e-4667-a145-620bc1204c69"
license = "Elastic License v2"
name = "ImageLoad of a File dropped via SMB"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/Hunting-for-Suspicious-Windows-Libraries-for-Execution-and-Evasion",
]
version = "1.0.36"

query = '''
sequence with maxspan=5m
  [ file where event.action != "deletion" and
   /* library dropped via SMB */
   process.pid == 4 and user.id : ("S-1-5-21*", "S-1-12-*") and
   (file.extension : ("dll", "cpl", "ocx") or (file.Ext.header_bytes : "4d5a*" and not file.extension : "exe")) ] by file.path
  [ library where dll.hash.sha256 != null and not dll.code_signature.trusted == true and
    (process.name : ("rundll32.exe", "svchost.exe", "lsass.exe") or
     process.executable :
              ("?:\\WINDOWS\\system32\\PerceptionSimulation\\PerceptionSimulationService.exe",
               "?:\\Program Files*\\Windows NT\\Accessories\\wordpad.exe")) and

    /* unsigned with diverse file hashes */
    not (dll.path : "?:\\Windows\\VeeamVssSupport\\VeeamVssHook.dll" and process.executable : "?:\\Windows\\System32\\svchost.exe") and
    not dll.hash.sha256 :
             ("ca329f3db5479be602c2d456f0dafc023c5e744b1454a4215b45761371ffd857",
              "880fe8b7e7e0276ca9f010a30aad003accc1b3f12e0ac50e2f12b3774b8c2aac",
              "a28d2f62629b6926211a2f8245ce2d0ab47d64f6680e6494720e04a13ab6ee1e", 
              "ad46d50fdd0764ee0626beb9720d9b1a00266404189dd99cf18eaf1545d7b43b", 
              "f9ff91b05b5e705464d364226ba5e40b9256f4720f3f9281247c7ce19f311f12",
              "fab84acf7d285984bb61fa655c24973de89b2234b7ba002954ba315fb2b9c90c",
              "b628784e41989e5ba2f96beec98c42fc32d15fc2de03187f6c50cc6705b57166",
              "2d64b8e67e97ccd363d26a5ee3acbb9fe949d2f7f22ae6dc134645972c3f43d9",
              "5e40b53733105e98ad2914bfb2f0dda52e3b9b3c87d82bf4ff092f1bed25cd13",
              "6d859a89e80f290249b9b1a7aaea3929d999f1f15b99089f88d5e5120e23a6d8",
              "2c611395ad89e8653533e6c1b8815720f7fb4c043197e52c93d983b3e3726226",
              "ce77f9afb4942b85a0bfa1ccb41c0b599f0275e56c6ed2e9699dada6b08989d3",
              "3fbe9db285c0248d5d50e832a1c2312e3eb3490607a09cbf9962aa64b8edc3e7",
              "8ed521e3a1e15a85e8043aafef7b69873de69c388bbcbf12f42777134af32751") and
    not dll.pe.imphash : "c7606b6181f4b33c77e536a70d7b354c"
    ] by dll.path
'''

min_endpoint_version = "7.16.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[[threat.technique.subtechnique]]
id = "T1218.010"
name = "Regsvr32"
reference = "https://attack.mitre.org/techniques/T1218/010/"

[[threat.technique.subtechnique]]
id = "T1218.011"
name = "Rundll32"
reference = "https://attack.mitre.org/techniques/T1218/011/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"
[[threat.technique.subtechnique]]
id = "T1021.002"
name = "SMB/Windows Admin Shares"
reference = "https://attack.mitre.org/techniques/T1021/002/"



[threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"

[internal]
min_endpoint_version = "7.16.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by dll.path, file.path.

Stage 1: file

[ file where event.action != "deletion" and
   process.pid == 4 and user.id : ("S-1-5-21*", "S-1-12-*") and
   (file.extension : ("dll", "cpl", "ocx") or (file.Ext.header_bytes : "4d5a*" and not file.extension : "exe")) ] by file.path

Stage 2: library

[ library where dll.hash.sha256 != null and not dll.code_signature.trusted == true and
    (process.name : ("rundll32.exe", "svchost.exe", "lsass.exe") or
     process.executable :
              ("?:\\WINDOWS\\system32\\PerceptionSimulation\\PerceptionSimulationService.exe",
               "?:\\Program Files*\\Windows NT\\Accessories\\wordpad.exe")) and
    not (dll.path : "?:\\Windows\\VeeamVssSupport\\VeeamVssHook.dll" and process.executable : "?:\\Windows\\System32\\svchost.exe") and
    not dll.hash.sha256 :
             ("ca329f3db5479be602c2d456f0dafc023c5e744b1454a4215b45761371ffd857",
              "880fe8b7e7e0276ca9f010a30aad003accc1b3f12e0ac50e2f12b3774b8c2aac",
              "a28d2f62629b6926211a2f8245ce2d0ab47d64f6680e6494720e04a13ab6ee1e",
              "ad46d50fdd0764ee0626beb9720d9b1a00266404189dd99cf18eaf1545d7b43b",
              "f9ff91b05b5e705464d364226ba5e40b9256f4720f3f9281247c7ce19f311f12",
              "fab84acf7d285984bb61fa655c24973de89b2234b7ba002954ba315fb2b9c90c",
              "b628784e41989e5ba2f96beec98c42fc32d15fc2de03187f6c50cc6705b57166",
              "2d64b8e67e97ccd363d26a5ee3acbb9fe949d2f7f22ae6dc134645972c3f43d9",
              "5e40b53733105e98ad2914bfb2f0dda52e3b9b3c87d82bf4ff092f1bed25cd13",
              "6d859a89e80f290249b9b1a7aaea3929d999f1f15b99089f88d5e5120e23a6d8",
              "2c611395ad89e8653533e6c1b8815720f7fb4c043197e52c93d983b3e3726226",
              "ce77f9afb4942b85a0bfa1ccb41c0b599f0275e56c6ed2e9699dada6b08989d3",
              "3fbe9db285c0248d5d50e832a1c2312e3eb3490607a09cbf9962aa64b8edc3e7",
              "8ed521e3a1e15a85e8043aafef7b69873de69c388bbcbf12f42777134af32751") and
    not dll.pe.imphash : "c7606b6181f4b33c77e536a70d7b354c"
    ] by dll.path

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.patheq?:\Windows\VeeamVssSupport\VeeamVssHook.dllexcludes:dll.path field:"dll.path" value:"?:\Windows\VeeamVssSupport\VeeamVssHook.dll"
process.executableeq?:\Windows\System32\svchost.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\svchost.exe"
dll.code_signature.trustedeqtrueexcludes:dll.code_signature.trusted field:"dll.code_signature.trusted" value:"true"
dll.hash.sha256eqca329f3db5479be602c2d456f0dafc023c5e744b1454a4215b45761371ffd857, 880fe8b7e7e0276ca9f010a30aad003accc1b3f12e0ac50e2f12b3774b8c2aac, a28d2f62629b6926211a2f8245ce2d0ab47d64f6680e6494720e04a13ab6ee1e, ad46d50fdd0764ee0626beb9720d9b1a00266404189dd99cf18eaf1545d7b43b, f9ff91b05b5e705464d364226ba5e40b9256f4720f3f9281247c7ce19f311f12, fab84acf7d285984bb61fa655c24973de89b2234b7ba002954ba315fb2b9c90c, b628784e41989e5ba2f96beec98c42fc32d15fc2de03187f6c50cc6705b57166, 2d64b8e67e97ccd363d26a5ee3acbb9fe949d2f7f22ae6dc134645972c3f43d9, 5e40b53733105e98ad2914bfb2f0dda52e3b9b3c87d82bf4ff092f1bed25cd13, 6d859a89e80f290249b9b1a7aaea3929d999f1f15b99089f88d5e5120e23a6d8, 2c611395ad89e8653533e6c1b8815720f7fb4c043197e52c93d983b3e3726226, ce77f9afb4942b85a0bfa1ccb41c0b599f0275e56c6ed2e9699dada6b08989d3, 3fbe9db285c0248d5d50e832a1c2312e3eb3490607a09cbf9962aa64b8edc3e7, 8ed521e3a1e15a85e8043aafef7b69873de69c388bbcbf12f42777134af32751excludes:dll.hash.sha256
dll.pe.imphasheqc7606b6181f4b33c77e536a70d7b354cexcludes:dll.pe.imphash field:"dll.pe.imphash" value:"c7606b6181f4b33c77e536a70d7b354c"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.hash.sha256is_not_null
  • (no value, null check)
field:"Hashes" kind:is_not_null
event.actionne
  • deletion corpus 86 (elastic 86)
field:"EventType" kind:ne value:"deletion"
file.Ext.header_byteswildcard
  • 4d5a* corpus 46 (elastic 46)
field:"file.Ext.header_bytes" kind:wildcard value:"4d5a*"
file.extensionwildcard
  • cpl corpus 19 (elastic 19)
  • dll corpus 33 (elastic 33)
  • ocx corpus 6 (elastic 6)
field:"file.extension" kind:wildcard
process.executablewildcard
  • ?:\Program Files*\Windows NT\Accessories\wordpad.exe
  • ?:\WINDOWS\system32\PerceptionSimulation\PerceptionSimulationService.exe
field:"Image" kind:wildcard
process.namewildcard
  • lsass.exe corpus 9 (elastic 9)
  • rundll32.exe corpus 126 (elastic 100, splunk 26)
  • svchost.exe corpus 24 (elastic 22, splunk 2)
field:"process_name" kind:wildcard
process.pideq
  • 4 transforms: number corpus 19 (elastic 19)
field:"process_id" kind:eq value:"4"
user.idwildcard
  • S-1-12-* corpus 46 (elastic 46)
  • S-1-5-21* corpus 47 (elastic 47)
field:"user.id" kind:wildcard