Skip to content

Commit

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

Pull updates to detection rules from
https://github.com/elastic/detection-rules/tree/0600b575650f3bec81720da72b1cea7481978576.

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)

Co-authored-by: Dmitrii <[email protected]>
  • Loading branch information
terrancedejesus and xcrzx authored Nov 29, 2022
1 parent fa320eb commit d4aff16
Show file tree
Hide file tree
Showing 230 changed files with 1,389 additions and 407 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"Windows",
"Threat Detection",
"Collection",
"has_guide",
"Investigation Guide",
"Elastic Endgame"
],
"threat": [
Expand Down
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 @@ -55,7 +55,7 @@
"Windows",
"Threat Detection",
"Collection",
"has_guide",
"Investigation Guide",
"Elastic Endgame"
],
"threat": [
Expand Down
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
}
Loading

0 comments on commit d4aff16

Please sign in to comment.