Polkit
PolicyKit (polkit
) is an authorization service on Linux-based operating systems that allows user software and system components to communicate with each other if the user software is authorized to do so. To check whether the user software is authorized for this instruction, polkit
is asked.
Polkit works with two groups of files.
- actions/policies (
/usr/share/polkit-1/actions
) - rules (
/usr/share/polkit-1/rules.d
)
Polkit also has local authority
rules which can be used to set or remove additional permissions for users and groups. Custom rules can be placed in the directory /etc/polkit-1/localauthority/50-local.d
with the file extension .pkla
.
PolKit also comes with three additional programs:
pkexec
- runs a program with the rights of another user or with root rightspkaction
- can be used to display actionspkcheck
- this can be used to check if a process is authorized for a specific action
The most interesting tool for us, in this case, is pkexec
because it performs the same task as sudo
and can run a program with the rights of another user or root.
CVE-2021-4034: Pwnkit
To exploit this vulnerability, we need to download a PoC (https://github.com/arthepsy/CVE-2021-4034) and compile it on the target system itself or a copy we have made.
Move the poc file to the target machine and execute it to escalate privileges.
Last update: 2025-02-23 Created: February 23, 2025 12:06:38