Skip to content
WETNav

Defense evasion · Windows

attrib.exe

Attrib

Shows and changes file attributes. Setting hidden and system on files conceals dropped tooling and staged data from a casual look at a folder.

Legitimate use

Used in scripts to set or clear read-only, hidden, system and archive attributes.

Worst caseMedium

Switches

/h

With +h, sets the hidden attribute, which keeps a file out of default views.

Medium
/s

With +s, sets the system attribute, which hides a file further.

Medium
/r

Sets or clears read-only.

Info
/a

Sets or clears the archive attribute.

Info

Command lines to worry about

  • Medium

    File hidden with attrib

    Setting hidden and system attributes conceals a file from default views. Check what file was hidden and when it was created.

    Detection regexattrib(\.exe)?\s+\+[a-z]*(h\+?s|s\+?h|h|s)\b

    T1564.001

Where it is recorded

  • Security4688Process creation with the full command line, when command-line auditing is enabled.
  • Sysmon1Process creation with command line, hashes and parent process.

Community detections

3 SigmaHQ rules for attrib.exe. The explainer checks every pasted command line against all of them.

  • High
    Set Suspicious Files as System Files Using Attrib.EXE

    Detects the usage of attrib with the "+s" option to set scripts or executables located in suspicious locations as system files to hide them from users and make them unable to be deleted with simple rights. The rule limits the search to specific extensions and directories to avoid FPs

    T1564.001by Nasreddine Bencherchali (Nextron Systems)

  • Medium
    HackTool - Jlaive In-Memory Assembly Execution

    Detects the use of Jlaive to execute assemblies in a copied PowerShell

    T1059.003by Jose Luis Sanchez Martinez (@Joseliyo_Jstnk)

  • Medium
    Hiding Files with Attrib.exe

    Detects usage of attrib.exe to hide files from users.

    T1564.001by Sami Ruohonen

Rules from SigmaHQ (rules/windows/process_creation), Detection Rule License (DRL) 1.1. Each rule links to its source and credits its authors.