Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
[[prebuilt-rule-8-19-21-abnormally-large-dns-response]]
=== Abnormally Large DNS Response

Specially crafted DNS requests can manipulate a known overflow vulnerability in some Windows DNS servers, resulting in Remote Code Execution (RCE) or a Denial of Service (DoS) from crashing the service.

*Rule type*: query

*Rule indices*:

* packetbeat-*
* filebeat-*
* logs-network_traffic.*

*Severity*: medium

*Risk score*: 47

*Runs every*: 5m

*Searches indices from*: None ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)

*Maximum alerts per execution*: 100

*References*:

* https://research.checkpoint.com/2020/resolving-your-way-into-domain-admin-exploiting-a-17-year-old-bug-in-windows-dns-servers/
* https://msrc-blog.microsoft.com/2020/07/14/july-2020-security-update-cve-2020-1350-vulnerability-in-windows-domain-name-system-dns-server/
* https://github.com/maxpl0it/CVE-2020-1350-DoS
* https://www.elastic.co/security-labs/detection-rules-for-sigred-vulnerability

*Tags*:

* Use Case: Threat Detection
* Tactic: Lateral Movement
* Tactic: Impact
* Resources: Investigation Guide
* Use Case: Vulnerability

*Version*: 109

*Rule authors*:

* Elastic

*Rule license*: Elastic License v2


==== Investigation guide



*Triage and analysis*



*Investigating Abnormally Large DNS Response*


Detection alerts from this rule indicate possible anomalous activity around large byte DNS responses from a Windows DNS server. This detection rule was created based on activity represented in exploitation of vulnerability (CVE-2020-1350) also known as https://www.elastic.co/blog/detection-rules-for-sigred-vulnerability[SigRed] during July 2020.


*Possible investigation steps*


- This specific rule is sourced from network log activity such as DNS or network level data. It's important to validate the source of the incoming traffic and determine if this activity has been observed previously within an environment.
- Activity can be further investigated and validated by reviewing any associated Intrusion Detection Signatures (IDS) alerts.
- Further examination can include a review of the `dns.question_type` network fieldset with a protocol analyzer, such as Zeek, Packetbeat, or Suricata, for `SIG` or `RRSIG` data.
- Validate the patch level and OS of the targeted DNS server to validate the observed activity was not large-scale internet vulnerability scanning.
- Validate that the source of the network activity was not from an authorized vulnerability scan or compromise assessment.


*False positive analysis*


- Based on this rule, which looks for a threshold of 60k bytes, it is possible for activity to be generated under 65k bytes and related to legitimate behavior. In packet capture files received by the https://isc.sans.edu/forums/diary/PATCH+NOW+SIGRed+CVE20201350+Microsoft+DNS+Server+Vulnerability/26356/[SANS Internet Storm Center], byte responses were all observed as greater than 65k bytes.
- This activity can be triggered by compliance/vulnerability scanning or compromise assessment; it's important to determine the source of the activity and potentially allowlist the source host.


*Related rules*


- Unusual Child Process of dns.exe - 8c37dc0e-e3ac-4c97-8aa0-cf6a9122de45
- Unusual File Modification by dns.exe - c7ce36c0-32ff-4f9a-bfc2-dcb242bf99f9


*Response and remediation*


- Initiate the incident response process based on the outcome of the triage.
- Ensure that you have deployed the latest Microsoft https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2020-1350[Security Update] (Monthly Rollup or Security Only) and restarted the patched machines. If unable to patch immediately, Microsoft https://support.microsoft.com/en-us/help/4569509/windows-dns-server-remote-code-execution-vulnerability[released] a registry-based workaround that doesn’t require a restart. This can be used as a temporary solution before the patch is applied.
- Maintain backups of your critical systems to aid in quick recovery.
- Perform routine vulnerability scans of your systems, monitor https://us-cert.cisa.gov/ncas/current-activity[CISA advisories] and patch identified vulnerabilities.
- If you observe a true positive, implement a remediation plan and monitor host-based artifacts for additional post-exploitation behavior.


==== Rule query


[source, js]
----------------------------------
((event.category:(network or network_traffic) and destination.port:53)
or network.protocol:"dns"
or data_stream.dataset:(network_traffic.dns or zeek.dns))
and destination.bytes > 60000
and event.type:("allowed" or "end" or "protocol" or "start")

----------------------------------

*Framework*: MITRE ATT&CK^TM^

* Tactic:
** Name: Lateral Movement
** ID: TA0008
** Reference URL: https://attack.mitre.org/tactics/TA0008/
* Technique:
** Name: Exploitation of Remote Services
** ID: T1210
** Reference URL: https://attack.mitre.org/techniques/T1210/
* Tactic:
** Name: Impact
** ID: TA0040
** Reference URL: https://attack.mitre.org/tactics/TA0040/
* Technique:
** Name: Endpoint Denial of Service
** ID: T1499
** Reference URL: https://attack.mitre.org/techniques/T1499/
* Sub-technique:
** Name: Application or System Exploitation
** ID: T1499.004
** Reference URL: https://attack.mitre.org/techniques/T1499/004/
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
[[prebuilt-rule-8-19-21-accepted-default-telnet-port-connection]]
=== Accepted Default Telnet Port Connection

