Sigma rule: Suspicious DNS Z Flag Bit Set

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-82f4fc070211, updated 2022-11-29T00:00:00.000Z.

Rule

Title
Suspicious DNS Z Flag Bit Set
Status
test
Level
medium
Author
@neu5ron, SOC Prime Team, Corelight
Date
2021-05-04
Modified
2022-11-29
File
rules/network/zeek/zeek_dns_susp_zbit_flag.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

The DNS Z flag is bit within the DNS protocol header that is, per the IETF design, meant to be used reserved (unused).
Although recently it has been used in DNSSec, the value being set to anything other than 0 should be rare.
Otherwise if it is set to non 0 and DNSSec is being used, then excluding the legitimate domains is low effort and high reward.
Determine if multiple of these files were accessed in a short period of time to further enhance the possibility of seeing if this was a one off or the possibility of larger sensitive file gathering.
This Sigma query is designed to accompany the Corelight Threat Hunting Guide, which can be found here: https://www3.corelight.com/corelights-introductory-guide-to-threat-hunting-with-zeek-bro-logs'

Log source

product
zeek
service
dns

Detection

z_flag_unset:
    Z: 0
most_probable_valid_domain:
    query|contains: '.'
exclude_tlds:
    query|endswith:
        - '.arpa'
        - '.local'
        - '.ultradns.net'
        - '.twtrdns.net'
        - '.azuredns-prd.info'
        - '.azure-dns.com'
        - '.azuredns-ff.info'
        - '.azuredns-ff.org'
        - '.azuregov-dns.org'
exclude_query_types:
    qtype_name:
        - 'ns'
        - 'mx'
exclude_responses:
    answers|endswith: '\\x00'
exclude_netbios:
    id.resp_p:
        - 137
        - 138
        - 139
condition: not z_flag_unset and most_probable_valid_domain and not (exclude_tlds or exclude_query_types or exclude_responses or exclude_netbios)

False positives (as the rule lists them)

  • Internal or legitimate external domains using DNSSec. Verify if these are legitimate DNSSec domains and then exclude them.
  • If you work in a Public Sector then it may be good to exclude things like endswith ".edu", ".gov" and or ".mil"

Tags

  • attack.t1095
  • attack.t1571
  • attack.command-and-control

MITRE ATT&CK ids this rule names

References

Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/network/zeek/zeek_dns_susp_zbit_flag.yml

Sources and licences

  • SigmaHQ

    "Suspicious DNS Z Flag Bit Set" by @neu5ron, SOC Prime Team, Corelight (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/network/zeek/zeek_dns_susp_zbit_flag.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

Cite this page

Dragons Eye Ransomware Tracker, "Sigma rule: Suspicious DNS Z Flag Bit Set",
entity page, dataset version ref-82f4fc070211, updated 2022-11-29T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/ede05abc-2c9e-4624-9944-9ff17fdc0bf5 (accessed 2026-11-03).
Underlying source: SigmaHQ rule ede05abc-2c9e-4624-9944-9ff17fdc0bf5, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.

Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.