Bobcares

For every $500 you spend, we will provide you with a $500 credit on your account*

BLACK FRIDAY SPECIAL

*The maximum is $4000 in credits, Offer valid till December 6th, 2024, New Customers Only, Credit will be applied after purchase and expires after six (6) months

For every $500 you spend, we will provide you with a $500 credit on your account*

BLACK FRIDAY SPECIAL

*The maximum is $4000 in credits, Offer valid till December 6th, 2024, New Customers Only, Credit will be applied after purchase and expires after six (6) months

Polkit Privilege Escalation Vulnerability

by | Mar 27, 2022

Wondering how to fix Polkit Privilege Escalation Vulnerability? We can help you.

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.

Let’s take a look at how our Support Team help a customer  deal with this issue.

Polkit Privilege Escalation Vulnerability

It is easy to test the Polkit privilege escalation vulnerability using the readily available exploit.

The exploit is available on Github.

Just you need to download the exploit, compel and execute it. Follow these simple four commands to exploit the Polkit vulnerability.

These commends will take you to the ‘#’ root prompt if the system is vulnerable.

  • Firstly, install Git
$ sudo apt install git (On Ubuntu)
$ sudo yum install git (On RHEL)
  • Then, clone the exploit script from Github
$ git clone https://github.com/berdav/CVE-2021-4034.git
  • Then, change directory into ‘CVE-2021-4034’
$ cd CVE-2021-4034/
  • Compile the script using ‘make’ command

$ make

  • Finally, test the Polkit Privilege Escalation Vulnerability

$ ./cve-2021-4034

Today, let us see the steps followed by our Support Techs to resolve it:

You can either download the packages from the Linux distribution websites or upgrade the package alone. Or run the system update.

The problem could fix after running the system update.

Use This Command To Update The Polkit Package On Ubuntu:

$ sudo apt install <package name>

Then, use This Command To Update The Polkit Package On RedHat Or CentOS:

$ sudo yum install <package name>

Use These Command If You Want To Update The System:

$ sudo apt update && sudo apt upgrade
$ sudo yum update && sudo yum upgrade

Those who can’t apply the patches, there is a workaround for them. Run this command to strip pkexec of the setuid bit.

$ chmod 0755 /usr/bin/pkexec

Red Hat Product Security strongly recommends affected customers update the polkit package once it is available.

For customers who cannot update immediately, the issue can mitigate by executing the following steps:

1. Firstly, install the following required systemtap packages and dependencies: https://access.redhat.com/solutions/5441.

2. Then, install polkit debug info:

debuginfo-install polkit

3. Next, create the following systemtap script, and name it pkexec-block.stp:

probe process("/usr/bin/pkexec").function("main") {

if (cmdline_arg(1) == "")

raise(9);

}

4. Then, load the systemtap module into the running kernel:

stap -g -F -m stap_pkexec_block pkexec-block.stp

5. Ensure the module is loaded:

lsmod | grep -i stap_pkexec_block
stap_pkexec_block 434176 0

6. Once the polkit package is updated to the version containing the fix, remove the systemtap generated kernel module by running:

rmmod stap_pkexec_block

After using the rmmod command, a system reboot isn’t required.

[Need a solution to another query? We are just a click away.]

Conclusion

Today, we saw steps followed by our Support Engineers to resolve Polkit Privilege Escalation Vulnerability.


PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.