Expert · Deeper lab skills: passwords, privilege, Metasploit, wireless · topic 26 of 35 · 18 min
Privilege escalation concepts (labs only)
Explanation
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)
| Area | Typical cause | Defence |
|---|---|---|
| Linux | Over-permissive sudo rules or SUID binaries | Least-privilege sudo; audit SUID files |
| Linux/Windows | Weak file permissions on sensitive files/services | Correct ownership and permissions |
| Software | Old, unpatched OS or services with known flaws | Patch and update regularly |
| Secrets | Passwords or keys left in files or scripts | Remove secrets; use a secrets manager |
| Windows | Misconfigured services an attacker can alter | Harden 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.
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.
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
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)
Vertical privilege escalation means going from…
Most privilege-escalation causes are…
List four hygiene measures that prevent most privilege escalation, with one line each on why.
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- Metasploit basics (in the lab)Deeper lab skills: passwords, privilege, Metasploit, wireless · same module
- Wireless security conceptsDeeper lab skills: passwords, privilege, Metasploit, wireless · same module
- Users, groups and permissionsDevOps: Git, Docker, Kubernetes and CI/CD · Linux for DevOps
- IAM: users, groups, roles and least privilegeCloud Computing (AWS, Azure, Google Cloud) · AWS account, IAM and billing
- SQL injection and safe queriesJava Programming (Core to Spring Boot) · JDBC, Maven, Gradle and JUnit
- Identity and access management, least privilege and RBACCyber Security: from zero to SOC analyst · Identity and network defence
Questions people ask about this
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.
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.
You may test wireless attacks on…Related
Answer: Only your own network and equipment
Only your own equipment; others are illegal to test.
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.
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
- 2 more topics in “Deeper lab skills: passwords, privilege, Metasploit, wireless” before its exam: Metasploit basics (in the lab), Wireless security concepts.
- Module 8 exam: deeper lab skills · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
- 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)