Techniques
Sample rules
DNS over HTTPS via Unsigned or Untrusted Binary
- source: elastic
- technicques:
- T1071
- T1572
Description
Identifies connection attempts from unsigned or untrusted macOS processes executed from commonly abused staging or user-writable directories to known public DNS resolver IPv4 addresses over port 443. Adversaries may use DNS over HTTPS (DoH) to bypass the system resolver and obscure DNS queries associated with command-and-control. Because the rule evaluates connection-attempt metadata rather than application-layer traffic, an alert may represent a blocked or unsuccessful connection and does not by itself confirm DoH activity.
Detection logic
network where host.os.type == "macos" and event.type == "start" and event.action == "connection_attempted" and
destination.port == 443 and
cidrmatch(destination.ip,
/* Cloudflare, including malware-blocking resolvers */
"1.1.1.1/32", "1.0.0.1/32", "1.1.1.2/32", "1.0.0.2/32", "1.1.1.3/32", "1.0.0.3/32",
/* Google */
"8.8.8.8/32", "8.8.4.4/32",
/* Quad9 */
"9.9.9.9/32", "149.112.112.112/32", "9.9.9.10/32", "149.112.112.10/32", "9.9.9.11/32", "149.112.112.11/32",
/* OpenDNS */
"208.67.222.222/32", "208.67.220.220/32",
/* AdGuard */
"94.140.14.14/32", "94.140.15.15/32") and
(process.code_signature.trusted == false or process.code_signature.exists == false) and
process.executable like (
"/tmp/*",
"/private/tmp/*",
"/private/var/tmp/*",
"/var/tmp/*",
"/Users/Shared/*",
"/Users/*/Downloads/*",
"/private/var/folders/*",
"/var/folders/*",
"/Volumes/*",
"/Users/*/Library/Application Support/*")