Support HackTricks and get benefits!
- If you want to see your company advertised in HackTricks or if you want access to the latest version of the PEASS or download HackTricks in PDF Check the SUBSCRIPTION PLANS!
- Get the official PEASS & HackTricks swag
- Discover The PEASS Family, our collection of exclusive NFTs
- Join the 💬 Discord group or the telegram group or follow me on Twitter 🐦 @carlospolopm.
- Share your hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
If you don't know anything about Kubernetes this is a good start. Read it to learn about the architecture, components and basic actions in Kubernetes:
{% content-ref url="kubernetes-basics.md" %} kubernetes-basics.md {% endcontent-ref %}
There are several possible Kubernetes services that you could find exposed on the Internet (or inside internal networks). If you find them you know there is Kubernetes environment in there.
Depending on the configuration and your privileges you might be able to abuse that environment, for more information:
{% content-ref url="pentesting-kubernetes-services.md" %} pentesting-kubernetes-services.md {% endcontent-ref %}
If you manage to compromise a Pod read the following page to learn how to enumerate and try to escalate privileges/escape:
{% content-ref url="attacking-kubernetes-from-inside-a-pod.md" %} attacking-kubernetes-from-inside-a-pod.md {% endcontent-ref %}
You might have managed to compromise user credentials, a user token or some service account token. You can use it to talk to the Kubernetes API service and try to enumerate it to learn more about it:
{% content-ref url="kubernetes-enumeration.md" %} kubernetes-enumeration.md {% endcontent-ref %}
Another important details about enumeration and Kubernetes permissions abuse is the Kubernetes Role-Based Access Control (RBAC). If you want to abuse permissions, you first should read about it here:
{% content-ref url="kubernetes-role-based-access-control-rbac.md" %} kubernetes-role-based-access-control-rbac.md {% endcontent-ref %}
Knowing about RBAC and having enumerated the environment you can now try to abuse the permissions with:
{% content-ref url="abusing-roles-clusterroles-in-kubernetes/" %} abusing-roles-clusterroles-in-kubernetes {% endcontent-ref %}
If you have compromised a namespace you can potentially escape to other namespaces with more interesting permissions/resources:
{% content-ref url="kubernetes-namespace-escalation.md" %} kubernetes-namespace-escalation.md {% endcontent-ref %}
If you have compromised a K8s account or a pod, you might be able able to move to other clouds. This is because in clouds like AWS or GCP is possible to give a K8s SA permissions over the cloud.
{% content-ref url="kubernetes-pivoting-to-clouds.md" %} kubernetes-pivoting-to-clouds.md {% endcontent-ref %}
{% content-ref url="kubernetes-hardening/" %} kubernetes-hardening {% endcontent-ref %}
Support HackTricks and get benefits!
- If you want to see your company advertised in HackTricks or if you want access to the latest version of the PEASS or download HackTricks in PDF Check the SUBSCRIPTION PLANS!
- Get the official PEASS & HackTricks swag
- Discover The PEASS Family, our collection of exclusive NFTs
- Join the 💬 Discord group or the telegram group or follow me on Twitter 🐦 @carlospolopm.
- Share your hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.