Skip to content
WETNav

Collection · Windows · LOLBAS

tar.exe

Tar (Windows)

The built-in bsdtar on modern Windows. Used to pack collected data for exfiltration and to extract downloaded archives, and it can write to or read from an alternate data stream.

Legitimate use

Used to create and extract tar and other archives from the command line.

Worst caseMedium

Switches

-c

Creates an archive. Used to pack data for staging and exfiltration.

Low
-x

Extracts an archive, for example a downloaded second stage.

Low
-f<value>

Names the archive file. A path with :streamname targets an alternate data stream.

Low
-z

Uses gzip compression.

Info
-v

Verbose listing.

Info

Command lines to worry about

  • Medium

    Archive read from or written to an alternate data stream

    tar with an archive path of the form file:stream hides an archive in an NTFS alternate data stream, which stays out of normal directory views.

    Detection regextar(\.exe)?\s+.*-[a-z]*f[a-z]*\s+[^\s]+:[^\s\\/]+

    T1564.004

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.
  • Sysmon11The archive file created when packing data.

Community detections

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

  • Low
    Compressed File Creation Via Tar.EXE

    Detects execution of "tar.exe" in order to create a compressed file. Adversaries may abuse various utilities to compress or encrypt data before exfiltration.

    T1560T1560.001by Nasreddine Bencherchali (Nextron Systems), AdmU3

  • Low
    Compressed File Extraction Via Tar.EXE

    Detects execution of "tar.exe" in order to extract compressed file. Adversaries may abuse various utilities in order to decompress data to avoid detection.

    T1560T1560.001by AdmU3

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