Detection rules › Elastic

Connection to Dynamic DNS Provider by an Unsigned Binary

Time window
1m
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies DNS queries to known Dynamic DNS Providers by an unsigned program. Dynamic DNS providers are often misused to host malware Command and Control servers.

MITRE ATT&CK coverage

TacticTechniques
Command & Control

Rule body

[rule]
description = """
Identifies DNS queries to known Dynamic DNS Providers by an unsigned program. Dynamic DNS providers are often misused to
host malware Command and Control servers.
"""
id = "75b80e66-90d0-4ab6-9e6b-976f7d690906"
license = "Elastic License v2"
name = "Connection to Dynamic DNS Provider by an Unsigned Binary"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/doing-time-with-the-yipphb-dropper",
    "https://www.elastic.co/security-labs/dissecting-remcos-rat-part-four",
]
version = "1.0.38"

query = '''
sequence by process.entity_id with maxspan=1m
 /* execution of an unsigned PEfollowed by dns request to dynamic dns provider */
  [process where event.action == "start" and user.id like ("S-1-5-21*", "S-1-12-*") and
   not process.code_signature.trusted == true and
   process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*") and 
   not process.hash.sha256 : 
              ("6cebce1ed45f77ca971281862cc9c9d0085dbc3504a9f1f9a717496cce51c829", 
               "43bd0fa458004d384a31b9147218be267b978506784dd4da141d46195a3ea4d9", 
               "18886da5d34be1f92ddf333c26f8c3a2b0be4da60a7ac4d795da233cbcd9e3bb",
               "94ab0b5595c2ebcf5d571504bf1b771308a5f6b391fe176bb83b98ac2c00c601",
               "b3246fe53f96b4f348be56555e0cfe5ccb990c666954b915163750d31d824155",
               "fc1ff4c34c9a6b504fb8114efef237abb81d68ae689b9f67f0eccf8e6bb0d1cd",
               "7bef5129132799a256fd6c33065e278c1a0e309e9109470a677abc52382bb46e",
               "e4bc373359eab8f6082bbb18cdb7dc08822b3a60ad28fd03ca41d6062bf1c81a",
               "65ae476e29863e8009897686b24618c972461459e09db7a453e1bdf2bd8747a7",
               "18df70114ee93d482b38a420254859326b2d176b87559574202172f6559c3a24",
               "2fcfb8ee597c419c09bd44ac14d7240247f627eb3eca7c7bac2c72142a3a9a53",
               "1618d40484e1ae2c25bbe0dc62e0b09f9213696cd148c622ee22fc3d6e15b6b1",
               "04ae8047e8b63e4ab09446a6a9b5aca49924af06e6ccd7012a3e12c90d5d615a",
               "d9639f20ab1499f38e74b34845db52b9a6afd223ed92936dbe23bffa9c362251",
               "1a840293a0647f5b600fce82e2aca744ee1cc3c362feb4b2703a9088379b420a",
               "495cbe2043fba338beae6da108c132dbfcaad6442c684380ed1397ef353ff58f",
               "88bbc206daf3de3089814da2f3a892ba0332e799be6bdc3349c35bb8b4e125e1",
               "8351ac57bca5f27998283fcc00c670fa9c9f08395cae5231d150630fa24fca1a",
               "7cd7fab80383e59a328e855b63e23c850eee78300b5f726db38ea0745be0bc5f") and
   not (process.code_signature.subject_name == "MarWinCliente" and process.parent.name == "dfsvc.exe" and
        process.code_signature.status == "errorUntrustedRoot") and
   not process.parent.executable : "C:\\Program Files\\Microsoft Visual Studio\\*.exe" and
   not (process.parent.name : "cmd.exe" and process.parent.command_line : "\"C:\\Windows\\system32\\cmd.exe\" ")
   ]
  [dns where
    dns.question.name :
         (
          "*.no-ip.com",
          "*.no-ip.org",
          "*.no-ip.biz",
          "*.no-ip.info",
          "*.noip.com",
          "*.afraid.org",
          "*.changeip.com",
          "*.ddns.net",
          "*.dyndns.org",
          "*.hopto.org",
          "*.zapto.org",
          "*.servehttp.com",
          "*.sytes.net",
          "*.myftp.biz",
          "*.myftp.org",
          "*.ddnsfree.com",
          "*.duckdns.org",
          "*.000webhostapp.com",
          "*.myddns.me",
          "*.dlinkddns.com",
          "*.chickenkiller.com", 
          "*.thddns.net", 
          "*.linkpc.net", 
          "*.gotdns.ch",
          "*.dynv6.net",
          "*.dns.army",
          "*.dns.navy",
          "*.v6.army",
          "*.v6.navy",
          "*.v6.rocks",
          "*.dyndns-office.com",
          "*.myvnc.com",
          "*.is-certified.com"
         ) and

    /* covered by rule Id dfe28e03-9b0b-47f5-9753-65ed2666663f */
    not dns.question.name : "checkip.dyndns.org"]
'''

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

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[[threat.technique.subtechnique]]
id = "T1071.004"
name = "DNS"
reference = "https://attack.mitre.org/techniques/T1071/004/"



