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.
Switches
Creates an archive. Used to pack data for staging and exfiltration.
LowExtracts an archive, for example a downloaded second stage.
LowNames the archive file. A path with :streamname targets an alternate data stream.
LowUses gzip compression.
InfoVerbose listing.
InfoCommand 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 regex
tar(\.exe)?\s+.*-[a-z]*f[a-z]*\s+[^\s]+:[^\s\\/]+
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.
- LowCompressed 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
- LowCompressed 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.