Module 08 // local control

Enumerate, prove, record.

Build an evidence-backed path from the current identity to the lab objective. Check configuration, privileges and trust boundaries methodically before attempting a change.

LinuxWindowsleast changeevidence first
Authorized labs only. Run these checks only on the assigned HTB/CTF host or another system you are explicitly permitted to test. Confirm the active target, preserve evidence, and stop when the lab objective is met.

Establish the baseline

Record who you are, where you are, and what changed during access. A small baseline makes later findings reproducible and helps prevent evidence from being attached to the wrong target.

Identity

Capture the user, groups, effective privileges, hostname, OS build and architecture. Note whether the shell is interactive, restricted, containerized or remote.

Exposure

List local interfaces, listening services and high-value processes. Compare them with external recon rather than assuming both views are identical.

Evidence

Save command output beneath the private target tree. Record interpretation separately so raw output remains available for review.

Change budget

Prefer read-only checks first. Before writing a file, starting a service or changing configuration, know how you will reverse it.

pe status
pe note add -t "local baseline" -b "Initial identity, host and access path"
umask 077

Linux triage

id
hostname
uname -a
cat /etc/os-release
ip -br address
ss -lntup
ps aux --forest

sudo -l
find / -xdev -perm -4000 -type f 2>/dev/null
find / -xdev -perm -2000 -type f 2>/dev/null
getcap -r / 2>/dev/null
systemctl list-timers --all
ls -la /etc/cron* /var/spool/cron 2>/dev/null

Read the exact sudo rule, binary version and execution context. A SUID bit, capability or timer is a lead—not proof—until its ownership, arguments and writable dependencies are understood.

Linux checklist

  • Review sudo -l for permitted commands, wildcards, preserved environment variables and secure-path behavior.
  • Compare SUID/SGID programs and file capabilities with the base OS; inspect unusual owners, locations and versions.
  • Inspect systemd units, timers, cron entries and scripts for writable files, relative paths or attacker-controlled input.
  • Check running services and process arguments for configuration paths. Do not copy secrets into public notes or shell history.
  • Review writable directories in privileged execution paths, including application plug-in, backup and deployment locations.
  • Identify container or virtualization context. Membership in groups such as docker or lxd changes the trust boundary.
  • Inspect mounted filesystems, NFS options and shared data for unintended privilege boundaries; keep the lab scope in view.
  • Treat kernel exploits as a last resort: confirm the exact build, mitigations, architecture and lab rules before considering one.
Validate the whole chain. A writable file matters only when a privileged process actually consumes it in a controllable way.

Windows triage

whoami /all
hostname
systeminfo
ipconfig /all
netstat -ano
tasklist /svc

whoami /priv
schtasks /query /fo LIST /v
sc.exe query state= all
powershell -NoProfile -Command "Get-CimInstance Win32_Service | Select-Object Name,StartName,State,PathName"

Correlate service PIDs, accounts and executable paths. Use PowerShell/CIM where legacy utilities are absent, and save long output to the target workspace for offline review.

Windows checklist

  • Review token privileges and group memberships; distinguish present, disabled and enabled privileges.
  • Inspect service accounts, binary paths and permissions. An unquoted path is only actionable when path placement and restart control align.
  • Review scheduled tasks, their principals, triggers, actions and writable scripts or working directories.
  • Inspect application installers, update agents and autoruns for privileged execution of user-controlled content.
  • Check local and domain group membership, accessible shares and stored connection material without broadening beyond the assigned host.
  • Locate PowerShell history and application configuration carefully; redact credentials from screenshots and writeups.
  • Record endpoint protection, language mode and architecture before choosing tooling. A blocked tool is not a reason to disable controls indiscriminately.
  • Prefer reversible proof. Avoid changing passwords, deleting services or weakening security settings unless the lab explicitly requires it.

Use automation deliberately

Enumeration scripts can accelerate coverage, but they also generate noise and may collect secrets. Obtain tools from a trusted lab source, verify the expected hash, read their options, and run them only after manual baseline checks.

Linux helper

sha256sum linpeas.sh
less linpeas.sh
chmod 700 linpeas.sh
./linpeas.sh | tee scans/linpeas.txt

Windows helper

Get-FileHash .\winPEAS.exe -Algorithm SHA256
.\winPEAS.exe | Tee-Object -FilePath winpeas.txt

Review findings manually. “Interesting” output is a queue of hypotheses, not an instruction to execute every suggested technique.

Prove and close

  1. State the hypothesis

    Identify the privileged component, controllable input, required trigger and expected result.

  2. Choose minimal proof

    Demonstrate the boundary with the smallest reversible change allowed by the lab.

  3. Capture evidence

    Record commands, versions, relevant permissions and output without publishing secrets.

  4. Restore and clean

    Remove temporary tooling, undo configuration changes, stop listeners and verify the host remains usable.

pe note add -t "privilege path" -b "Component, condition, proof and cleanup"
	find scans -maxdepth 1 -type f -not -name SHA256SUMS -exec sha256sum {} + > scans/SHA256SUMS
pe backup