DNS Tunneling

A machine learning job detected unusually large numbers of DNS queries for a single top-level DNS domain, which is often used for DNS tunneling. DNS tunneling can be used for command-and-control, persistence, or data exfiltration activity. For example, dnscat tends to generate many DNS questions for a top-level domain as it uses the DNS protocol to tunnel data.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/03/25"
 3integration = ["endpoint", "network_traffic"]
 4maturity = "production"
 5updated_date = "2024/06/18"
 6
 7[rule]
 8anomaly_threshold = 50
 9author = ["Elastic"]
10description = """
11A machine learning job detected unusually large numbers of DNS queries for a single top-level DNS domain, which is often
12used for DNS tunneling. DNS tunneling can be used for command-and-control, persistence, or data exfiltration activity.
13For example, dnscat tends to generate many DNS questions for a top-level domain as it uses the DNS protocol to tunnel
14data.
15"""
16false_positives = [
17    """
18    DNS domains that use large numbers of child domains, such as software or content distribution networks, can trigger
19    this alert and such parent domains can be excluded.
20    """,
21]
22from = "now-45m"
23interval = "15m"
24license = "Elastic License v2"
25machine_learning_job_id = "packetbeat_dns_tunneling"
26name = "DNS Tunneling"
27setup = """## Setup
28
29This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
30- Elastic Defend
31- Network Packet Capture
32
33### Anomaly Detection Setup
34
35Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).
36
37### Elastic Defend Integration Setup
38Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
39
40#### Prerequisite Requirements:
41- Fleet is required for Elastic Defend.
42- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
43
44#### The following steps should be executed in order to add the Elastic Defend integration to your system:
45- Go to the Kibana home page and click "Add integrations".
46- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
47- Click "Add Elastic Defend".
48- Configure the integration name and optionally add a description.
49- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
50- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
51- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
52- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
53For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
54- Click "Save and Continue".
55- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
56For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
57
58### Network Packet Capture Integration Setup
59The Network Packet Capture integration sniffs network packets on a host and dissects known protocols. Monitoring the network traffic is critical to gaining observability and securing your environment — ensuring high levels of performance and security. The Network Packet Capture integration captures the network traffic between your application servers, decodes common application layer protocols and records the interesting fields for each transaction.
60
61#### The following steps should be executed in order to add the Elastic Agent System integration "network_traffic" to your system:
62- Go to the Kibana home page and click “Add integrations”.
63- In the query bar, search for “Network Packet Capture” and select the integration to see more details about it.
64- Click “Add Network Packet Capture”.
65- Configure the integration name and optionally add a description.
66- Review optional and advanced settings accordingly.
67- Add the newly installed “network_traffic” to an existing or a new agent policy, and deploy the agent on your system from which network log files are desirable.
68- Click “Save and Continue”.
69- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/network_traffic).
70"""
71references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
72risk_score = 21
73rule_id = "91f02f01-969f-4167-8f66-07827ac3bdd9"
74severity = "low"
75tags = [
76    "Use Case: Threat Detection",
77    "Rule Type: ML",
78    "Rule Type: Machine Learning",
79    "Tactic: Command and Control",
80]
81type = "machine_learning"
82[[rule.threat]]
83framework = "MITRE ATT&CK"
84[[rule.threat.technique]]
85id = "T1572"
86name = "Protocol Tunneling"
87reference = "https://attack.mitre.org/techniques/T1572/"
88
89
90[rule.threat.tactic]
91id = "TA0011"
92name = "Command and Control"
93reference = "https://attack.mitre.org/tactics/TA0011/"

References

Related rules

to-top