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

Memory Only Execution

This note documents detection patterns related to Memory Only Execution on Linux systems.


Direct Indicators

SourceGrep Pattern / ArtifactMeaningForensic ValueNotes
Shell history/dev/shm/ executionIn-memory or tmpfs executionCriticalStrong stealth indicator.
Shell historymemfd_create usageFileless execution primitiveCriticalAdvanced tradecraft.
Shell history`curl ...bash`Direct pipe executionCritical
Shell history`wget -qO- ...sh`Streamed payloadCritical
Shell historypython -c exec(Inline memory executionCriticalNo file artifact required.
Shell history`base64 -dbash`Obfuscated fileless executionCritical
Deleted running binary/proc/<pid>/exe -> (deleted)Memory-resident payloadCriticalVery strong indicator.
Process pathbinary from tmpfsCritical/dev/shm, tmpfs execution clue.
auditdexecute from tmpfsCriticalStrong attribution.
lsofdeleted executable still openCriticalRuntime truth.
mapsanonymous executable mappingCriticalAdvanced memory clue.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Payload executed then deletedMemory-resident behaviorCriticalStrong stealth sequence.
/dev/shm binary plus outbound connectionFileless C2CriticalVery high severity.
Deleted process under service accountSuspicious contextCriticalOften exploitation shell.
Pipe execution after footholdScriptless payload stageCriticalStrong intrusion chain.
No disk file but live suspicious PIDMemory-only tradecraftCriticalRequires live triage.

Common Tools

ToolUsage
/dev/shmTmpfs execution path.
`curlbash`
`wget -qO-sh`
PythonInline fileless execution.
memfd_createAdvanced memory payloads.

Relevant Artifacts

ArtifactPath / CommandForensic ValueNotes
Process links/proc/<pid>/exeCriticalDeleted binary clue.
Process maps/proc/<pid>/mapsCriticalMemory regions.
Open fileslsof -p <pid>CriticalDeleted file handles.
Shell history.bash_historyCriticalLaunch evidence.
Audit logs/var/log/audit/audit.logCriticalAttribution.

MITRE ATT&CK References

  • T1055 Process Injection
  • T1620 Reflective Code Loading
  • T1105 Ingress Tool Transfer

Decision Tree

  1. Was payload executed from tmpfs?
  2. Is executable deleted?
  3. Is process still alive?
  4. Any outbound socket?
  5. Which parent process launched it?

Example Detection Templates

Grep

grep -R "/dev/shm\|curl .*| bash\|wget -qO- .*| sh\|base64 -d .*| bash\|python -c exec" /home/*/.bash_history /root/.bash_history 2>/dev/null

Journalctl

journalctl | grep -E "shm|deleted"

File Inspection

ls -l /proc/*/exe 2>/dev/null | grep deleted
lsof | grep deleted

Sigma

title: Linux Memory Only Execution
id: linux-memory-only-execution
status: experimental
description: Detects suspicious fileless or tmpfs execution on Linux
logsource:
  product: linux
detection:
  selection_keywords:
    message|contains:
      - '/dev/shm'
      - 'curl'
      - 'wget -qO-'
      - 'base64 -d'
  condition: selection_keywords
level: high
tags:
  - attack.execution
  - attack.defense_evasion

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Tmpfs monitoringWatch /dev/shm executionCriticalStrong fileless visibility.
AuditdTrack exec from tmpfsHighAttribution.
Egress filteringLimit streamed payload retrievalCriticalReduces fileless success.