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

Privilege Escalation Enumeration

This note documents detection patterns related to Linux Privilege Escalation Enumeration on Linux systems.


Direct Indicators

SourceGrep Pattern / ArtifactMeaningForensic ValueNotes
Shell historysudo -lEnumerate sudo rightsCriticalHighest-value privilege recon command.
Shell historyfind / -perm -4000SUID binary huntCriticalClassic escalation enumeration.
Shell historyfind / -perm -2000SGID binary huntHighSecondary privilege surface discovery.
Shell historygetcap -r /Capability enumerationCriticalMature privilege escalation recon.
Shell historyls -la /etc/sudoers.dSudo policy inspectionCriticalPrecise privilege mapping.
Shell historycat /etc/sudoersSudo policy reviewCriticalStrong escalation intent.
Shell historyuname -aKernel version discoveryCriticalExploit path selection.
Shell historycat /etc/os-releaseDistribution discoveryHighExploit compatibility check.
Shell historyps auxPrivileged process reviewHighService escalation target search.
Shell historyenvEnvironment leak reviewHighPath / variable abuse opportunities.
Shell historylinpeasAutomated privilege auditCriticalStrong operator indicator.
Shell historylinux-exploit-suggesterExploit recommendationCriticalStrong escalation preparation.
auditdprivilege recon commandsProcess attributionCriticalBest attribution if enabled.
File readssudoers / capability filesHighStrong escalation context.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Enumeration immediately after footholdEscalation preparationCriticalCommon attacker progression.
uname -a then exploit downloadKernel exploit chainCriticalStrong hostile sequence.
SUID hunt plus GTFOBins abuseEscalation chainCriticalStrong evidence.
Capability review plus interpreter abuseMature operator behaviorCriticalHigher technical skill.
linpeas under temp pathAutomated host auditCriticalVery strong intrusion signal.
Sudoers read under service accountSuspicious contextCriticalExploitation shell likely.
Process review before service abusePrivileged target selectionHighCommon escalation prep.
Env review before PATH hijackPrecise escalation pathHighSkilled operator clue.
Enumeration plus cleanupMature intrusion behaviorHighStrong operational discipline.
Minimal commands but exact checksMature hands-on-keyboardHighStrong operator signal.

Common Tools

ToolUsage
sudo -lSudo privilege discovery.
find / -perm -4000SUID hunting.
getcap -r /Capability enumeration.
uname -aKernel identification.
linpeasAutomated privilege enumeration.
linux-exploit-suggesterKernel exploit suggestions.

Relevant Artifacts

ArtifactPath / CommandForensic ValueNotes
Sudo policy/etc/sudoers, /etc/sudoers.d/CriticalEscalation surface.
Capability metadatagetcap outputCriticalModern privilege surface.
SUID binariesfile systemCriticalEscalation surface.
Kernel versionuname -aCriticalExploit context.
Shell history.bash_history, .zsh_historyCriticalEnumeration evidence.
Audit logs/var/log/audit/audit.logCriticalProcess attribution.
Temp tools/tmp, /var/tmp, /dev/shmHighlinpeas / helper tools often staged here.

MITRE ATT&CK References

  • T1068 Exploitation for Privilege Escalation
  • T1548 Abuse Elevation Control Mechanism
  • T1082 System Information Discovery

Decision Tree

  1. Was privilege recon performed?

    • Search shell history and audit logs.
  2. Which privilege surface?

    • Sudo, SUID, capabilities, kernel.
  3. Was automation used?

    • linpeas, exploit suggesters.
  4. Did recon lead to escalation?

    • sudo abuse, GTFOBins, kernel exploit.
  5. Is context suspicious?

    • Service account, web shell, fresh foothold.
  6. Pivot

    • SUID list → abused binary.
    • Kernel version → exploit path.
    • Sudo policy → exact abuse route.
  7. Confirm escalation reconnaissance

    • Privilege checks + suspicious context + follow-on abuse = strong escalation finding.

Example Detection Templates

Grep

grep -R "sudo -l\|find / -perm -4000\|find / -perm -2000\|getcap -r /\|cat /etc/sudoers\|uname -a\|cat /etc/os-release\|linpeas\|linux-exploit-suggester" /home/*/.bash_history /root/.bash_history 2>/dev/null
grep -R "ls -la /etc/sudoers.d\|ps aux\|env" /home/*/.bash_history /root/.bash_history 2>/dev/null

Journalctl

journalctl | grep sudo

File Inspection

find / -perm -4000 2>/dev/null
getcap -r / 2>/dev/null

Sigma

title: Linux Privilege Escalation Enumeration
id: linux-privilege-escalation-enumeration
status: experimental
description: Detects suspicious Linux privilege escalation reconnaissance activity
logsource:
  product: linux
detection:
  selection_keywords:
    message|contains:
      - 'sudo -l'
      - 'find / -perm -4000'
      - 'getcap -r /'
      - 'linpeas'
  condition: selection_keywords
fields:
  - message
  - hostname
falsepositives:
  - Legitimate administration
level: high
tags:
  - attack.discovery
  - attack.privilege_escalation

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Sudo minimizationRestrict dangerous sudo entriesCriticalMajor escalation reduction.
Capability reviewRemove unnecessary capsHighShrinks modern privilege surface.
SUID reviewBaseline and minimize SUID binariesCriticalCore prevention.
AuditdTrack privilege recon commandsHighStrong attribution.
Temp monitoringDetect linpeas / helper toolsHighStrong intrusion clue.

Fast Triage Checks

QuestionCommand / ArtifactWhy It Matters
Was sudo checked?grep sudo -lImmediate escalation intent.
Were SUID binaries hunted?grep find permsClassic escalation clue.
Were capabilities reviewed?grep getcapMature operator signal.
Was kernel checked?grep uname -aExploit prep clue.
Did recon lead to abuse?correlate next commandsEscalation chain.

High Value Grep Strings

PatternWhy It Matters
sudo -lHighest-value privilege check.
find / -perm -4000SUID hunt.
getcap -r /Capability hunt.
uname -aKernel exploit prep.
linpeasAutomated privilege audit.
linux-exploit-suggesterExploit prep.

Analyst Notes

ScenarioInterpretation
sudo -l immediately after footholdStrong escalation intent.
SUID hunt plus GTFOBinsDirect escalation chain.
linpeas in tempVery strong intrusion evidence.
Capability review under www-dataMature operator behavior.
Kernel check then payload downloadExploit preparation likely.
Minimal exact checksSkilled hands-on-keyboard signal.