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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
[[prebuilt-rule-8-19-35-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-pfsense.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: Fortinet
* Data Source: PAN-OS
* Data Source: pfSense
* Data Source: SonicWall
* Data Source: Suricata
* Resources: Investigation Guide
* Noise: High
* Performance: Normal
* Profile: Aggressive
* Rule Type: Custom Query (KQL)
* Domain: Network
* Data Source: Network Packet Capture
* Data Source: SonicWall Firewall Logs

*Version*: 119

*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 panw.panos or pfsense.log or sonicwall_firewall.log or suricata.eve)
or event.category:(network or network_traffic))
and event.type:(connection and not (denied or end))
and not event.action:(Reject or client-rst or connection-denied or
connection-end or denied or deny or flow_denied or flow_dropped or
flow_terminated or network_flow or server-rst or timeout)
and not (event.action:netflow_flow and not network.packets > 1)
and not network.application:(stretchoid-scanning or traceroute)
and not (
data_stream.dataset:panw.panos and
network.application:("incomplete" or "insufficient-data" or "not-applicable")
)
and destination.port:23
and (network.protocol:(telnet or not *) or data_stream.dataset:fortinet_fortigate.log)

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

*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/
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
[[prebuilt-rule-8-19-35-anthropic-activity-from-a-suspicious-user-agent]]
=== Anthropic Activity from a Suspicious User Agent

Detects successful Anthropic audit activity where the user agent matches scripting HTTP clients, offensive scanners, or automation libraries (for example curl, python-requests, Go-http-client, axios, nuclei). Browser and first-party Claude clients normally present recognizable browser or product user agents; raw HTTP library agents on successful control-plane or product activity often indicate scripted access, stolen-session reuse, or unauthorized automation. Known benign automation patterns (axios or Go HTTP clients on file upload/delete, trusted device enrollment, and environment creation) are excluded.

*Rule type*: esql

*Rule indices*: None

*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*:

* https://platform.claude.com/docs/en/api/compliance/activities/list

*Tags*:

* Domain: GenAI
* Platform: Anthropic
* Data Source: Anthropic Audit Logs
* Use Case: Threat Detection
* Resources: Investigation Guide
* Rule Type: ES|QL
* Tactic: Command and Control

*Version*: 1

*Rule authors*:

* Elastic

*Rule license*: Elastic License v2


==== Investigation guide



*Triage and analysis*



*Investigating Anthropic Activity from a Suspicious User Agent*


Successful Anthropic audit events normally come from browser or first-party Claude clients. This rule flags scripting
HTTP clients, scanners, or automation libraries on successful activity. UAs are spoofable — corroborate with actor,
IP, and `event.action`.

Benign automation using axios or Go HTTP clients is already excluded for `platform_file_uploaded`,
`platform_file_deleted`, `claude_file_uploaded`, `trusted_device_enrolled`, and `environment_created`.

Unauthorized / escalate when a normally browser-bound user suddenly uses curl/python/Go-http-client on privileged
actions (IAM, exports, SSO, keys). Close as FP for approved SDK/CI identities on expected actions.


*Possible investigation steps*


- Compare `user_agent.original` and `event.action` to the user's baseline. A shift to curl, python-requests, or
Go-http-client on admin/export actions is higher priority than the same UA on already-allowlisted file ops.
- Branch `anthropic.audit.actor.type` and check `user.email` / `source.ip` against approved automation inventory.
- Pivot the same email/IP for auth failures, impossible travel, role changes, exports, or compliance logging changes.


*False positive analysis*


- Internal GenAI SDKs (`openai*`, `anthropic-sdk*`, `langchain*`) and CI jobs match — exclude stable identities, not
entire UA families. Extend the Go/axios action allowlist only with evidence of additional benign actions.


*Response and remediation*


- On unauthorized scripting access: revoke sessions, rotate credentials/MFA, review admin/export activity around the
alert, and hunt other scripting-UA activity from the same IP or email.


==== Rule query


