Linux iptables/ufw Firewall Rule Flush via Process Execution

Flags Linux iptables/ufw activity that flushes firewall rules and can allow broad network traffic.

FreeReviewedSigma · Medium · v2
Product
linux
Category
process_creation
Author
Joseliyo Sanchez, @Joseliyo_Jstnk (SigmaHQ), DRL 1.1
Published
2023-01-18
Updated
2026-07-31
title: Linux iptables/ufw Firewall Rule Flush via Process Execution
id: 91bf5405-8655-48df-9416-42306aaf7922
status: test
description: This rule identifies Linux processes executing iptables (including legacy and IPv4/IPv6 variants) with command-line options to flush and delete firewall rules and chains. It also looks for ufw-related command-line strings associated with logging allow/deny behavior. Such actions can impair defensive controls by removing or weakening filtering, so attackers may use them during evasion or disruption. The detection relies on Linux process creation telemetry that includes the executable path and full command line.
references:
  - https://blogs.blackberry.com/
  - https://www.cyberciti.biz/tips/linux-iptables-how-to-flush-all-rules.html
  - https://twitter.com/Joseliyo_Jstnk/status/1620131033474822144
  - https://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_iptables_flush_ufw.yml
author: Joseliyo Sanchez, @Joseliyo_Jstnk, Huntrule Team
date: 2023-01-18
tags:
  - attack.defense-impairment
  - attack.t1686
logsource:
  product: linux
  category: process_creation
detection:
  selection_img:
    Image|endswith:
      - /iptables
      - /xtables-legacy-multi
      - /iptables-legacy-multi
      - /ip6tables
      - /ip6tables-legacy-multi
  selection_params:
    CommandLine|contains:
      - -F
      - -Z
      - -X
  selection_ufw:
    CommandLine|contains:
      - ufw-logging-deny
      - ufw-logging-allow
      - ufw6-logging-deny
      - ufw6-logging-allow
  condition: all of selection_*
falsepositives:
  - Network administrators
level: medium
license: DRL-1.1
related:
  - id: 3be619f4-d9ec-4ea8-a173-18fdd01996ab
    type: derived