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

GTFOBIN Abuse

This note documents detection patterns related to Living off the Land Abuse on Linux systems.


Direct Indicators

SourceGrep Pattern / ArtifactMeaningForensic ValueNotes
Shell historyfind -execCommand execution via native binaryCriticalCommon GTFOBins abuse pattern.
Shell historyawk 'BEGINShell spawn through awkCriticalClassic interpreter abuse.
Shell historytar -cf /dev/nullCommand execution through tar checkpoint abuseCriticalCommon sudo GTFOBins technique.
Shell historyvim -cShell escape via editorCriticalInteractive privilege abuse pattern.
Shell historyless !shShell escape through pagerHighCommon local escalation pattern.
Shell historypython -cInterpreter abuse for shell / file opsCriticalNative interpreter weaponization.
Shell historyperl -eInline command executionHighOften used when bash restricted.
Shell historyopenssl encFile transfer / covert encodingHighNative crypto utility abuse.
Shell historycp /bin/bashBinary cloning for privilege tricksCriticalOften paired with SUID abuse.
Shell historychmod u+sSUID plantingCriticalHigh-confidence privilege abuse.
auditdexecve of unusual admin binariesNative tool abuse evidenceCriticalBest attribution source.
sudo logsAllowed binary abusePrivileged LOL abuseCriticalHigh-signal when sudo present.
journalctlunusual binary invocationProcess cluesHighDepends on host logging depth.
File metadatacopied shell or altered binary modePersistence / escalation artifactCriticalStrong post-abuse evidence.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Native binary used where simpler command expectedOver-engineered shell pathHighSuggests GTFOBins familiarity.
Allowed sudo binary immediately followed by root shellPrivilege abuseCriticalStrong escalation chain.
Unexpected SUID bit on copied binaryEscalation artifactCriticalHigh-confidence malicious action.
Editor or pager invoked briefly before shellEscape behaviorHighCommon hands-on operator pattern.
File read via odd utilitySensitive file access using native toolsHighCredential theft attempt.
Native tools chained rapidlyManual operator living off systemHighNo external payload needed.
Minimal downloader footprintPure LOL behaviorHighHigher stealth intent.
Rare binary usage by service accountSuspicious contextCriticalOften malicious.
Interpreter abuse after sudoStrong escalation indicatorCriticalVery common GTFOBins chain.
SUID plus temp executionPrivilege persistenceCriticalStrong hostile sequence.

Common Tools

ToolUsage
findExecute commands via -exec.
awkShell spawn / file exfiltration.
tarCheckpoint command execution.
vimShell escape or file edit under sudo.
less / morePager shell escape.
pythonShell spawn, file ops, sockets.
perlInline command execution.
cpClone privileged binaries.
chmodSUID manipulation.
opensslEncoding / covert transport.

Relevant Artifacts

ArtifactPath / CommandForensic ValueNotes
Shell history.bash_history, .zsh_historyCriticalPrimary LOL evidence.
Sudo logs/var/log/auth.log, /var/log/secureCriticalPrivileged binary context.
Audit logs/var/log/audit/audit.logCriticalProcess truth.
JournaldjournalctlHighProcess clues.
File modesfind / -perm -4000CriticalDetect new SUID artifacts.
Binary timestampsstatHighDetect copied/altered binaries.
Temp directories/tmp, /var/tmp, /dev/shmHighCloned binaries often staged here.

MITRE ATT&CK References

  • T1211 Exploitation for Defense Evasion
  • T1548 Abuse Elevation Control Mechanism
  • T1059 Command and Scripting Interpreter
  • T1036 Masquerading

Decision Tree

  1. Was native binary abused?

    • Identify unusual command syntax.
  2. Did sudo participate?

    • Check privileged execution path.
  3. Was shell obtained?

    • Look for shell spawn patterns.
  4. Were file permissions changed?

    • Detect SUID or cloned binaries.
  5. Was persistence introduced?

    • Inspect modified binaries and startup paths.
  6. Pivot

    • Binary → known GTFOBins capability.
    • User → privilege context.
    • File → timestamp chain.
  7. Confirm LOL abuse

    • Native binary + shell/persistence outcome = strong living-off-the-land abuse.

Example Detection Templates

Grep

grep -R "find -exec\|awk 'BEGIN\|tar -cf\|vim -c\|less !sh\|python -c\|perl -e" /home /root /tmp /var/tmp 2>/dev/null
grep -R "chmod u+s\|cp /bin/bash" /home /root /tmp /var/tmp 2>/dev/null
grep -R "find \|awk \|tar \|vim \|less \|python \|perl " /home/*/.bash_history /root/.bash_history 2>/dev/null

Journalctl

journalctl | grep -E "find|awk|tar|vim|less|python|perl|chmod"

File Inspection

find / -perm -4000 -type f 2>/dev/null
find /tmp /var/tmp /dev/shm -perm -4000 -type f 2>/dev/null

Sigma

title: Linux Living Off The Land Abuse
id: linux-lol-abuse
status: experimental
description: Detects suspicious native binary abuse patterns associated with GTFOBins techniques
logsource:
  product: linux
detection:
  selection_keywords:
    message|contains:
      - 'find -exec'
      - 'awk'
      - 'tar'
      - 'vim'
      - 'chmod u+s'
  condition: selection_keywords
fields:
  - message
  - hostname
falsepositives:
  - Legitimate administration
level: high
tags:
  - attack.execution
  - attack.privilege_escalation

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Sudo minimizationRestrict dangerous binaries under sudoCriticalRemoves GTFOBins paths.
Binary monitoringAlert on SUID changesCriticalStrong invariant detection.
AuditdTrack execve of risky binariesHighStrong attribution.
Least privilegeRemove unnecessary interpreters for service usersHighShrinks LOL surface.
File integrity monitoringWatch privileged binariesHighDetects binary cloning / tampering.
Baseline allowed admin toolingKnow legitimate binary useHighImproves anomaly detection.

Fast Triage Checks

QuestionCommand / ArtifactWhy It Matters
Was native binary abused?grep shell historyIdentify LOL pattern.
Was sudo involved?grep sudo logsPrivilege context.
Any new SUID file?find SUID binariesEscalation artifact.
Was shell spawned?inspect command chainConfirms abuse outcome.
Any cloned shell binary?stat suspicious binariesPersistence clue.
Did abuse touch sensitive files?inspect nearby commandsCredential access possibility.

High Value Grep Strings

PatternWhy It Matters
find -execCommand execution abuse.
awk 'BEGINShell spawn pattern.
tar -cfCheckpoint abuse path.
vim -cEditor shell escape.
less !shPager shell escape.
python -cNative interpreter abuse.
perl -eAlternate interpreter abuse.
chmod u+sSUID privilege planting.
cp /bin/bashShell cloning for escalation.

Analyst Notes

ScenarioInterpretation
Native tool only, no payloadsHigher stealth operator behavior.
Sudo binary then root shellStrong GTFOBins escalation.
New SUID shell in temp pathVery high-confidence malicious action.
Vim or less briefly openedPossible shell escape.
Multiple native tools chainedManual operator adaptation.
LOL abuse after SSH footholdCommon privilege escalation path.