Connection to Internal Network via Telnet

Telnet provides a command line interface for communication with a remote device or server. This rule identifies Telnet network connections to non-publicly routable IP addresses.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/04/23"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2023/11/02"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Telnet provides a command line interface for communication with a remote device or server. This rule identifies Telnet
13network connections to non-publicly routable IP addresses.
14"""
15false_positives = [
16    """
17    Telnet can be used for both benign or malicious purposes. Telnet is included by default in some Linux distributions,
18    so its presence is not inherently suspicious. The use of Telnet to manage devices remotely has declined in recent
19    years in favor of more secure protocols such as SSH. Telnet usage by non-automated tools or frameworks may be
20    suspicious.
21    """,
22]
23from = "now-9m"
24index = ["auditbeat-*", "logs-endpoint.events.*"]
25language = "eql"
26license = "Elastic License v2"
27name = "Connection to Internal Network via Telnet"
28references = ["https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml"]
29risk_score = 47
30rule_id = "1b21abcc-4d9f-4b08-a7f5-316f5f94b973"
31setup = """
32
33This rule requires data coming in from one of the following integrations:
34- Elastic Defend
35- Auditbeat
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 on a Linux 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/8.10/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### Auditbeat Setup
59Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.
60
61#### The following steps should be executed in order to add the Auditbeat on a Linux System:
62- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
63- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
64- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
65- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
66- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
67
68"""
69severity = "medium"
70tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Lateral Movement", "Data Source: Elastic Defend"]
71type = "eql"
72
73query = '''
74sequence by process.entity_id
75  [process where host.os.type == "linux" and process.name == "telnet" and event.type == "start"]
76  [network where host.os.type == "linux" and process.name == "telnet" and
77    cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
78                              "192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32",
79                              "192.0.0.171/32", "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24",
80                              "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10", "192.175.48.0/24",
81                              "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1",
82                              "FE80::/10", "FF00::/8")]
83'''
84
85
86[[rule.threat]]
87framework = "MITRE ATT&CK"
88[[rule.threat.technique]]
89id = "T1021"
90name = "Remote Services"
91reference = "https://attack.mitre.org/techniques/T1021/"
92
93
94[rule.threat.tactic]
95id = "TA0008"
96name = "Lateral Movement"
97reference = "https://attack.mitre.org/tactics/TA0008/"

References

Related rules

to-top