Linux auditd: iptables NAT redirect execution to altered TCP destination ports

Flags iptables NAT REDIRECT commands with --to-ports values 42–43 observed via Linux auditd EXECVE.

FreeReviewedSigma · Medium · v3
Product
linux
Service
auditd
Author
Rafal Piasecki (SigmaHQ), DRL 1.1
Published
2022-08-10
Updated
2026-07-31
title: "Linux auditd: iptables NAT redirect execution to altered TCP destination ports"
id: e28a5952-1384-4857-8ede-71f363b11906
status: test
description: This rule identifies execution of iptables commands that use NAT table redirection to specific destination ports via the --to-ports argument. Such behavior can conceal malicious access by making traffic appear intended for a benign TCP service while redirecting it to an alternate port on the host. Telemetry relies on Linux auditd process execution events (EXECVE) capturing the iptables command line and the presence of the targeted --to-ports values.
references:
  - https://www.sandflysecurity.com/blog/bpfdoor-an-evasive-linux-backdoor-technical-analysis/
  - https://www.elastic.co/security-labs/a-peek-behind-the-bpfdoor
  - https://github.com/SigmaHQ/sigma/blob/master/rules/linux/auditd/execve/lnx_auditd_bpfdoor_port_redirect.yml
author: Rafal Piasecki, Huntrule Team
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
license: DRL-1.1
related:
  - id: 70b4156e-50fc-4523-aa50-c9dddf1993fc
    type: derived