← Back to SOC feed Coverage →

Flush Iptables Ufw Chain

sigma MEDIUM SigmaHQ
T1562.004
imProcessCreate
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at SigmaHQ →
Retrieved: 2026-03-25T02:50:08Z · Confidence: medium

Hunt Hypothesis

Adversaries may attempt to flush iptables and UFW chains to disable firewall rules and gain unrestricted network access. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential network pivoting or lateral movement attempts.

Detection Rule

Sigma (Original)

title: Flush Iptables Ufw Chain
id: 3be619f4-d9ec-4ea8-a173-18fdd01996ab
status: test
description: Detect use of iptables to flush all firewall rules, tables and chains and allow all network traffic
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
author: Joseliyo Sanchez, @Joseliyo_Jstnk
date: 2023-01-18
tags:
    - attack.defense-evasion
    - attack.t1562.004
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'
            # - 'ufw-reject-output'
            # - 'ufw-track-inputt'
    condition: all of selection_*
falsepositives:
    - Network administrators
level: medium

KQL (Azure Sentinel)

imProcessCreate
| where (TargetProcessName endswith "/iptables" or TargetProcessName endswith "/xtables-legacy-multi" or TargetProcessName endswith "/iptables-legacy-multi" or TargetProcessName endswith "/ip6tables" or TargetProcessName endswith "/ip6tables-legacy-multi") and (TargetProcessCommandLine contains "-F" or TargetProcessCommandLine contains "-Z" or TargetProcessCommandLine contains "-X") and (TargetProcessCommandLine contains "ufw-logging-deny" or TargetProcessCommandLine contains "ufw-logging-allow" or TargetProcessCommandLine contains "ufw6-logging-deny" or TargetProcessCommandLine contains "ufw6-logging-allow")

False Positive Guidance

MITRE ATT&CK Context

Original source: https://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_iptables_flush_ufw.yml