Join our Newsletter — 33% off our NHI Course

xattr (macOS LOOBin)

xattr is a macOS command-line tool for viewing and changing extended file attributes, and it can be abused as a living-off-the-land binary for stealth or persistence. Attackers may use it to hide provenance data, alter quarantine attributes or stage files without obvious malware. Defenders should monitor unexpected attribute changes and suspicious execution context.

What xattr does on macOS

xattr is the macOS utility for inspecting and modifying extended file attributes, which are metadata fields attached to files beyond the visible filename, size, and timestamps. On its own, that makes it a normal administrative tool; in abuse scenarios, the same capability can be used to change trust-relevant file metadata without touching the file contents.

Extended attributes are useful because macOS and many applications store provenance, quarantine, and policy-related markers there. That means the tool sits at the boundary between routine file management and security-relevant metadata control, especially when scripts, installers, or downloaded files are involved.

Why xattr is attractive as a living-off-the-land binary

Like other living-off-the-land binaries, xattr can help an actor blend malicious activity into legitimate administration. A defender may see a familiar macOS utility rather than an unknown payload, while the actual change affects how the system or an application interprets a file.

This matters because attackers do not always need to overwrite a file to change its security posture. They may alter quarantine attributes, remove or obscure provenance signals, or stage files in ways that look operationally ordinary. For broader context on living-off-the-land tradecraft, see the Living off the Land Guide.

How extended-attribute abuse changes file trust

Extended attributes can influence whether a file is flagged, blocked, opened, or treated as newly downloaded. When xattr is used to change those markers, the security issue is not the metadata itself, but the downstream effect on user prompts, execution decisions, and forensic visibility.

That makes xattr useful for stealth and persistence techniques that rely on low-friction access to existing files. An attacker can preserve the file payload while modifying the surrounding metadata that often helps security tools, users, and incident responders understand what the file is and where it came from.

What defenders should look for

Unexpected xattr activity is most concerning when it appears in the context of downloads, scripts, login items, installer workflows, or user-level persistence. The signal is strongest when the process tree, parent process, or execution context does not match ordinary admin work.

Monitoring should focus on who invoked the utility, which files were touched, and whether the attribute changes line up with normal software installation or file management. Attribute changes by themselves are not always malicious, but they become far more meaningful when paired with suspicious execution paths or later file execution. The broader detection problem is similar to other macOS tradecraft that abuses trusted utilities, including cases where local activity steals or manipulates access material and user context, as described in Meta Muse agent hijack 2026.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while NIST CSF 2.0 sets the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
MITRE ATT&CK T1218 — System Binary Proxy Execution xattr is a trusted macOS utility abused as a living-off-the-land binary.
T1036 — Masquerading Abuse of legitimate utilities and metadata changes can help malicious activity blend in.
Recommendation — Map suspicious xattr use to T1218 and hunt for trusted-binary abuse in endpoint telemetry. Correlate trusted-utility execution with suspicious file metadata changes and investigate masquerading.
NIST CSF 2.0 DE.CM-09 — Monitoring for Unauthorized Personnel, Connections, Devices, and Software Unexpected attribute changes require continuous monitoring of file and process activity.
Recommendation — Monitor file attribute changes and anomalous process execution to detect abuse early.