-
Notifications
You must be signed in to change notification settings - Fork 692
[New Rules] Procfs Sycall Read & binfmt Configuration File Creation #6698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1e3cc41
[New Rules] Procfs Sycall Read & binfmt Configuration File Creation
Aegrah 3826068
date bump
Aegrah b6392ed
Potential fix for pull request finding
Aegrah f6b23f9
Update rules/linux/discovery_suspicious_proc_pid_syscall_read.toml
Aegrah f149edb
Update rules/linux/persistence_binfmt_configuration_file_creation.toml
Aegrah a6d338d
Update binfmt configuration file creation rules
Aegrah 54bd558
Merge branch 'main' into migrating-two-ers-to-dr
Aegrah a97ff6e
Merge branch 'main' into migrating-two-ers-to-dr
Aegrah e009c9d
Merge branch 'main' into migrating-two-ers-to-dr
Aegrah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
rules/linux/discovery_suspicious_proc_pid_syscall_read.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| [metadata] | ||
| creation_date = "2026/08/25" | ||
| integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"] | ||
| maturity = "production" | ||
| updated_date = "2026/08/25" | ||
|
|
||
| [rule] | ||
| author = ["Elastic"] | ||
| description = """ | ||
| This rule detects command lines that reference another process or thread's procfs syscall file. The | ||
| "/proc/<pid>/syscall" interface exposes the current syscall arguments, stack pointer, and instruction | ||
| pointer, which can support process discovery and preparation for process injection. Self and thread-self | ||
| aliases are excluded. | ||
| """ | ||
| from = "now-9m" | ||
| index = [ | ||
| "endgame-*", | ||
| "logs-crowdstrike.fdr*", | ||
| "logs-endpoint.events.process*", | ||
| "logs-sentinel_one_cloud_funnel.*", | ||
| ] | ||
| language = "eql" | ||
| license = "Elastic License v2" | ||
| name = "Suspicious Reading of procfs Syscall File" | ||
| references = [ | ||
| "https://man7.org/linux/man-pages/man5/proc_pid_syscall.5.html", | ||
| "https://www.akamai.com/blog/security-research/the-definitive-guide-to-linux-process-injection" | ||
| ] | ||
| risk_score = 47 | ||
| rule_id = "6327bdae-4dc4-4e2e-b29d-3fd100af522c" | ||
| severity = "medium" | ||
| tags = [ | ||
| "Domain: Endpoint", | ||
| "OS: Linux", | ||
|
Aegrah marked this conversation as resolved.
|
||
| "Use Case: Threat Detection", | ||
| "Tactic: Discovery", | ||
| "Data Source: Elastic Defend", | ||
| "Data Source: Elastic Endgame", | ||
| "Data Source: Crowdstrike", | ||
| "Data Source: SentinelOne", | ||
| ] | ||
| timestamp_override = "event.ingested" | ||
| type = "eql" | ||
| query = ''' | ||
| process where host.os.type == "linux" and event.type == "start" and | ||
| event.action in ("exec", "exec_event", "start", "ProcessRollup2") and | ||
| ( | ||
| process.name in ( | ||
| "cat", "less", "more", "head", "tail", "nano", "vi", "vim", "strings", "nvim", "vim.basic", | ||
| "vim.tiny", "od", "hexdump", "xxd", "hx", "hexedit", "pager", "tr" | ||
| ) or | ||
| ( | ||
| process.name in ( | ||
| "find", "awk", "gawk", "mawk", "nawk", "grep", "fgrep", "rgrep", "xargs", "sed", "tee" | ||
| ) and | ||
| process.args_count <= 20 | ||
| ) | ||
| ) and | ||
| process.command_line like "*/proc/*/syscall*" and | ||
| not ( | ||
| process.command_line like ("*/proc/self/syscall*", "*/proc/thread-self/syscall*") or | ||
| process.args like "/proc/*/syscall/comm" | ||
| ) | ||
|
Aegrah marked this conversation as resolved.
|
||
| ''' | ||
|
|
||
| [[rule.threat]] | ||
| framework = "MITRE ATT&CK" | ||
|
|
||
| [rule.threat.tactic] | ||
| name = "Discovery" | ||
| id = "TA0007" | ||
| reference = "https://attack.mitre.org/tactics/TA0007/" | ||
|
|
||
| [[rule.threat.technique]] | ||
| name = "Process Discovery" | ||
| id = "T1057" | ||
| reference = "https://attack.mitre.org/techniques/T1057/" | ||
76 changes: 76 additions & 0 deletions
76
rules/linux/persistence_binfmt_configuration_file_creation.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| [metadata] | ||
| creation_date = "2026/08/25" | ||
| integration = ["endpoint"] | ||
| maturity = "production" | ||
| updated_date = "2026/08/25" | ||
|
|
||
| [rule] | ||
| author = ["Elastic"] | ||
| description = """ | ||
| This rule detects the creation of a binfmt configuration file. Binfmt is a utility that is used to | ||
| configure the behavior of the Linux kernel when executing binary files. By creating a malicious | ||
| binfmt configuration file, threat actors can execute a backdoor script or command on the target system. | ||
| """ | ||
| from = "now-9m" | ||
| index = ["logs-endpoint.events.file*"] | ||
| language = "eql" | ||
| license = "Elastic License v2" | ||
| name = "Binfmt Configuration File Creation" | ||
| references = ["https://dfir.ch/posts/today_i_learned_binfmt_misc/"] | ||
| risk_score = 21 | ||
| rule_id = "a3b47d21-20d6-45b0-8b75-fc27073bdef2" | ||
| setup = """## Setup | ||
|
|
||
| This rule requires data coming in from Elastic Defend. | ||
|
|
||
| ### Elastic Defend Integration Setup | ||
| Elastic 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. | ||
|
|
||
| #### Prerequisite Requirements: | ||
| - Fleet is required for Elastic Defend. | ||
| - To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html). | ||
|
|
||
| #### The following steps should be executed in order to add the Elastic Defend integration on a Linux System: | ||
| - Go to the Kibana home page and click "Add integrations". | ||
| - In the query bar, search for "Elastic Defend" and select the integration to see more details about it. | ||
| - Click "Add Elastic Defend". | ||
| - Configure the integration name and optionally add a description. | ||
| - Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads". | ||
| - 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). | ||
| - We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions" | ||
| - 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. | ||
| For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html). | ||
| - Click "Save and Continue". | ||
| - 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. | ||
| For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html). | ||
| """ | ||
| severity = "low" | ||
| tags = [ | ||
| "Domain: Endpoint", | ||
| "OS: Linux", | ||
|
Aegrah marked this conversation as resolved.
|
||
| "Use Case: Threat Detection", | ||
| "Tactic: Persistence", | ||
| "Data Source: Elastic Defend", | ||
|
Copilot marked this conversation as resolved.
|
||
| ] | ||
| timestamp_override = "event.ingested" | ||
| type = "eql" | ||
| query = ''' | ||
| file where host.os.type == "linux" and event.action != "deletion" and process.executable != null and | ||
|
Aegrah marked this conversation as resolved.
|
||
| file.path like ( | ||
| "/etc/binfmt.d/*.conf", "/run/binfmt.d/*.conf", "/usr/local/lib/binfmt.d/*.conf", "/usr/lib/binfmt.d/*.conf" | ||
| ) and | ||
| not file.path like ("/usr/lib/binfmt.d/python3.*.conf", "/usr/lib/binfmt.d/qemu-*-static.conf") | ||
|
Aegrah marked this conversation as resolved.
Outdated
|
||
| ''' | ||
|
|
||
| [[rule.threat]] | ||
| framework = "MITRE ATT&CK" | ||
|
|
||
| [[rule.threat.technique]] | ||
| id = "T1546" | ||
| name = "Event Triggered Execution" | ||
| reference = "https://attack.mitre.org/techniques/T1546/" | ||
|
|
||
| [rule.threat.tactic] | ||
| id = "TA0003" | ||
| name = "Persistence" | ||
| reference = "https://attack.mitre.org/tactics/TA0003/" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.