BPF filter applied using TC

Detects when the tc (transmission control) binary is utilized to set a BPF (Berkeley Packet Filter) on a network interface. Tc is used to configure Traffic Control in the Linux kernel. It can shape, schedule, police and drop traffic. A threat actor can utilize tc to set a bpf filter on an interface for the purpose of manipulating the incoming traffic. This technique is not at all common and should indicate abnormal, suspicious or malicious activity.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2022/07/11"
 3maturity = "production"
 4min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 5min_stack_version = "8.3.0"
 6updated_date = "2024/02/20"
 7integration = ["endpoint"]
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Detects when the tc (transmission control) binary is utilized to set a BPF (Berkeley Packet Filter) on a network
13interface. Tc is used to configure Traffic Control in the Linux kernel. It can shape, schedule, police and drop traffic.
14A threat actor can utilize tc to set a bpf filter on an interface for the purpose of manipulating the incoming traffic.
15This technique is not at all common and should indicate abnormal, suspicious or malicious activity.
16"""
17from = "now-9m"
18index = ["logs-endpoint.events.*", "endgame-*"]
19language = "eql"
20license = "Elastic License v2"
21name = "BPF filter applied using TC"
22references = [
23    "https://github.com/h3xduck/TripleCross/blob/master/src/helpers/deployer.sh",
24    "https://man7.org/linux/man-pages/man8/tc.8.html",
25]
26risk_score = 73
27rule_id = "ef04a476-07ec-48fc-8f3d-5e1742de76d3"
28setup = """## Setup
29
30This rule requires data coming in from Elastic Defend.
31
32### Elastic Defend Integration Setup
33Elastic 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.
34
35#### Prerequisite Requirements:
36- Fleet is required for Elastic Defend.
37- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
38
39#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
40- Go to the Kibana home page and click "Add integrations".
41- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
42- Click "Add Elastic Defend".
43- Configure the integration name and optionally add a description.
44- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
45- 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).
46- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
47- 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.
48For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
49- Click "Save and Continue".
50- 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.
51For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
52"""
53severity = "high"
54tags = [
55        "Domain: Endpoint",
56        "OS: Linux",
57        "Use Case: Threat Detection",
58        "Tactic: Execution",
59        "Threat: TripleCross",
60        "Data Source: Elastic Endgame",
61        "Data Source: Elastic Defend"
62        ]
63timestamp_override = "event.ingested"
64type = "eql"
65
66query = '''
67process where host.os.type == "linux" and event.type != "end" and process.executable == "/usr/sbin/tc" and
68process.args == "filter" and process.args == "add" and process.args == "bpf" and
69not process.parent.executable == "/usr/sbin/libvirtd"
70'''
71
72[[rule.threat]]
73framework = "MITRE ATT&CK"
74
75[[rule.threat.technique]]
76id = "T1059"
77name = "Command and Scripting Interpreter"
78reference = "https://attack.mitre.org/techniques/T1059/"
79
80[[rule.threat.technique.subtechnique]]
81id = "T1059.004"
82name = "Unix Shell"
83reference = "https://attack.mitre.org/techniques/T1059/004/"
84
85[rule.threat.tactic]
86id = "TA0002"
87name = "Execution"
88reference = "https://attack.mitre.org/tactics/TA0002/"

References

Related rules

to-top