Linux Privilege Escalation
| Field | Value |
|---|---|
| Module ID | 51 |
| Difficulty | Easy |
| Tier | Tier II |
| Category | Offensive |
| Estimated Time | 8 hours |
| Cubes Earned | 20 |
| Experience Points | 1260 |
| Creators | mrb3n, Cry0l1t3 |
| Last Updated | 2023-08-01T00:00:00.000000Z |
| URL | https://academy.hackthebox.com/app/module/51 |
Module Includes
- 28 Sections
- 23 Interactive Exercises
- 1 Assessments
- 20 Cubes
Module Description
Privilege escalation is a crucial phase during any security assessment. During this phase, we attempt to gain access to additional users, hosts, and resources to move closer to the assessment's overall goal. There are many ways to escalate privileges. This module aims to cover the most common methods emphasizing real-world misconfigurations and flaws that we may encounter in a client environment. The techniques covered in this module are not an exhaustive list of all possibilities and aim to avoid extreme "edge-case" tactics that may be seen in a Capture the Flag (CTF) exercise.
Module Summary
This module covers a wide variety of techniques that can be utilized to escalate privileges on Linux systems. Privilege escalation is an essential part of a penetration test or red team assessment. Having a deep understanding of the Linux operating system, strong enumeration skills, and knowledge of many local privilege escalation techniques can make or break an assessment and set us apart from others in the field.
In this module, we will cover:
- Enumerating a Linux system
- Kernel exploits
- Exploiting vulnerable services
- Abusing misconfigurations and permissions issues
- Hunting for credentials
- Shared object hijacking and leveraging shared libraries
- Taking advantage of a privileged group membership
- One-off context-dependent techniques
- Linux security hardening best practices
CREST CPSA/CRT-related Sections:
- All sections
CREST CCT APP-related Sections:
- All sections
CREST CCT INF-related Sections:
- All sections
This module is broken down into sections with accompanying hands-on exercises to practice each of the tactics and techniques we cover. The module ends with a practical hands-on skills assessment to gauge your understanding of the various topic areas.
As you work through the module, you will see example commands and command output for the various topics introduced. It is worth reproducing as many of these examples as possible to reinforce further the concepts introduced in each section. You can do this in the target host provided in the interactive sections or your own virtual machine.
You can start and stop the module at any time and pick up where you left off. There is no time limit or "grading," but you must complete all of the exercises and the skills assessment to receive the maximum number of cubes and have this module marked as complete in any paths you have chosen.
The module is classified as "Easy" but assumes a working knowledge of the Linux command line and an understanding of information security fundamentals.
A firm grasp of the following modules can be considered prerequisites for successful completion of this module:
- Introduction to Networking
- Linux Fundamentals
Sections
28 sections - 23 Interactive
| # | Group | Type | Title |
|---|---|---|---|
| 1 | Introduction | theory | Introduction to Linux Privilege Escalation |
| 2 | Information Gathering | interactive | Environment Enumeration |
| 3 | interactive | Linux Services & Internals Enumeration | |
| 4 | interactive | Credential Hunting | |
| 5 | Environment-based Privilege Escalation | interactive | Path Abuse |
| 6 | theory | Wildcard Abuse | |
| 7 | interactive | Escaping Restricted Shells | |
| 8 | Permissions-based Privilege Escalation | interactive | Special Permissions |
| 9 | interactive | Sudo Rights Abuse | |
| 10 | interactive | Privileged Groups | |
| 11 | interactive | Capabilities | |
| 12 | Service-based Privilege Escalation | interactive | Vulnerable Services |
| 13 | interactive | Cron Job Abuse | |
| 14 | interactive | LXD | |
| 15 | interactive | Docker | |
| 16 | theory | Kubernetes | |
| 17 | interactive | Logrotate | |
| 18 | interactive | Miscellaneous Techniques | |
| 19 | Linux Internals-based Privilege Escalation | interactive | Kernel Exploits |
| 20 | interactive | Shared Libraries | |
| 21 | interactive | Shared Object Hijacking | |
| 22 | interactive | Python Library Hijacking | |
| 23 | Recent 0-Days | interactive | Sudo |
| 24 | interactive | Polkit | |
| 25 | interactive | Dirty Pipe | |
| 26 | theory | Netfilter | |
| 27 | Hardening Considerations | theory | Linux Hardening |
| 28 | Skills Assessment | interactive | Linux Local Privilege Escalation - Skills Assessment |
Conclusion
In this module, we covered enumerating a Linux system after gaining a foothold, various privilege escalation techniques, and security hardening best practices for Linux systems.
Module Key Takeaways
- Linux enumeration
- Exploiting vulnerable services, and out-of-date, vulnerable kernels
- Techniques to abuse various misconfigurations and permissions issues
- Credential hunting
- Taking advantage of privileged group membership
- Less common and advanced techniques
- Best practices for hardening a Linux system