Binary Padding - MacOS

 Original Source: [Sigma source]
Title: Binary Padding - MacOS
Status: test
Description:Adversaries may use binary padding to add junk data and change the on-disk representation of malware. This rule detect using dd and truncate to add a junk data to file.
References:
  -https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1027.001/T1027.001.md
  -https://linux.die.net/man/1/truncate
  -https://linux.die.net/man/1/dd
Author: Igor Fits, Mikhail Larin, oscd.community
Date: 2020-10-19
modified:2023-02-17
Tags:
  • -'attack.stealth'
  • -'attack.t1027.001'
Logsource:
  • product: macos
  • category: process_creation
Detection:
  selection_truncate:
    Image|endswith: '/truncate'
    CommandLine|contains: '-s +'
  selection_dd:
    Image|endswith: '/dd'
    CommandLine|contains:
      -'if=/dev/zero'
      -'if=/dev/random'
      -'if=/dev/urandom'

  condition:1 of selection_*
Falsepositives:
  -Legitimate script work
Level: high