Linux auditd: dd overwrites a file using /dev/null or /dev/zero

Flags dd command lines that overwrite files by sourcing data from /dev/null or /dev/zero.

FreeReviewedSigma · Low · v3
Product
linux
Service
auditd
Author
Jakob Weinzettl, oscd.community (SigmaHQ), DRL 1.1
Published
2019-10-23
Updated
2026-07-31
title: "Linux auditd: dd overwrites a file using /dev/null or /dev/zero"
id: 04e79a91-d4b1-4d6f-b493-66cef4b8372f
status: stable
description: This rule flags Linux process executions where the dd command is invoked to read from /dev/null or /dev/zero, resulting in effectively wiping or deleting file contents. Attackers use this pattern to destroy data and disrupt incident investigation by overwriting target files with null or zero bytes. The detection relies on auditd telemetry capturing execve events and the dd invocation arguments that reference if=/dev/null or if=/dev/zero.
references:
  - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1485/T1485.md
  - https://github.com/SigmaHQ/sigma/blob/master/rules/linux/auditd/execve/lnx_auditd_dd_delete_file.yml
author: Jakob Weinzettl, oscd.community, Huntrule Team
date: 2019-10-23
tags:
  - attack.impact
  - attack.t1485
logsource:
  product: linux
  service: auditd
detection:
  selection:
    type: EXECVE
    a0|contains: dd
    a1|contains:
      - if=/dev/null
      - if=/dev/zero
  condition: selection
falsepositives:
  - Appending null bytes to files.
  - Legitimate overwrite of files.
level: low
license: DRL-1.1
related:
  - id: 37222991-11e9-4b6d-8bdf-60fbe48f753e
    type: derived