arthepsy / CVE-2021-4034

PoC for PwnKit: Local Privilege Escalation Vulnerability in polkit’s pkexec (CVE-2021-4034)
1.04k stars 310 forks source link

[!] Error Execute on UBUNTU SERVER with no gcc [!] #1

Open instagmag opened 2 years ago

instagmag commented 2 years ago

./cve-2021-4034-poc sh: 1: gcc: not found GLib: Cannot convert message: Could not open converter from 'UTF-8' to 'PWNKIT' The value for the SHELL variable was not found the /etc/shells file

Polkit (pkexec --version) pkexec version 0.105

KERNEL (uname -a) Linux new-server1 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

toxyl commented 2 years ago

I've had the same problem, so I compiled the binary and the library separately (only for x86 64) and made an archive from the working check. It has a test-remote.sh script, pass to it a hostname (example.com, someone@example.com, the name of an entry from your SSH config, ..., whatever scp takes) and it will upload PwnKit to the host, run the exploit and if you get a shell, well, the host is vulnerable. And then use it to fix it (either update policykit or chmod 0755 /usr/bin/pkexec).

pwnkit-check.zip

kylincodelab commented 2 years ago

GLib: Cannot convert message: Could not open converter from “UTF-8” to “PWNKIT” The value for the SHELL variable was not found the /etc/shells file

anupamjaiswall commented 2 years ago

./cve-2021-4034-poc sh: 1: gcc: not found GLib: Cannot convert message: Could not open converter from 'UTF-8' to 'PWNKIT' The value for the SHELL variable was not found the /etc/shells file

Polkit (pkexec --version) pkexec version 0.105

KERNEL (uname -a) Linux new-server1 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

sudo apt update sudo apt install build-essential

babyshen commented 2 years ago

install gcc

toxyl commented 2 years ago

install gcc

not always a good idea, especially not when you are testing production servers

kenorb commented 2 years ago

Related PR: https://github.com/arthepsy/CVE-2021-4034/pull/2

ParnaviKulkarni commented 1 year ago

GLib: Cannot convert message: Could not open converter from “UTF-8” to “PWNKIT” The value for the SHELL variable was not found the /etc/shells file

Any solution for this? I am facing same issue