This rule detects network events that may indicate the use of Telnet traffic. Telnet is commonly used by system administrators to remotely control older or embedded systems using the command line shell. It should almost never be directly exposed to the Internet, as it is frequently targeted and exploited by threat actors as an initial access or backdoor vector. As a plain-text protocol, it may also expose usernames and passwords to anyone capable of observing the traffic.

*Rule type*: query

*Rule indices*:

* packetbeat-*
* auditbeat-*
* filebeat-*
* logs-network_traffic.*
* logs-panw.panos*
* logs-fortinet_fortigate.log-*
* logs-sonicwall_firewall.log-*
* logs-suricata.*

*Severity*: medium

*Risk score*: 47

*Runs every*: 5m

*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)

*Maximum alerts per execution*: 100

*References*: None

*Tags*:

* Domain: Endpoint
* Use Case: Threat Detection
* Tactic: Command and Control
* Tactic: Lateral Movement
* Tactic: Initial Access
* Data Source: PAN-OS
* Data Source: Fortinet
* Data Source: SonicWall
* Data Source: Suricata
* Resources: Investigation Guide

*Version*: 113

*Rule authors*:

* Elastic

*Rule license*: Elastic License v2


==== Investigation guide



*Triage and analysis*


> **Disclaimer**:
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.


*Investigating Accepted Default Telnet Port Connection*


Telnet, a protocol for remote command-line access, is often used in legacy systems. Its lack of encryption makes it vulnerable, allowing attackers to intercept credentials or use it as a backdoor. The detection rule identifies unencrypted Telnet traffic on port 23, flagging connections that bypass typical security measures, thus highlighting potential unauthorized access attempts.


*Possible investigation steps*


- Review the network traffic logs to identify the source IP address associated with the Telnet connection on port 23. Determine if the source IP is internal or external to the organization.
- Check the destination IP address to ascertain if it belongs to a critical system or a legacy device that might still use Telnet for management purposes.
- Investigate the timeline of the connection event to see if there are any patterns or repeated attempts, which could indicate a persistent threat or automated attack.
- Analyze any associated user accounts or credentials used during the Telnet session to verify if they are legitimate and authorized for remote access.
- Correlate the Telnet connection event with other security alerts or logs to identify any related suspicious activities, such as failed login attempts or unusual data transfers.
- Assess the network segment where the Telnet traffic was detected to determine if it is appropriately segmented and secured against unauthorized access.
- Consider implementing network security measures, such as disabling Telnet on devices or replacing it with secure alternatives like SSH, to prevent future unauthorized access attempts.


*False positive analysis*


- Legacy systems or devices that require Telnet for management may trigger alerts. To manage this, create exceptions for specific IP addresses or subnets known to host these systems.
- Internal network monitoring tools that use Telnet for legitimate purposes might be flagged. Identify these tools and exclude their traffic from the rule to prevent unnecessary alerts.
- Lab environments or test networks where Telnet is used for educational or testing purposes can cause false positives. Implement network segmentation and apply exceptions to these environments to reduce noise.
- Automated scripts or maintenance tasks that utilize Telnet for routine operations may be mistakenly identified. Document these tasks and whitelist their associated traffic patterns to avoid false alerts.


*Response and remediation*


- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Terminate any active Telnet sessions on the affected system to disrupt potential attacker activities.
- Conduct a thorough review of system logs and network traffic to identify any unauthorized access or data manipulation that may have occurred.
- Change all credentials that may have been exposed through Telnet traffic, prioritizing those with administrative privileges.
- Implement network segmentation to restrict Telnet access to only necessary internal systems, ensuring it is not exposed to the internet.
- Deploy encryption protocols such as SSH to replace Telnet for remote command-line access, enhancing security for remote management.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to assess the need for additional security measures.

==== Rule query


[source, js]
----------------------------------
(data_stream.dataset:(fortinet_fortigate.log or network_traffic.flow
or sonicwall_firewall.log or suricata.eve or panw.panos)
or event.category:(network or network_traffic))
and event.type:(connection and not end) and not event.action:(
flow_dropped or flow_denied or denied or deny or
flow_terminated or timeout or Reject or network_flow)
and destination.port:23

----------------------------------

*Framework*: MITRE ATT&CK^TM^

* Tactic:
** Name: Command and Control
** ID: TA0011
** Reference URL: https://attack.mitre.org/tactics/TA0011/
* Technique:
** Name: Application Layer Protocol
** ID: T1071
** Reference URL: https://attack.mitre.org/techniques/T1071/
* Tactic:
** Name: Lateral Movement
** ID: TA0008
** Reference URL: https://attack.mitre.org/tactics/TA0008/
* Technique:
** Name: Remote Services
** ID: T1021
** Reference URL: https://attack.mitre.org/techniques/T1021/
* Tactic:
** Name: Initial Access
** ID: TA0001
** Reference URL: https://attack.mitre.org/tactics/TA0001/
* Technique:
** Name: External Remote Services
** ID: T1133
** Reference URL: https://attack.mitre.org/techniques/T1133/
* Technique:
** Name: Exploit Public-Facing Application
** ID: T1190
** Reference URL: https://attack.mitre.org/techniques/T1190/
Loading
Loading