Lab Complete!

You escalated privileges on both Linux and Windows.

LABS / privilege escalation
INTERMEDIATE
Tasks
What is privilege escalation?

You land on a system as a low-privileged user. Privilege escalation means finding a misconfiguration or bug that lets you become a more powerful user — usually root on Linux or SYSTEM/Administrator on Windows.

Think of an office building: You have a keycard for your own floor. Privesc is finding a door someone forgot to lock, or a master key left somewhere, that gets you into the executive floor.
Linux: check your sudo rights
sudo -l # what can I run as another user?

Admins sometimes let a user run one program as root with NOPASSWD, thinking it's harmless. If that program can spawn a shell or write files, it usually isn't. GTFOBins is a well-known reference listing exactly how to abuse common programs this way.

sudo find . -exec /bin/sh \; # find can spawn a root shell if sudo'd
Other common Linux vectors
VectorIdea
SUID binariesfind / -perm -4000 finds programs that run as their owner, not you
Cron jobsA root cron job that runs a script you can edit runs your code as root
Writable PATHIf you can write earlier in $PATH, you can shadow a command root runs
Kernel exploitsOutdated kernels have known public exploits
Windows: check your privileges
whoami /priv # list enabled privileges sc qc servicename # view a service's config icacls "C:\path" # who can write where

A classic bug is an unquoted service path. If a service's path is C:\Program Files\Vuln Service\app.exe without quotes, and a folder along that path is writable, Windows will try C:\Program.exe first — if you plant a file there, it runs when the service (often running as SYSTEM) starts.

Other common Windows vectors
VectorIdea
Weak service permissionsIf you can reconfigure a SYSTEM service's binary, you control what it runs
AlwaysInstallElevatedA registry setting that lets any .msi install as SYSTEM
Scheduled tasksA task run as SYSTEM pointing at a file you can overwrite
Token impersonationPrivileges like SeImpersonatePrivilege can be abused to become SYSTEM
Permission first: Attempting privilege escalation on systems you don't own or lack written authorization for is illegal in most places. This lab is a simulated terminal, not a real system.
Mission: You have a low-privilege shell on a Linux box and a low-privilege login on a Windows box. Escalate on both.
1
Linux: check sudo rightsLINUX
In the Linux terminal, run sudo -l and spot the risky entry.
2
Linux: exploit itLINUX
Use the allowed program to spawn a root shell, GTFOBins-style.
3
Windows: find the weak serviceWINDOWS
Switch to the Windows terminal. Check vulnsvc's config and its folder permissions.
4
Windows: hijack itWINDOWS
Plant a file where the unquoted path breaks, restart the service, then read the Administrator's flag file.
Try first, then peek. Hints nudge you without the exact answer.
Look for a line with NOPASSWD — that program runs as root with no password check.
Many programs support -exec or similar to run another command. Try sudo find . -exec /bin/sh -c whoami \;.
sc qc vulnsvc shows the BINARY_PATH_NAME. Look closely for missing quotes around a path containing spaces.
Windows tries each space-separated segment of an unquoted path as its own executable. Try copy evil.exe "C:\Program.exe", then sc stop vulnsvc and sc start vulnsvc.
Stuck after trying? Reveal the full walkthrough.
bob@linserver ~
bob@linserver:~$
WINSERVER\bob
C:\Users\bob>