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

Payload Download and Staging

This note documents detection patterns related to Payload Download and Staging on Linux systems.


Direct Indicators

SourceGrep Pattern / ArtifactMeaningForensic ValueNotes
Shell historycurl httpRemote payload retrievalCriticalVery common first-stage delivery.
Shell historywget httpRemote payload retrievalCriticalCommon operator behavior.
Shell historycurl -OFile downloaded directlyHighOften leaves staged binary locally.
Shell historywget -OExplicit output file chosenCriticalOften reveals attacker naming.
Shell history`curlbash`Inline remote executionCritical
Shell history`wget -O-sh`Streamed executionCritical
Shell historychmod +xPayload prepared for executionCriticalStrong staging continuation.
Shell history./payloadLocal staged binary executedCriticalDirect post-download execution.
Shell historybase64 -dPayload decoded locallyHighCommon obfuscation step.
Shell historytar, unzipArchive extractionHighMulti-file staging.
auditdexecve of curl/wget/chmodProcess-level staging evidenceCriticalBest attribution if enabled.
File timestampsnew file in temp dirsPayload materializedCriticalStrong timeline anchor.
Network telemetryoutbound HTTP/HTTPS fetchRetrieval confirmedCriticalSupports command evidence.
journalctldownloader invocationJournald process evidenceHighDepends on logging setup.
EDR telemetrydownloader → shell/binary chainExecution lineageCriticalStrong staged compromise indicator.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Download immediately after SSH loginManual operator stagingCriticalCommon foothold progression.
Download into /tmpDisposable payload placementCriticalHighly common attacker pattern.
Download into /dev/shmMemory-backed stealth stagingCriticalHigher stealth intent.
Download then chmod then executeFull attacker chainCriticalVery high confidence malicious sequence.
Renamed payload to service-like nameCamouflageHighCommon stealth behavior.
Hidden file staging.cache, .sys, dot-prefixed namesHighEvasion attempt.
Download followed by reverse shellStage-to-shell chainCriticalStrong intrusion evidence.
Download from raw IPDirect operator infraHighOften suspicious.
Download from paste/raw servicesScripted stagingHighCommon attacker convenience.
Archive then extraction then service installMulti-stage persistenceCriticalAdvanced staging path.

Common Tools

ToolUsage
curlPrimary payload retrieval utility.
wgetCommon alternative retriever.
scpFile transfer from attacker host.
base64Encoded payload transport.
tar / unzipMulti-file extraction.
chmodExecution preparation.
python -m http.serverCommon attacker-hosted simple delivery source.

Relevant Artifacts

ArtifactPath / CommandForensic ValueNotes
Shell history.bash_history, .zsh_historyCriticalPrimary staging evidence.
Temp directories/tmp, /var/tmp, /dev/shmCriticalPrimary payload locations.
Audit logs/var/log/audit/audit.logCriticalProcess attribution.
Network logsproxy/firewall/netflowCriticalDownload confirmation.
File metadatastatCriticalCreation timeline.
JournaldjournalctlHighProcess clues.
Extracted archivestemp dirs / home dirsHighSecondary stage content.
Web roots/var/www, app dirsHighDownload may originate from web foothold.

MITRE ATT&CK References

  • T1105 Ingress Tool Transfer
  • T1059 Command and Scripting Interpreter
  • T1027 Obfuscated Files or Information

Decision Tree

  1. Was remote retrieval executed?

    • Identify curl, wget, scp, base64 activity.
  2. Where was payload written?

    • Determine temp, home, service path.
  3. Was payload made executable?

    • Check chmod and file mode changes.
  4. Was payload executed?

    • Shell history, auditd, process traces.
  5. Was staging followed by persistence?

    • Inspect cron, services, keys, users.
  6. Pivot

    • Download source → operator infra.
    • File path → execution chain.
    • Timestamp → correlate with access event.
  7. Confirm staging

    • Downloader + file creation + chmod + execution = strong payload staging.

Example Detection Templates

Grep

grep -R "curl http\|wget http\|curl -O\|wget -O\|curl | bash\|wget -O-" /home /root /tmp /var/tmp 2>/dev/null
grep -R "chmod +x\|base64 -d\|tar \|unzip " /home /root /tmp /var/tmp 2>/dev/null
grep -R "curl\|wget" /home/*/.bash_history /root/.bash_history 2>/dev/null

Journalctl

journalctl | grep -E "curl|wget|chmod|base64"

File Inspection

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

Sigma

title: Linux Payload Download and Staging
id: linux-payload-download-staging
status: experimental
description: Detects payload retrieval and local staging behavior on Linux systems
logsource:
  product: linux
detection:
  selection_keywords:
    message|contains:
      - 'curl'
      - 'wget'
      - 'chmod +x'
      - 'base64 -d'
  condition: selection_keywords
fields:
  - message
  - hostname
falsepositives:
  - Legitimate package retrieval
level: high
tags:
  - attack.command_and_control
  - attack.t1105

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Egress filteringRestrict arbitrary outbound HTTP/HTTPSCriticalStops many delivery paths.
Temp execution controlLimit execution from temp dirsCriticalHigh-value prevention.
AuditdMonitor downloader and chmod executionHighStrong process visibility.
Proxy controlsForce authenticated outbound retrievalHighImproves attribution.
File monitoringWatch temp directories for executablesHighStrong invariant detection.
Least privilegeRestrict service account shell utility accessHighReduces staging options.

Fast Triage Checks

QuestionCommand / ArtifactWhy It Matters
Was payload downloaded?grep curl/wgetEstablish delivery.
Where is payload now?inspect temp dirsLocate executable.
Was it made executable?find executable temp filesDetect staging completion.
Was it executed?shell history / auditdConfirm compromise progression.
Was source external suspicious?inspect URL/IPInfra clue.
Did persistence follow?inspect cron/services/keysStabilization evidence.

High Value Grep Strings

PatternWhy It Matters
curl httpDirect remote retrieval.
wget httpDirect remote retrieval.
curl -OFile output staging.
wget -OExplicit output naming.
`curlbash`
wget -O-Stream execution.
chmod +xExecution preparation.
base64 -dDecoding staged content.
tarArchive extraction.
unzipArchive extraction.

Analyst Notes

ScenarioInterpretation
Curl + chmod + executeVery strong malicious staging chain.
Download into /dev/shmHigher stealth intent.
Payload named like serviceCamouflage likely.
Download then reverse shellStage-to-operator progression.
Downloader without file leftInline execution likely.
Base64 decode before executeObfuscation present.