Skip to content

Commit

Permalink
[8.6] [Detection Engine] Adds 8.6 rules (#146402) (#146588)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.6`:
- [[Detection Engine] Adds 8.6 rules
(#146402)](#146402)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Terrance
DeJesus","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-11-29T14:33:20Z","message":"[Detection
Engine] Adds 8.6 rules (#146402)\n\n## Summary\r\n\r\nPull updates to
detection rules
from\r\nhttps://github.com/elastic/detection-rules/tree/0600b575650f3bec81720da72b1cea7481978576.\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),\r\nuses
sentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n\r\nCo-authored-by:
Dmitrii
<[email protected]>","sha":"d4aff1626f0bb98739224a7652e17258e5594f78","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","auto-backport","trade-artifacts","v8.6.0"],"number":146402,"url":"https://github.com/elastic/kibana/pull/146402","mergeCommit":{"message":"[Detection
Engine] Adds 8.6 rules (#146402)\n\n## Summary\r\n\r\nPull updates to
detection rules
from\r\nhttps://github.com/elastic/detection-rules/tree/0600b575650f3bec81720da72b1cea7481978576.\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),\r\nuses
sentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n\r\nCo-authored-by:
Dmitrii
<[email protected]>","sha":"d4aff1626f0bb98739224a7652e17258e5594f78"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Terrance DeJesus <[email protected]>
  • Loading branch information
xcrzx and terrancedejesus authored Nov 29, 2022
1 parent 82db446 commit f27fa89
Show file tree
Hide file tree
Showing 345 changed files with 3,954 additions and 1,546 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"index": [
"logs-endpoint.events.*",
"winlogbeat-*",
"logs-windows.*"
"logs-windows.*",
"endgame-*"
],
"language": "eql",
"license": "Elastic License v2",
Expand Down Expand Up @@ -48,7 +49,8 @@
"Windows",
"Threat Detection",
"Collection",
"has_guide"
"Investigation Guide",
"Elastic Endgame"
],
"threat": [
{
Expand Down Expand Up @@ -81,5 +83,5 @@
],
"timestamp_override": "event.ingested",
"type": "eql",
"version": 101
"version": 102
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{
"integration": "audit",
"package": "gcp",
"version": "^2.2.1"
"version": "^2.0.0"
}
],
"required_fields": [
Expand Down Expand Up @@ -73,5 +73,5 @@
],
"timestamp_override": "event.ingested",
"type": "query",
"version": 101
"version": 102
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{
"integration": "audit",
"package": "gcp",
"version": "^2.2.1"
"version": "^2.0.0"
}
],
"required_fields": [
Expand Down Expand Up @@ -73,5 +73,5 @@
],
"timestamp_override": "event.ingested",
"type": "query",
"version": 101
"version": 102
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"Windows",
"Threat Detection",
"Collection",
"has_guide"
"Investigation Guide"
],
"threat": [
{
Expand Down Expand Up @@ -81,5 +81,5 @@
],
"timestamp_override": "event.ingested",
"type": "query",
"version": 101
"version": 102
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"Windows",
"Threat Detection",
"Collection",
"has_guide"
"Investigation Guide"
],
"threat": [
{
Expand Down Expand Up @@ -89,5 +89,5 @@
],
"timestamp_override": "event.ingested",
"type": "query",
"version": 101
"version": 102
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"Windows",
"Threat Detection",
"Collection",
"has_guide"
"Investigation Guide"
],
"threat": [
{
Expand Down Expand Up @@ -81,5 +81,5 @@
],
"timestamp_override": "event.ingested",
"type": "query",
"version": 101
"version": 102
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"index": [
"logs-endpoint.events.*",
"winlogbeat-*",
"logs-windows.*"
"logs-windows.*",
"endgame-*"
],
"language": "eql",
"license": "Elastic License v2",
Expand Down Expand Up @@ -54,7 +55,8 @@
"Windows",
"Threat Detection",
"Collection",
"has_guide"
"Investigation Guide",
"Elastic Endgame"
],
"threat": [
{
Expand Down Expand Up @@ -82,5 +84,5 @@
],
"timestamp_override": "event.ingested",
"type": "eql",
"version": 101
"version": 102
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"author": [
"Elastic"
],
"description": "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.",
"false_positives": [
"IoT (Internet of Things) devices and networks may use telnet and can be excluded if desired. Some business work-flows may use Telnet for administration of older devices. These often have a predictable behavior. Telnet activity involving an unusual source or destination may be more suspicious. Telnet activity involving a production server that has no known associated Telnet work-flow or business requirement is often suspicious."
],
"from": "now-9m",
"index": [
"auditbeat-*",
"filebeat-*",
"packetbeat-*",
"logs-endpoint.events.*"
],
"language": "kuery",
"license": "Elastic License v2",
"name": "Accepted Default Telnet Port Connection",
"query": "event.category:(network or network_traffic) and destination.port:23\n and network.direction:(inbound or ingress or outbound or egress)\n and not event.action:(\n flow_dropped or denied or deny or\n flow_terminated or timeout or Reject or network_flow)\n",
"required_fields": [
{
"ecs": true,
"name": "destination.port",
"type": "long"
},
{
"ecs": true,
"name": "event.action",
"type": "keyword"
},
{
"ecs": true,
"name": "event.category",
"type": "keyword"
},
{
"ecs": true,
"name": "network.direction",
"type": "keyword"
}
],
"risk_score": 47,
"rule_id": "34fde489-94b0-4500-a76f-b8a157cf9269",
"severity": "medium",
"tags": [
"Elastic",
"Host",
"Network",
"Threat Detection",
"Command and Control",
"Host",
"Lateral Movement",
"Initial Access"
],
"threat": [
{
"framework": "MITRE ATT&CK",
"tactic": {
"id": "TA0011",
"name": "Command and Control",
"reference": "https://attack.mitre.org/tactics/TA0011/"
},
"technique": []
},
{
"framework": "MITRE ATT&CK",
"tactic": {
"id": "TA0008",
"name": "Lateral Movement",
"reference": "https://attack.mitre.org/tactics/TA0008/"
},
"technique": [
{
"id": "T1021",
"name": "Remote Services",
"reference": "https://attack.mitre.org/techniques/T1021/"
}
]
},
{
"framework": "MITRE ATT&CK",
"tactic": {
"id": "TA0001",
"name": "Initial Access",
"reference": "https://attack.mitre.org/tactics/TA0001/"
},
"technique": [
{
"id": "T1190",
"name": "Exploit Public-Facing Application",
"reference": "https://attack.mitre.org/techniques/T1190/"
}
]
}
],
"timeline_id": "300afc76-072d-4261-864d-4149714bf3f1",
"timeline_title": "Comprehensive Network Timeline",
"timestamp_override": "event.ingested",
"type": "query",
"version": 101
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"language": "eql",
"license": "Elastic License v2",
"name": "Network Connection via Certutil",
"note": "## Triage and analysis\n\n### Investigating Network Connection via Certutil\n\nAttackers can abuse `certutil.exe` to download malware, offensive security tools, and certificates from external sources\nin order to take the next steps in a compromised environment.\n\nThis rule looks for network events where `certutil.exe` contacts IP ranges other than the ones specified in\n[IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml)\n\n#### Possible investigation steps\n\n- Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for\nprevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.\n- Investigate other alerts associated with the user/host during the past 48 hours.\n- Investigate if the downloaded file was executed.\n- Determine the context in which `certutil.exe` and the file were run.\n- Retrieve the downloaded file and determine if it is malicious:\n - Use a private sandboxed malware analysis system to perform analysis.\n - Observe and collect information about the following activities:\n - Attempts to contact external domains and addresses.\n - File and registry access, modification, and creation activities.\n - Service creation and launch activities.\n - Scheduled task creation.\n - Use the PowerShell Get-FileHash cmdlet to get the files' SHA-256 hash values.\n - Search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.\n\n### False positive analysis\n\n- This mechanism can be used legitimately. If trusted software uses this command and the triage has not identified\nanything suspicious, this alert can be closed as a false positive.\n- If this rule is noisy in your environment due to expected activity, consider adding exceptions \u2014 preferably with a combination\nof user and command line conditions.\n\n### Response and remediation\n\n- Initiate the incident response process based on the outcome of the triage.\n- Isolate the involved host to prevent further post-compromise behavior.\n- If the triage identified malware, search the environment for additional compromised hosts.\n - Implement temporary network rules, procedures, and segmentation to contain the malware.\n - Stop suspicious processes.\n - Immediately block the identified indicators of compromise (IoCs).\n - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that\n attackers could use to reinfect the system.\n- Remove and block malicious artifacts identified during triage.\n- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and\nmalware components.\n- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.\n- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the\nmean time to respond (MTTR).\n",
"note": "## Triage and analysis\n\n### Investigating Network Connection via Certutil\n\nAttackers can abuse `certutil.exe` to download malware, offensive security tools, and certificates from external sources\nin order to take the next steps in a compromised environment.\n\nThis rule looks for network events where `certutil.exe` contacts IP ranges other than the ones specified in\n[IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml)\n\n> **Note**:\n> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) introduced in Elastic stack version 8.5.0. Older Elastic stacks versions will see unrendered markdown in this guide.\n\n#### Possible investigation steps\n\n- Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for\nprevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.\n- Investigate other alerts associated with the user/host during the past 48 hours.\n- Investigate if the downloaded file was executed.\n- Determine the context in which `certutil.exe` and the file were run.\n- Examine the host for derived artifacts that indicates suspicious activities:\n - Analyze the downloaded file using a private sandboxed analysis system.\n - Observe and collect information about the following activities in both the sandbox and the alert subject host:\n - Attempts to contact external domains and addresses.\n - Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by\n filtering by the process' `process.entity_id`.\n - Examine the DNS cache for suspicious or anomalous entries.\n - !{osquery{\"query\":\"SELECT * FROM dns_cache\", \"label\":\"Osquery - Retrieve DNS Cache\"}}\n - Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related\n processes in the process tree.\n - Examine the host services for suspicious or anomalous entries.\n - !{osquery{\"query\":\"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services\",\"label\":\"Osquery - Retrieve All Services\"}}\n - !{osquery{\"query\":\"SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE NOT (user_account LIKE \"%LocalSystem\" OR user_account LIKE \"%LocalService\" OR user_account LIKE \"%NetworkService\" OR user_account == null)\",\"label\":\"Osquery - Retrieve Services Running on User Accounts\"}}\n - !{osquery{\"query\":\"SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid, services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path = authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != \"trusted\"\",\"label\":\"Osquery - Retrieve Service Unsigned Executables with Virustotal Link\"}}\n - Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and\n reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.\n\n### False positive analysis\n\n- This mechanism can be used legitimately. If trusted software uses this command and the triage has not identified\nanything suspicious, this alert can be closed as a false positive.\n- If this rule is noisy in your environment due to expected activity, consider adding exceptions \u2014 preferably with a combination\nof user and command line conditions.\n\n### Response and remediation\n\n- Initiate the incident response process based on the outcome of the triage.\n- Isolate the involved host to prevent further post-compromise behavior.\n- If the triage identified malware, search the environment for additional compromised hosts.\n - Implement temporary network rules, procedures, and segmentation to contain the malware.\n - Stop suspicious processes.\n - Immediately block the identified indicators of compromise (IoCs).\n - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that\n attackers could use to reinfect the system.\n- Remove and block malicious artifacts identified during triage.\n- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and\nmalware components.\n- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.\n- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the\nmean time to respond (MTTR).\n",
"query": "sequence by process.entity_id\n [process where process.name : \"certutil.exe\" and event.type == \"start\"]\n [network where process.name : \"certutil.exe\" and\n not 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\",\n \"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\",\n \"192.0.0.171/32\", \"192.0.2.0/24\", \"192.31.196.0/24\", \"192.52.193.0/24\",\n \"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\",\n \"198.18.0.0/15\", \"198.51.100.0/24\", \"203.0.113.0/24\", \"240.0.0.0/4\", \"::1\",\n \"FE80::/10\", \"FF00::/8\")]\n",
"references": [
"https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml",
Expand Down Expand Up @@ -49,7 +49,7 @@
"Windows",
"Threat Detection",
"Command and Control",
"has_guide"
"Investigation Guide"
],
"threat": [
{
Expand All @@ -69,5 +69,5 @@
}
],
"type": "eql",
"version": 101
"version": 102
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"query": "event.category:(network OR network_traffic) AND type:(tls OR http) AND network.transport:tcp AND destination.domain:/[a-z]{3}.stage.[0-9]{8}\\..*/\n",
"references": [
"https://blog.morphisec.com/fin7-attacks-restaurant-industry",
"https://www.fireeye.com/blog/threat-research/2017/04/fin7-phishing-lnk.html"
"https://www.fireeye.com/blog/threat-research/2017/04/fin7-phishing-lnk.html",
"https://www.elastic.co/security-labs/collecting-cobalt-strike-beacons-with-the-elastic-stack"
],
"risk_score": 73,
"rule_id": "cf53f532-9cc9-445a-9ae7-fced307ec53c",
Expand Down Expand Up @@ -63,5 +64,5 @@
],
"timestamp_override": "event.ingested",
"type": "query",
"version": 100
"version": 101
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"https://www.cobaltstrike.com/help-setup-collaboration",
"https://www.elastic.co/guide/en/beats/packetbeat/current/configuration-tls.html",
"https://www.elastic.co/guide/en/beats/filebeat/7.9/filebeat-module-suricata.html",
"https://www.elastic.co/guide/en/beats/filebeat/7.9/filebeat-module-zeek.html"
"https://www.elastic.co/guide/en/beats/filebeat/7.9/filebeat-module-zeek.html",
"https://www.elastic.co/security-labs/collecting-cobalt-strike-beacons-with-the-elastic-stack"
],
"required_fields": [
{
Expand Down Expand Up @@ -81,5 +82,5 @@
],
"timestamp_override": "event.ingested",
"type": "query",
"version": 100
"version": 101
}
Loading

0 comments on commit f27fa89

Please sign in to comment.