Long encoded DNS label queried by a script host or proxy binary
AN1121 describes DNS tunnelling as anomalous lookups issued by non-browser, non-system processes, and the Sysmon DNS query event is the one Windows source that names the process which actually called the resolver, so it can bind an encoded lookup to the interpreter that made it — unlike the network connection event, where a DNS query is attributed to the service host rather than the caller. The rule requires both halves: an image from the script host, signed proxy and interpreter set that has no business resolving names in bulk, and a leftmost DNS label of forty characters or more, which is the shape a base32 or base64 payload takes inside a query. The length gate stands in for MITRE's QueryLengthThreshold knob and the image list for its ProcessImageFilter knob; both sets of values are authored here, not supplied by MITRE. The remaining knobs, TimeWindow and query rate, need counting over an interval and Sigma has no way to express that, which is why this is a shape test rather than a frequency test. Two consequences follow and neither is tunable away: a compiled tunnelling client resolves under its own image and will not match the list, and an operator who keeps labels short to stay under a threshold defeats the regex. Sysmon EventID 22 needs Sysmon 10 or later with DNS query logging enabled, and most shipped configurations filter or exclude it outright, so confirm it is being collected before reading a quiet result as a clean one. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0400, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 2 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
Splunk · SPL
Run this as a search.
index=* | where ((match(Image, "(?i)\\\\powershell\\.exe$") OR match(Image, "(?i)\\\\pwsh\\.exe$") OR match(Image, "(?i)\\\\rundll32\\.exe$") OR match(Image, "(?i)\\\\regsvr32\\.exe$") OR match(Image, "(?i)\\\\mshta\\.exe$") OR match(Image, "(?i)\\\\wscript\\.exe$") OR match(Image, "(?i)\\\\cscript\\.exe$") OR match(Image, "(?i)\\\\nslookup\\.exe$") OR match(Image, "(?i)\\\\certutil\\.exe$") OR match(Image, "(?i)\\\\python\\.exe$") OR match(Image, "(?i)\\\\msbuild\\.exe$") OR match(Image, "(?i)\\\\installutil\\.exe$")) AND match(QueryName, "^[A-Za-z0-9_-]{40,}\\."))Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,windows,dns_query,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <rule id="100000" level="5"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(\\powershell\.exe$|\\pwsh\.exe$|\\rundll32\.exe$|\\regsvr32\.exe$|\\mshta\.exe$|\\wscript\.exe$|\\cscript\.exe$|\\nslookup\.exe$|\\certutil\.exe$|\\python\.exe$|\\msbuild\.exe$|\\installutil\.exe$)</field> <field name="QueryName" type="pcre2">(?i)^[A-Za-z0-9_-]{40,}\.</field> <description>Long encoded DNS label queried by a script host or proxy binary</description> <mitre> <id>T1071.004</id> </mitre> </rule></group>
Sentinel · KQL
Run this as a search.
Sentinel cannot express this construct. No Sentinel table is modelled for this logsource ({"category":"dns_query","product":"windows"}), so there is nothing honest to query. Pick a logsource this translator maps, or write the KQL by hand. The Sigma source is on the first tab, unchanged.
Elastic · ES|QL
Run this as a search.
Elastic cannot express this construct. ES|QL RLIKE uses Lucene regexp syntax, which has no case-insensitive flag, and Sigma regexes are case-insensitive. Use |contains/|startswith/|endswith, or write the ES|QL by hand. The Sigma source is on the first tab, unchanged.
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.