1200KM / sigma-rule
Bpfdoor TCP Ports Redirect — Sigma Rule
Sigma rule 70b4156e-50fc-4523-aa50-c9dddf1993fc. Bpfdoor TCP Ports Redirect — Sigma Rule. All TCP traffic on particular port from attacker is routed to different port. ex. '/sbin/iptables -t nat -D PREROUTING -p tcp -s 192.168.1.1 --dport 22 -j REDIRECT --to-ports 42392' The traffic looks like encrypted SSH communications going to TCP port 22, but in reality is being directed to the shell port once it hits the iptables rule for the attacker host only.
Rule metadata and linked tags
Author: Rafal Piasecki. Source status: test; severity: medium. Source dates: 2022-08-10 / not supplied.
{
"product": "linux",
"service": "auditd"
}Pinned original Sigma rule · Detection Rule License 1.1
Source SHA-256: 7472238a0eda6d6ef35c118f5afbe8997003079479e759e1cb60dd7a9029d2e9
Detection logic
Original source YAML. Source-tag agreement is not proof of complete semantic coverage. This rule has not been compiled for a SIEM backend or validated against live telemetry here.
title: Bpfdoor TCP Ports Redirect
id: 70b4156e-50fc-4523-aa50-c9dddf1993fc
status: test
description: |
All TCP traffic on particular port from attacker is routed to different port. ex. '/sbin/iptables -t nat -D PREROUTING -p tcp -s 192.168.1.1 --dport 22 -j REDIRECT --to-ports 42392'
The traffic looks like encrypted SSH communications going to TCP port 22, but in reality is being directed to the shell port once it hits the iptables rule for the attacker host only.
references:
- https://www.sandflysecurity.com/blog/bpfdoor-an-evasive-linux-backdoor-technical-analysis/
- https://www.elastic.co/security-labs/a-peek-behind-the-bpfdoor
author: Rafal Piasecki
date: 2022-08-10
tags:
- attack.defense-impairment
- attack.t1686
logsource:
product: linux
service: auditd
detection:
cmd:
type: 'EXECVE'
a0|endswith: 'iptables'
a1: '-t'
a2: 'nat'
keywords:
- '--to-ports 42'
- '--to-ports 43'
condition: cmd and keywords
falsepositives:
- Legitimate ports redirect
level: medium
False positives
- Legitimate ports redirect
Source references
Connected ecosystem references
Exact source-tagged techniques
Telemetry review
Read the original logsource above, then inspect the linked detection workspaces for technique-level sensor context. No per-rule telemetry equivalence is inferred.
Pinned research references. No browser attack runner, live simulation result or validated detector is asserted. Source mappings and validation limits are preserved. ATT&CK / Atomic provenance · Detection provenance.