Skip to content

Expert · Deeper lab skills: passwords, privilege, Metasploit, wireless · topic 26 of 35 · 18 min

Privilege escalation concepts (labs only)

Explanation

Privilege escalation is turning limited access into higher access — for example, a normal user becoming administrator. You study the common causes (misconfigurations, excessive permissions, old software) and, crucially, how defenders prevent and detect them. All practice is on your own lab machines.

What privilege escalation means

When an attacker first gets in, they often have only limited rights — a normal user account, not administrator. Privilege escalation is any way of gaining higher rights from there. "Vertical" escalation means going from a low-privilege user to an admin/root. "Horizontal" means taking over another user's account at the same level. It is a key step in a real attack, so defenders must understand it to stop it.

Common causes (studied to fix them)

AreaTypical causeDefence
LinuxOver-permissive sudo rules or SUID binariesLeast-privilege sudo; audit SUID files
Linux/WindowsWeak file permissions on sensitive files/servicesCorrect ownership and permissions
SoftwareOld, unpatched OS or services with known flawsPatch and update regularly
SecretsPasswords or keys left in files or scriptsRemove secrets; use a secrets manager
WindowsMisconfigured services an attacker can alterHarden services; restrict who can change them

Notice the pattern: almost every cause is a mistake in configuration or an un-patched flaw. That is why the defence is mostly good hygiene — least privilege, correct permissions, patching, and removing secrets. You learn the causes so you can find and fix them, not so you can exploit someone.

Think of it like this: Think of an office where a temporary pass accidentally also opens the manager's cabin. Privilege escalation is noticing and using that mistake. The fix is to make sure each pass opens only what it should — least privilege.

Detection and defence

Detection: sudden use of admin commands by a normal account, new admin users appearing, changes to sensitive files, and alerts from endpoint protection. Defence: least privilege everywhere, patching, file-integrity monitoring, and logging of privilege use to a SIEM. A well-run system makes escalation hard and noisy.

Careful: Practise privilege-escalation techniques only on machines you own in your lab (for example Metasploitable or a VM you built). Attempting to raise your privileges on any system you do not own — a shared server, a workplace machine — is unauthorised access and a serious offence.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

Privilege escalation concepts (labs only) · 1/7

Low user → admin/root

Privilege escalation turns limited access into higher access.

Prefer a video by a teacher? Find free videos on “privilege escalation concepts linux windows defence explained” on YouTube ↗

In real life: A lab misconfiguration

In her lab, a learner finds that a normal user can run a particular command as root because of a loose sudo rule she deliberately set up to study. She notes how it could be used to gain root, then fixes the sudo rule to least privilege and confirms the path is closed. Her write-up reads like a real finding: the misconfiguration, its impact (vertical privilege escalation), and the exact fix.

Practice (0/3 done)

Task 1 · Question

Vertical privilege escalation means going from…

Task 2 · Question

Most privilege-escalation causes are…

Task 3 · Practice

List four hygiene measures that prevent most privilege escalation, with one line each on why.

Quick quiz

Question 1

1.A loose sudo rule can lead to…

Question 2

2.The main defence against privilege escalation is…

Question 3

3.Secrets left in scripts are dangerous because…

Question 4

4.You may practise escalation on…

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

A loose sudo rule can lead to…

Answer: Privilege escalation to root

Over-permissive sudo lets a user run admin commands.

The main defence against privilege escalation is…

Answer: Least privilege and patching

Good hygiene closes most escalation paths.

Secrets left in scripts are dangerous because…

Answer: An attacker who reads them can gain more access

Leaked credentials hand attackers a path to higher access.

You may practise escalation on…

Answer: Only machines you own in your lab

Only your own lab machines.

Which permissions should a private SSH key file have?Related

Answer: 600

Only the owner should read or write a private key. SSH rejects keys that others can read.

From Users, groups and permissions

Which tool finds resources shared with outside accounts and unused permissions?Related

Answer: IAM Access Analyzer

IAM Access Analyzer reports external access, unused access and policy problems.

From IAM: users, groups, roles and least privilege

You may test wireless attacks on…Related

Answer: Only your own network and equipment

Only your own equipment; others are illegal to test.

From Wireless security concepts

What does "least privilege" mean for the app's database user?Related

Answer: It has only the permissions the app needs

Limits the damage if something goes wrong.

From SQL injection and safe queries

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. 2 more topics in “Deeper lab skills: passwords, privilege, Metasploit, wireless” before its exam: Metasploit basics (in the lab), Wireless security concepts.
  2. Module 8 exam: deeper lab skills · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. Then the next module, Post-exploitation ethics and reporting. 35 topics left in the course before the final exam.

← Previous: Password hashing and cracking (your own hashes only)