Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / LINUX / EXECUTION

Suspicious Archive and Exfiltration Prep

This note documents detection patterns related to Suspicious Archive and Exfiltration Prep on Linux systems.


Direct Indicators

SourceGrep Pattern / ArtifactMeaningForensic ValueNotes
Shell historytar -czfArchive creationCriticalCommon pre-exfiltration packaging.
Shell historyzip -rRecursive archiveCriticalFrequent attacker packaging method.
Shell historygzipCompressionHighOften paired with staging.
Shell historybase64Encoding for transportCriticalCommon obfuscation / transport prep.
Shell historysplit -bChunking large archiveCriticalStrong exfil preparation indicator.
Shell historyscp archiveArchive transferCriticalDirect exfil path.
Shell historycurl -FUpload via HTTPCriticalStrong exfiltration pattern.
Shell historywget --post-fileUpload by POSTCriticalLess common but strong signal.
Shell historyopenssl encArchive encryptionCriticalConcealed exfil prep.
Temp directoriesnew archive in /tmpStaged packageCriticalCommon attacker staging zone.
Hidden archive.tar.gz, .zip in hidden dirConcealed stagingHighStealth preparation.
File timestampsrecent archive creationTimeline anchorCriticalCorrelates with compromise phase.
auditdarchive tool executionProcess attributionCriticalBest attribution if enabled.
Network logsarchive transferred outwardCriticalConfirms exfil path.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Archive after sensitive file accessCredential/data packagingCriticalStrong theft sequence.
Archive in temp plus outbound socketExfil stagingCriticalStrong compromise signal.
Hidden encrypted archiveDelayed exfilCriticalOperator stealth.
Split archive chunksLarge data handlingCriticalMature operator behavior.
Archive named like backupCamouflageHighCommon stealth pattern.
Archive created by service accountSuspicious contextCriticalOften exploitation context.
Archive removed quicklyCleanup after transferHighCommon exfil discipline.
Base64 after archiveAlternate transfer methodCriticalStrong encoded exfil pattern.
Archive plus scp to internal hostLateral stagingHighMay precede exfil elsewhere.
Root-owned archive in tempHigh severityCriticalPrivileged data theft likely.

Common Tools

ToolUsage
tarPrimary archive creation.
zipRecursive packaging.
gzipCompression.
base64Encoding archive content.
splitChunking archives.
scpArchive transfer.
curl -FHTTP upload.
openssl encEncryption before transfer.

Relevant Artifacts

ArtifactPath / CommandForensic ValueNotes
Temp archives/tmp, /var/tmp, /dev/shmCriticalPrimary staging zone.
Hidden archiveshidden dirs/filesHighConcealed packaging.
Sensitive source filescompare archive inputsCriticalData theft scope.
Shell history.bash_history, .zsh_historyCriticalPackaging commands.
Audit logs/var/log/audit/audit.logCriticalProcess attribution.
Network logsscp/http transferCriticalExfil confirmation.
File metadatastatCriticalTimeline truth.

MITRE ATT&CK References

  • T1560 Archive Collected Data
  • T1560.001 Archive via Utility
  • T1041 Exfiltration Over C2 Channel

Decision Tree

  1. Was archive created?

    • Identify tar, zip, gzip, split usage.
  2. What was archived?

    • Sensitive files, configs, keys, logs.
  3. Where is archive located?

    • Temp, hidden, home, root.
  4. Was archive transferred?

    • scp, curl, sockets, logs.
  5. Was archive removed?

    • Missing file but command history remains.
  6. Pivot

    • Archive → timestamps.
    • Source files → theft scope.
    • Destination → exfil endpoint.
  7. Confirm exfil prep

    • Archive + sensitive inputs + transfer signal = strong data staging finding.

Example Detection Templates

Grep

grep -R "tar -czf\|zip -r\|gzip\|base64\|split -b\|scp .*tar\|curl -F\|wget --post-file\|openssl enc" /home/*/.bash_history /root/.bash_history 2>/dev/null
find /tmp /var/tmp /dev/shm /home /root -name "*.tar*" -o -name "*.zip" 2>/dev/null

Journalctl

journalctl | grep -E "tar|zip|gzip|scp|curl"

File Inspection

find /tmp /var/tmp /dev/shm -type f -printf '%TY-%Tm-%Td %TT %p\n' 2>/dev/null | sort
file /tmp/* /var/tmp/* /dev/shm/* 2>/dev/null

Sigma

title: Linux Suspicious Archive and Exfiltration Prep
id: linux-archive-exfil-prep
status: experimental
description: Detects suspicious archive creation and packaging behavior preceding exfiltration
logsource:
  product: linux
detection:
  selection_keywords:
    message|contains:
      - 'tar -czf'
      - 'zip -r'
      - 'base64'
      - 'curl -F'
  condition: selection_keywords
fields:
  - message
  - hostname
falsepositives:
  - Legitimate backup operations
level: high
tags:
  - attack.collection
  - attack.t1560

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Egress filteringRestrict arbitrary outbound transferCriticalReduces archive exfil paths.
File monitoringWatch temp archive creationCriticalStrong invariant detection.
AuditdTrack archive utilitiesHighStrong attribution.
Sensitive file controlsReduce readable sensitive scopeHighShrinks theft surface.
Temp reviewInspect temp for archivesHighHigh-value forensic check.

Fast Triage Checks

QuestionCommand / ArtifactWhy It Matters
Was archive created?grep historyImmediate packaging check.
Which archive is newest?sort timestampsTimeline anchor.
What files entered archive?inspect source commandsTheft scope.
Was archive transferred?scp / curl / socketsExfil proof.
Is archive hidden?inspect hidden dirsStealth clue.
Was archive deleted?missing file + command trailCleanup clue.

High Value Grep Strings

PatternWhy It Matters
tar -czfPrimary archive creation.
zip -rRecursive packaging.
gzipCompression.
base64Encoded transport prep.
split -bChunking.
curl -FHTTP upload.
openssl encEncryption before exfil.

Analyst Notes

ScenarioInterpretation
Shadow + tar + scpStrong credential theft chain.
Hidden encrypted archiveDelayed stealth exfil likely.
Split chunks in tempLarge data staging.
Archive named backupCamouflage likely.
Archive removed quicklyTransfer then cleanup.
Root archive in tempHigh-severity data theft candidate.