OSCP Linux Privilege Escalation Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Attempts: 12 | Questions: 20 | Updated: Aug 16, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. What is a race condition in privilege escalation?

Explanation

A race condition in privilege escalation occurs when a program checks whether a user may access a file, then accesses it later. If an attacker changes the file or its target during that brief interval, the program may act on a different resource than the one it checked, allowing unauthorized access or actions.

Submit
Please wait...
About This Quiz
OSCP Linux Privilege Escalation Quiz - Quiz

This quiz evaluates your understanding of Linux privilege escalation techniques essential for the OSCP certification. It covers kernel exploits, sudo misconfigurations, SUID binaries, cron jobs, and file permission vulnerabilities. Master these core concepts to identify and exploit weaknesses in Linux systems during penetration testing engagements.

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. How can checking /etc/sudoers reveal privilege escalation opportunities?

Explanation

The `/etc/sudoers` file defines which users may run specific commands with elevated privileges. Entries marked `NOPASSWD` allow those commands to run without entering a password. If a user can run overly powerful or exploitable commands this way, the configuration may provide a path to privilege escalation.

Submit

3. What is the primary risk of a binary calling 'system()' with unsanitized user input?

Explanation

The `system()` function passes a command to a shell. If user input is inserted without proper validation or escaping, an attacker can add shell commands, causing unintended actions or arbitrary code execution with the program’s privileges.

Submit

4. A script with a wildcard in a system command can be exploited how?

Explanation

When a script passes a wildcard to a command without safely handling its expansion, the shell substitutes matching filenames as arguments. An attacker who can create files in the relevant directory may choose filenames that resemble command-line options. The command can then interpret those filenames as flags, potentially changing its behavior or causing unintended actions.

Submit

5. How can you verify if a binary has SGID permissions?

Explanation

Run `ls -l` on the binary and inspect its permission string. An `s` in the group execute position indicates the SGID bit is set, such as `-rwxr-sr-x`. This means the program runs with the file’s group permissions.

Submit

6. Which environment variable can be manipulated to hijack library loading in vulnerable binaries?

Explanation

On dynamically linked systems, the runtime loader uses `LD_PRELOAD` to load specified libraries before others and `LD_LIBRARY_PATH` to search specified directories for shared libraries. If a vulnerable program inherits attacker-controlled values, these variables can redirect library loading to malicious code. Their impact may be limited by protections such as secure-execution mode or sanitized environments.

Submit

7. What does the 'noexec' mount option prevent?

Explanation

The `noexec` mount option prevents programs and executable binaries stored on that filesystem from being run. It does not, by itself, prevent users from reading or writing files, or stop the filesystem from being mounted.

Submit

8. How would you exploit a world-writable /tmp directory for privilege escalation?

Explanation

A world-writable /tmp lets users create or replace temporary files, but it does not by itself grant elevated privileges. Escalation becomes possible if a privileged process later executes or trusts an attacker-controlled script or file there, especially through unsafe temporary-file handling. This vulnerability should be addressed with secure file creation and permission checks.

Submit

9. A binary has the capability CAP_NET_BIND_SERVICE. What does this allow?

Explanation

CAP_NET_BIND_SERVICE allows a program to bind to privileged network ports below 1024 without running as root. It grants this specific networking permission, not general access to interfaces, firewall controls, or network traffic.

Submit

10. Which tool can enumerate potential privilege escalation vectors on a Linux system?

Explanation

LinEnum is a Linux enumeration script that inspects a host for configuration weaknesses and other clues that may enable privilege escalation. It checks items such as users and groups, sudo permissions, SUID files, writable paths, services, and kernel details. Its output helps identify potential escalation vectors for further review.

Submit

11. What does the SUID bit allow a binary to do when executed?

Explanation

The SUID (Set User ID) bit makes an executable run with the effective permissions of its owner, rather than those of the user who launched it. For example, a program owned by root with SUID set runs with root privileges while it executes.

Submit

12. How can you escalate privileges if a script runs as root and uses the 'input()' function in Python?

Explanation

Python’s `input()` only reads text; it does not execute commands by itself. If a root-running script later passes that text to a shell or evaluates it unsafely, crafted input may run commands with the script’s privileges. This depends on the script’s implementation, so `input()` alone does not create a privilege-escalation vulnerability.

Submit

13. Which file contains scheduled tasks that run with specific user privileges?

Explanation

`/etc/crontab` and the per-user crontab files in `/var/spool/cron/` store scheduled jobs. System crontab entries can specify the user account under which each task runs, while user crontabs run with the privileges of their owner.

Submit

14. A setuid binary calls a relative path to an external program. What vulnerability could exist?

Explanation

If a setuid program launches an external command without using an absolute path, the system may search directories listed in `PATH`. An attacker who can influence `PATH` or write to an earlier directory could provide a malicious executable, potentially causing it to run with the program’s elevated privileges.

Submit

15. What does the command 'sudo -l' do?

Explanation

The `sudo -l` command lists the commands and privileges available to the current user through `sudo`, based on the system’s sudoers configuration. This helps users check which administrative actions they are authorized to perform.

Submit

16. How can you check if a binary is vulnerable to library hijacking?

Explanation

Library hijacking occurs when a program loads a malicious library in place of an expected one. Use `ldd` to identify the binary’s shared-library dependencies, then inspect its library search paths, including `LD_LIBRARY_PATH`, for directories writable by untrusted users. Such directories could allow an attacker to place a substitute library that runs when the binary starts.

Submit

17. Which Linux kernel versions are commonly vulnerable to the Dirty COW exploit?

Explanation

Dirty COW (CVE-2016-5195) was a race-condition vulnerability in Linux’s memory-management code that could let a local user gain elevated privileges. It affected many kernels before fixes were released, including versions earlier than 4.8.3 and the patched 3.2.73 release; newer versions generally include the fix.

Submit

18. What vulnerability exists when a cron job runs a script with world-writable permissions?

Explanation

If a script run by cron is world-writable, any user can alter its contents. When cron executes the modified script, it runs with the cron job owner’s privileges, potentially allowing an attacker to perform unauthorized actions.

Submit

19. A user can run /usr/bin/wget as root via sudo without a password. How could this lead to privilege escalation?

Explanation

If `/usr/bin/wget` can run through `sudo` without a password, an attacker may use it to download a malicious script and then execute that script with elevated privileges, potentially gaining full root access.

Submit

20. Which command displays files with SUID permissions set?

Explanation

`find / -perm -4000` searches the filesystem for files with the SUID bit set. The `2>/dev/null` part suppresses permission-denied error messages, making the results easier to read.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What is a race condition in privilege escalation?
How can checking /etc/sudoers reveal privilege escalation...
What is the primary risk of a binary calling 'system()' with...
A script with a wildcard in a system command can be exploited how?
How can you verify if a binary has SGID permissions?
Which environment variable can be manipulated to hijack library...
What does the 'noexec' mount option prevent?
How would you exploit a world-writable /tmp directory for privilege...
A binary has the capability CAP_NET_BIND_SERVICE. What does this...
Which tool can enumerate potential privilege escalation vectors on a...
What does the SUID bit allow a binary to do when executed?
How can you escalate privileges if a script runs as root and uses the...
Which file contains scheduled tasks that run with specific user...
A setuid binary calls a relative path to an external program. What...
What does the command 'sudo -l' do?
How can you check if a binary is vulnerable to library hijacking?
Which Linux kernel versions are commonly vulnerable to the Dirty COW...
What vulnerability exists when a cron job runs a script with...
A user can run /usr/bin/wget as root via sudo without a password. How...
Which command displays files with SUID permissions set?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!