Privilege Escalation and Lateral Movement: The Defender's View

An attacker rarely gets everything on the first try. A phishing click gives a foothold as an ordinary user on one machine. What turns that foothold into a serious breach is what happens next: gaining higher privileges (privilege escalation) and moving to other systems (lateral movement). Understanding these stages shows defenders where to place controls so that one compromised laptop does not become a compromised company. This lesson explains the concepts, the common weaknesses that make them possible and the defences, with lab exercises focused on auditing and hardening.

The Big Picture

StageGoalMITRE ATT&CK tactic
Initial accessGet a first footholdInitial Access
Privilege escalationGain higher rights (administrator, root, domain admin)Privilege Escalation
Credential accessObtain passwords, hashes, tokens or keysCredential Access
DiscoveryLearn what else is on the networkDiscovery
Lateral movementReach other systems using stolen accessLateral Movement
PersistenceKeep access after reboots or password changesPersistence

Real attackers loop through these stages many times. The earlier you break the chain, the smaller the damage.

Privilege Escalation: Vertical and Horizontal

  • Vertical escalation: a low-privilege account gains higher privileges, such as a normal user becoming administrator.
  • Horizontal escalation: an account gains access to other users’ data at the same level, such as viewing another customer’s records.

Why escalation is possible: common root causes

WeaknessLinux exampleWindows exampleDefence
Over-permissive sudo or admin rightsA user may run an editor or interpreter as root through sudoEveryday accounts in the local Administrators groupLeast privilege, review sudoers and group membership
Misconfigured SUID/SGID or servicesUnexpected SUID binaries that can launch shellsServices running as SYSTEM with writable pathsAudit regularly, restrict file permissions
Weak file or folder permissionsWorld-writable scripts run by root cron jobsWritable program folders or unquoted service pathsCorrect ACLs, integrity monitoring
Unpatched kernel or driver flawsLocal kernel vulnerabilitiesLocal privilege flaws in drivers and servicesFast patching, remove unused drivers
Credentials stored carelesslyPasswords in shell history, config files, scriptsPasswords in scripts, shares or memorySecrets managers, no hard-coded credentials
Excessive cloud permissionsOver-broad IAM rolesOver-privileged service principalsLeast-privilege roles, regular permission reviews

Lateral Movement: How One Machine Becomes Many

After gaining credentials or tokens, attackers use legitimate administration channels to hop between systems, since this blends in with normal activity. Common routes include:

  • Remote administration protocols such as RDP, SSH, SMB, WinRM and remote management tools.
  • Reusing the same local administrator password across many machines.
  • Stolen authentication material, such as password hashes, Kerberos tickets or cloud tokens, being replayed.
  • Misconfigured trust relationships between networks, domains or cloud accounts.
  • Abusing software deployment and management systems that already have broad access.

The defensive insight is that these paths rely on trust you granted. Segmentation, unique credentials and tiered administration remove the paths.

Defence in Depth Against Escalation and Movement

  1. Least privilege everywhere. Daily-use accounts should not be administrators. Use just-in-time elevation for admin tasks.
  2. Unique local administrator passwords per machine, managed by a tool such as Microsoft LAPS (or Windows LAPS) so one stolen password does not open every system.
  3. Tiered administration. Domain-level admin accounts log in only to domain controllers and dedicated admin workstations, never to ordinary user PCs.
  4. Network segmentation. Workstations should not be able to reach each other on management ports; see Firewalls, IDS/IPS and Segmentation.
  5. Multi-factor authentication for remote access, admin portals and privileged actions; see Password Security.
  6. Credential hygiene. Protect credential storage (for example, Credential Guard and LSA protection on Windows), disable legacy protocols such as NTLM where possible and prevent cached admin credentials on workstations.
  7. Patch management for kernels, drivers and services.
  8. Monitoring and detection of unusual logons, new admin group members, new services and unusual remote execution; see SIEM, Logging and SOC Operations.

Practice Lab 1: Audit Linux for Escalation Weaknesses (Your Own VM)

These are audit commands. They list configuration so you can fix it. Run them on a lab VM you own.

# Who can use sudo, and for what?
sudo -l
sudo cat /etc/sudoers
ls /etc/sudoers.d/

# Files with the SUID bit set (they run with their owner's rights)
find / -perm -4000 -type f 2>/dev/null

# World-writable files and directories outside /tmp
find / -xdev -type f -perm -0002 2>/dev/null | head -50

# Scheduled jobs run by root
sudo ls -l /etc/cron* /var/spool/cron 2>/dev/null

# Credentials accidentally left around
grep -rIl "password" /home 2>/dev/null | head

For each finding, decide: is it needed? Who owns it? What would happen if an ordinary user could modify it? Compare your SUID list with a known-good baseline from a fresh installation, and remove or restrict anything unexpected.

Practice Lab 2: Audit Windows and Active Directory (Your Own Lab Domain)

# Local administrators
net localgroup Administrators

# Services and the accounts they run as
Get-CimInstance Win32_Service | Select-Object Name, StartName, PathName | Format-Table -AutoSize

# Privileged group members in a lab domain
Get-ADGroupMember "Domain Admins" | Select-Object Name, SamAccountName

# Recent logon events (4624 success, 4625 failure) on a lab machine
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624,4625} -MaxEvents 20

Questions to answer: Is every member of the administrator groups justified? Are there service paths with spaces and no quotes that sit in writable folders? Do any services run as highly privileged accounts without need? Write remediation actions for each.

Practice Lab 3: Build a Detection

  1. Create a new local user in your lab VM and add it to an admin group.
  2. Find the corresponding events (on Windows, event IDs 4720 for account creation and 4732 for a member added to a local group; on Linux, entries in /var/log/auth.log or the journal).
  3. Write a simple alert rule in your lab SIEM or script that flags “new account added to an admin group”.
  4. Repeat the action and verify your alert fires. This is a real detection technique used in security operations centres.

Common Mistakes

  • Giving users local administrator rights “to avoid support calls”.
  • Using one shared admin password across the estate.
  • Letting domain administrators log in to ordinary workstations.
  • Flat networks where any machine can connect to any other machine’s management ports.
  • Storing credentials in scripts, shares and documentation.

Practice Exercises

  1. Explain vertical versus horizontal privilege escalation, with one real-world example of each.
  2. Sketch a three-tier administration model for a company with 200 PCs, 20 servers and 2 domain controllers.
  3. List four events a defender should alert on that could indicate lateral movement.
  4. Describe how unique local admin passwords limit the damage of a single compromised laptop.

Mentor tip: When you review an environment, ask one question first: “If this one account were stolen today, what could it reach?” The answer usually reveals the most important fix.

Educational use only: audit only systems you own or are authorised to assess. Attempting to gain higher access on systems without permission is illegal.

Key takeaways
  • Escalation raises privileges; lateral movement spreads access to other systems.
  • Most escalation relies on misconfiguration, weak permissions, poor credential handling or missing patches.
  • Least privilege, unique admin passwords, tiered administration and segmentation break the chain.
  • Audit regularly and alert on new admins, new services and unusual remote logons.
  • Think in terms of blast radius: what can one stolen account reach?

Related Lessons