---
title: Possible base64-encoded data in DNS query hostname
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > Possible base64-encoded data in DNS
  query hostname
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Possible base64-encoded data in DNS query hostname

{% alert level="danger" %}
This rule is part of a beta feature. To learn more, [contact Support](https://docs.datadoghq.com/help/).
{% /alert %}
Classification:attackTactic:[TA0010-exfiltration](https://attack.mitre.org/tactics/TA0010)Technique:[T1048-exfiltration-over-alternative-protocol](https://attack.mitre.org/techniques/T1048) 
## Goal{% #goal %}

Detects DNS queries whose hostname contains base64 padding (`==`) indicating possible data encoded into a subdomain.

## Strategy{% #strategy %}

This rule monitors OCSF DNS Activity events where `@ocsf.class_uid` is `4003` and `@ocsf.query.hostname` matches `*==.*`. The double-equals padding is produced by base64 encoders, and its presence inside a DNS label is unusual for legitimate hostnames. Attackers embed encoded command output, credentials, or confidential data into a subdomain so that the data is exfiltrated through DNS.

## Triage and response{% #triage-and-response %}

- Examine the hostname `{{@ocsf.query.hostname}}` and base64-decode the encoded label to determine whether it contains structured data such as credentials, file contents, or command output.
- Identify the workload on `{{@ocsf.src_endpoint.ip}}` that initiated the query and investigate potentially suspicious behavior
- Review the parent domain in the query for prior reputation hits, recent registration, or known association with DNS tunneling toolkits.
- Check whether additional encoded subdomains have been queried under the same parent, which would suggest active exfiltration
- Determine if outbound traffic to other channels (HTTP, HTTPS, ICMP) from the same host shows other suspicious activity.
