Linux process copying passwd or shadow from /tmp

Alerts on Linux cp commands that copy /tmp-based passwd or shadow files.

FreeReviewedSigma · High · v3
Product
linux
Category
process_creation
Author
Joseliyo Sanchez, @Joseliyo_Jstnk (SigmaHQ), DRL 1.1
Published
2023-01-31
Updated
2026-07-31
title: Linux process copying passwd or shadow from /tmp
id: 6e90e297-3dd0-4ec0-9bfc-42ae9bf0796c
status: test
description: Identifies Linux process activity where the command line indicates copying sensitive credential files named "passwd" or "shadow" while the command line includes a /tmp path. Attackers may stage or manipulate these files to access or prepare credential data outside normal locations. The rule relies on process creation telemetry, matching command-line content patterns that include /tmp and the target filenames.
references:
  - https://blogs.blackberry.com/
  - https://twitter.com/Joseliyo_Jstnk/status/1620131033474822144
  - https://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_cp_passwd_or_shadow_tmp.yml
author: Joseliyo Sanchez, @Joseliyo_Jstnk, Huntrule Team
date: 2023-01-31
tags:
  - attack.credential-access
  - attack.t1552.001
logsource:
  product: linux
  category: process_creation
detection:
  selection_img:
    Image|endswith: /cp
  selection_path:
    CommandLine|contains: /tmp/
  selection_file:
    CommandLine|contains:
      - passwd
      - shadow
  condition: all of selection_*
falsepositives:
  - Unknown
level: high
license: DRL-1.1
related:
  - id: fa4aaed5-4fe0-498d-bbc0-08e3346387ba
    type: derived