Skip to content

Linux Privilege Escalation ​

FieldValue
Module ID51
DifficultyEasy
TierTier II
CategoryOffensive
Estimated Time8 hours
Cubes Earned20
Experience Points1260
Creatorsmrb3n, Cry0l1t3
Last Updated2023-08-01T00:00:00.000000Z
URLhttps://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

#GroupTypeTitle
1IntroductiontheoryIntroduction to Linux Privilege Escalation
2Information GatheringinteractiveEnvironment Enumeration
3interactiveLinux Services & Internals Enumeration
4interactiveCredential Hunting
5Environment-based Privilege EscalationinteractivePath Abuse
6theoryWildcard Abuse
7interactiveEscaping Restricted Shells
8Permissions-based Privilege EscalationinteractiveSpecial Permissions
9interactiveSudo Rights Abuse
10interactivePrivileged Groups
11interactiveCapabilities
12Service-based Privilege EscalationinteractiveVulnerable Services
13interactiveCron Job Abuse
14interactiveLXD
15interactiveDocker
16theoryKubernetes
17interactiveLogrotate
18interactiveMiscellaneous Techniques
19Linux Internals-based Privilege EscalationinteractiveKernel Exploits
20interactiveShared Libraries
21interactiveShared Object Hijacking
22interactivePython Library Hijacking
23Recent 0-DaysinteractiveSudo
24interactivePolkit
25interactiveDirty Pipe
26theoryNetfilter
27Hardening ConsiderationstheoryLinux Hardening
28Skills AssessmentinteractiveLinux 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