[source, js]
----------------------------------
from logs-anthropic.audit-* metadata _id, _version, _index
| where
data_stream.dataset == "anthropic.audit" and
event.outcome == "success" and
source.ip is not null and
source.ip != "0.0.0.0" and
user.email is not null and
user_agent.original is not null
| eval Esql.ua_lower = to_lower(user_agent.original)
| where
(
Esql.ua_lower like "curl*" or
Esql.ua_lower like "python*" or
Esql.ua_lower like "wget*" or
Esql.ua_lower like "go-http*" or
Esql.ua_lower like "perl*" or
Esql.ua_lower like "libwww-perl*" or
Esql.ua_lower like "java*" or
Esql.ua_lower like "node*" or
Esql.ua_lower like "php*" or
Esql.ua_lower like "guzzle*" or
Esql.ua_lower like "bun*" or
Esql.ua_lower like "axios*" or
Esql.ua_lower like "undici*" or
Esql.ua_lower like "okhttp*" or
Esql.ua_lower like "apache-httpclient*" or
Esql.ua_lower like "httpclient*" or
Esql.ua_lower like "httpie*" or
Esql.ua_lower like "ruby*" or
Esql.ua_lower like "postmanruntime*" or
Esql.ua_lower like "restsharp*" or
Esql.ua_lower like "*kali*" or
Esql.ua_lower like "*parrot*" or
Esql.ua_lower like "*pentoo*" or
Esql.ua_lower like "*backbox*" or
Esql.ua_lower like "*blackarch*" or
Esql.ua_lower like "scrapy*" or
Esql.ua_lower like "mechanize*" or
Esql.ua_lower like "aiohttp*" or
Esql.ua_lower like "httpx*" or
Esql.ua_lower like "requests*" or
Esql.ua_lower like "pycurl*" or
Esql.ua_lower like "urllib*" or
Esql.ua_lower like "got/*" or
Esql.ua_lower like "node-fetch*" or
Esql.ua_lower like "superagent*" or
Esql.ua_lower like "ky/*" or
Esql.ua_lower like "fetch*" or
Esql.ua_lower like "deno*" or
Esql.ua_lower like "powershell*" or
Esql.ua_lower like "invoke-webrequest*" or
Esql.ua_lower like "windowspowershell*" or
Esql.ua_lower like "wget2*" or
Esql.ua_lower like "aria2*" or
Esql.ua_lower like "httrack*" or
Esql.ua_lower like "nikto*" or
Esql.ua_lower like "sqlmap*" or
Esql.ua_lower like "nmap*" or
Esql.ua_lower like "masscan*" or
Esql.ua_lower like "zgrab*" or
Esql.ua_lower like "nuclei*" or
Esql.ua_lower like "dirbuster*" or
Esql.ua_lower like "gobuster*" or
Esql.ua_lower like "ffuf*" or
Esql.ua_lower like "feroxbuster*" or
Esql.ua_lower like "wfuzz*" or
Esql.ua_lower like "burpsuite*" or
Esql.ua_lower like "hydra*" or
Esql.ua_lower like "metasploit*" or
Esql.ua_lower like "*havoc*" or
Esql.ua_lower like "*sliver*" or
Esql.ua_lower like "*cobalt strike*" or
Esql.ua_lower like "dart*" or
Esql.ua_lower like "rector*" or
Esql.ua_lower like "ruby-faraday*" or
Esql.ua_lower like "httparty*" or
Esql.ua_lower like "clj-http*" or
Esql.ua_lower like "hackney*" or
Esql.ua_lower like "elixir*" or
Esql.ua_lower like "swift-nio*" or
Esql.ua_lower like "vapor*" or
Esql.ua_lower like "rust*" or
Esql.ua_lower like "reqwest*" or
Esql.ua_lower like "ureq*" or
Esql.ua_lower like "hyper/*" or
Esql.ua_lower like "cohere-go*" or
Esql.ua_lower like "openai*" or
Esql.ua_lower like "anthropic-sdk*" or
Esql.ua_lower like "langchain*" or
Esql.ua_lower like "llamaindex*" or
Esql.ua_lower like "litellm*" or
Esql.ua_lower like "dspy*" or
Esql.ua_lower like "*zgrab*" or
Esql.ua_lower like "*masscan*" or
Esql.ua_lower like "*nessus*" or
Esql.ua_lower like "*shodan*" or
Esql.ua_lower like "*censys*" or
Esql.ua_lower like "*binaryedge*" or
Esql.ua_lower like "*internetmeasurement*" or
Esql.ua_lower like "*internetcensus*" or
Esql.ua_lower like "*shadowserver*" or
Esql.ua_lower like "*stretchoid*" or
Esql.ua_lower like "*http.rb*"
) and
not (
event.action in (
"platform_file_deleted",
"platform_file_uploaded",
"claude_file_uploaded",
"trusted_device_enrolled",
"environment_created"
) and
(Esql.ua_lower like "go-http*" or Esql.ua_lower like "axios*")
)
| keep _id, _version, _index, @timestamp, event.*, organization.*, user.*, source.*, user_agent.*, anthropic.audit.*, data_stream.*, Esql.ua_lower

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

*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/
* Sub-technique:
** Name: Web Protocols
** ID: T1071.001
** Reference URL: https://attack.mitre.org/techniques/T1071/001/
Loading
Loading