Unusual DNS Activity

A machine learning job detected a rare and unusual DNS query that indicate network activity with unusual DNS domains. This can be due to initial access, persistence, command-and-control, or exfiltration activity. For example, when a user clicks on a link in a phishing email or opens a malicious document, a request may be sent to download and run a payload from an uncommon domain. When malware is already running, it may send requests to an uncommon DNS domain the malware uses for command-and-control communication.

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 a rare and unusual DNS query that indicate network activity with unusual DNS domains.
 12This can be due to initial access, persistence, command-and-control, or exfiltration activity. For example, when a user
 13clicks on a link in a phishing email or opens a malicious document, a request may be sent to download and run a payload
 14from an uncommon domain. When malware is already running, it may send requests to an uncommon DNS domain the malware
 15uses for command-and-control communication.
 16"""
 17false_positives = [
 18    """
 19    A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this
 20    alert. Network activity that occurs rarely, in small quantities, can trigger this alert. Possible examples are
 21    browsing technical support or vendor networks sparsely. A user who visits a new or unique web destination may
 22    trigger this alert.
 23    """,
 24]
 25from = "now-45m"
 26interval = "15m"
 27license = "Elastic License v2"
 28machine_learning_job_id = "packetbeat_rare_dns_question"
 29name = "Unusual DNS Activity"
 30setup = """## Setup
 31
 32This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
 33- Elastic Defend
 34- Network Packet Capture
 35
 36### Anomaly Detection Setup
 37
 38Once 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).
 39
 40### Elastic Defend Integration Setup
 41Elastic 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.
 42
 43#### Prerequisite Requirements:
 44- Fleet is required for Elastic Defend.
 45- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 46
 47#### The following steps should be executed in order to add the Elastic Defend integration to your system:
 48- Go to the Kibana home page and click "Add integrations".
 49- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 50- Click "Add Elastic Defend".
 51- Configure the integration name and optionally add a description.
 52- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 53- 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).
 54- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 55- 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.
 56For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
 57- Click "Save and Continue".
 58- 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.
 59For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 60
 61### Network Packet Capture Integration Setup
 62The 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.
 63
 64#### The following steps should be executed in order to add the Elastic Agent System integration "network_traffic" to your system:
 65- Go to the Kibana home page and click “Add integrations”.
 66- In the query bar, search for “Network Packet Capture” and select the integration to see more details about it.
 67- Click “Add Network Packet Capture”.
 68- Configure the integration name and optionally add a description.
 69- Review optional and advanced settings accordingly.
 70- 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.
 71- Click “Save and Continue”.
 72- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/network_traffic).
 73"""
 74references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
 75risk_score = 21
 76rule_id = "746edc4c-c54c-49c6-97a1-651223819448"
 77severity = "low"
 78tags = [
 79    "Use Case: Threat Detection",
 80    "Rule Type: ML",
 81    "Rule Type: Machine Learning",
 82    "Tactic: Command and Control",
 83]
 84type = "machine_learning"
 85[[rule.threat]]
 86framework = "MITRE ATT&CK"
 87[[rule.threat.technique]]
 88id = "T1071"
 89name = "Application Layer Protocol"
 90reference = "https://attack.mitre.org/techniques/T1071/"
 91[[rule.threat.technique.subtechnique]]
 92id = "T1071.004"
 93name = "DNS"
 94reference = "https://attack.mitre.org/techniques/T1071/004/"
 95
 96
 97
 98[rule.threat.tactic]
 99id = "TA0011"
100name = "Command and Control"
101reference = "https://attack.mitre.org/tactics/TA0011/"

References

Related rules

to-top