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

References

Related rules

to-top