[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.

Stage 1: process

[process where event.action == "start" and user.id like ("S-1-5-21*", "S-1-12-*") and
   not process.code_signature.trusted == true and
   process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*", "?:\\Windows\\Tasks\\*") and 
   not process.hash.sha256 : 
              ("6cebce1ed45f77ca971281862cc9c9d0085dbc3504a9f1f9a717496cce51c829", 
               "43bd0fa458004d384a31b9147218be267b978506784dd4da141d46195a3ea4d9", 
               "18886da5d34be1f92ddf333c26f8c3a2b0be4da60a7ac4d795da233cbcd9e3bb",
               "94ab0b5595c2ebcf5d571504bf1b771308a5f6b391fe176bb83b98ac2c00c601",
               "b3246fe53f96b4f348be56555e0cfe5ccb990c666954b915163750d31d824155",
               "fc1ff4c34c9a6b504fb8114efef237abb81d68ae689b9f67f0eccf8e6bb0d1cd",
               "7bef5129132799a256fd6c33065e278c1a0e309e9109470a677abc52382bb46e",
               "e4bc373359eab8f6082bbb18cdb7dc08822b3a60ad28fd03ca41d6062bf1c81a",
               "65ae476e29863e8009897686b24618c972461459e09db7a453e1bdf2bd8747a7",
               "18df70114ee93d482b38a420254859326b2d176b87559574202172f6559c3a24",
               "2fcfb8ee597c419c09bd44ac14d7240247f627eb3eca7c7bac2c72142a3a9a53",
               "1618d40484e1ae2c25bbe0dc62e0b09f9213696cd148c622ee22fc3d6e15b6b1",
               "04ae8047e8b63e4ab09446a6a9b5aca49924af06e6ccd7012a3e12c90d5d615a",
               "d9639f20ab1499f38e74b34845db52b9a6afd223ed92936dbe23bffa9c362251",
               "1a840293a0647f5b600fce82e2aca744ee1cc3c362feb4b2703a9088379b420a",
               "495cbe2043fba338beae6da108c132dbfcaad6442c684380ed1397ef353ff58f",
               "88bbc206daf3de3089814da2f3a892ba0332e799be6bdc3349c35bb8b4e125e1",
               "8351ac57bca5f27998283fcc00c670fa9c9f08395cae5231d150630fa24fca1a",
               "7cd7fab80383e59a328e855b63e23c850eee78300b5f726db38ea0745be0bc5f") and
   not (process.code_signature.subject_name == "MarWinCliente" and process.parent.name == "dfsvc.exe" and
        process.code_signature.status == "errorUntrustedRoot") and
   not process.parent.executable : "C:\\Program Files\\Microsoft Visual Studio\\*.exe" and
   not (process.parent.name : "cmd.exe" and process.parent.command_line : "\"C:\\Windows\\system32\\cmd.exe\" ")
   ]

Stage 2: dns

[dns where
    dns.question.name :
         (
          "*.no-ip.com",
          "*.no-ip.org",
          "*.no-ip.biz",
          "*.no-ip.info",
          "*.noip.com",
          "*.afraid.org",
          "*.changeip.com",
          "*.ddns.net",
          "*.dyndns.org",
          "*.hopto.org",
          "*.zapto.org",
          "*.servehttp.com",
          "*.sytes.net",
          "*.myftp.biz",
          "*.myftp.org",
          "*.ddnsfree.com",
          "*.duckdns.org",
          "*.000webhostapp.com",
          "*.myddns.me",
          "*.dlinkddns.com",
          "*.chickenkiller.com",
          "*.thddns.net",
          "*.linkpc.net",
          "*.gotdns.ch",
          "*.dynv6.net",
          "*.dns.army",
          "*.dns.navy",
          "*.v6.army",
          "*.v6.navy",
          "*.v6.rocks",
          "*.dyndns-office.com",
          "*.myvnc.com",
          "*.is-certified.com"
         ) and
    not dns.question.name : "checkip.dyndns.org"]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.statuseqerrorUntrustedRootexcludes:process.code_signature.status field:"process.code_signature.status" value:"errorUntrustedRoot"
process.code_signature.subject_nameeqMarWinClienteexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"MarWinCliente"
process.parent.nameeqdfsvc.exeexcludes:process.parent.name field:"process.parent.name" value:"dfsvc.exe"
process.parent.command_lineeq"C:\Windows\system32\cmd.exe" excludes:process.parent.command_line
process.parent.nameeqcmd.exeexcludes:process.parent.name field:"process.parent.name" value:"cmd.exe"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.hash.sha256eq6cebce1ed45f77ca971281862cc9c9d0085dbc3504a9f1f9a717496cce51c829, 43bd0fa458004d384a31b9147218be267b978506784dd4da141d46195a3ea4d9, 18886da5d34be1f92ddf333c26f8c3a2b0be4da60a7ac4d795da233cbcd9e3bb, 94ab0b5595c2ebcf5d571504bf1b771308a5f6b391fe176bb83b98ac2c00c601, b3246fe53f96b4f348be56555e0cfe5ccb990c666954b915163750d31d824155, fc1ff4c34c9a6b504fb8114efef237abb81d68ae689b9f67f0eccf8e6bb0d1cd, 7bef5129132799a256fd6c33065e278c1a0e309e9109470a677abc52382bb46e, e4bc373359eab8f6082bbb18cdb7dc08822b3a60ad28fd03ca41d6062bf1c81a, 65ae476e29863e8009897686b24618c972461459e09db7a453e1bdf2bd8747a7, 18df70114ee93d482b38a420254859326b2d176b87559574202172f6559c3a24, 2fcfb8ee597c419c09bd44ac14d7240247f627eb3eca7c7bac2c72142a3a9a53, 1618d40484e1ae2c25bbe0dc62e0b09f9213696cd148c622ee22fc3d6e15b6b1, 04ae8047e8b63e4ab09446a6a9b5aca49924af06e6ccd7012a3e12c90d5d615a, d9639f20ab1499f38e74b34845db52b9a6afd223ed92936dbe23bffa9c362251, 1a840293a0647f5b600fce82e2aca744ee1cc3c362feb4b2703a9088379b420a, 495cbe2043fba338beae6da108c132dbfcaad6442c684380ed1397ef353ff58f, 88bbc206daf3de3089814da2f3a892ba0332e799be6bdc3349c35bb8b4e125e1, 8351ac57bca5f27998283fcc00c670fa9c9f08395cae5231d150630fa24fca1a, 7cd7fab80383e59a328e855b63e23c850eee78300b5f726db38ea0745be0bc5fexcludes:process.hash.sha256
process.parent.executablewildcardC:\Program Files\Microsoft Visual Studio\*.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files\Microsoft Visual Studio\*.exe"
dns.question.nameeqcheckip.dyndns.orgexcludes:dns.question.name field:"dns.question.name" value:"checkip.dyndns.org"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dns.question.namewildcard
  • *.000webhostapp.com corpus 3 (elastic 3)
  • *.afraid.org corpus 3 (elastic 3)
  • *.changeip.com corpus 3 (elastic 3)
  • *.chickenkiller.com corpus 3 (elastic 3)
  • *.ddns.net corpus 3 (elastic 3)
  • *.ddnsfree.com corpus 3 (elastic 3)
  • *.dlinkddns.com corpus 3 (elastic 3)
  • *.dns.army corpus 3 (elastic 3)
  • *.dns.navy corpus 3 (elastic 3)
  • *.duckdns.org corpus 3 (elastic 3)
  • *.dyndns-office.com corpus 3 (elastic 3)
  • *.dyndns.org corpus 3 (elastic 3)
  • *.dynv6.net corpus 3 (elastic 3)
  • *.gotdns.ch corpus 3 (elastic 3)
  • *.hopto.org corpus 3 (elastic 3)
  • *.is-certified.com corpus 3 (elastic 3)
  • *.linkpc.net corpus 3 (elastic 3)
  • *.myddns.me corpus 3 (elastic 3)
  • *.myftp.biz corpus 3 (elastic 3)
  • *.myftp.org corpus 3 (elastic 3)
  • *.myvnc.com corpus 3 (elastic 3)
  • *.no-ip.biz corpus 3 (elastic 3)
  • *.no-ip.com corpus 3 (elastic 3)
  • *.no-ip.info corpus 3 (elastic 3)
  • *.no-ip.org corpus 3 (elastic 3)
  • *.noip.com corpus 3 (elastic 3)
  • *.servehttp.com corpus 3 (elastic 3)
  • *.sytes.net corpus 3 (elastic 3)
  • *.thddns.net corpus 3 (elastic 3)
  • *.v6.army corpus 3 (elastic 3)
  • *.v6.navy corpus 3 (elastic 3)
  • *.v6.rocks corpus 3 (elastic 3)
  • *.zapto.org corpus 3 (elastic 3)
field:"QueryName" kind:wildcard
event.actioneq
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq value:"start"
process.executablewildcard
  • ?:\ProgramData\* corpus 17 (elastic 17)
  • ?:\Users\* corpus 18 (elastic 18)
  • ?:\Windows\Tasks\* corpus 7 (elastic 7)
  • ?:\Windows\Temp\* corpus 9 (elastic 9)
field:"Image" kind:wildcard
user.idwildcard
  • S-1-12-* corpus 46 (elastic 46)
  • S-1-5-21* corpus 47 (elastic 47)
field:"user.id" kind:wildcard